Project1
标题:
怎样才能在存档中显示头像而不是行走图?
[打印本页]
作者:
笨笨兜兜
时间:
2007-8-29 22:43
标题:
怎样才能在存档中显示头像而不是行走图?
有在以前的帖子中看到过对于这个的讲解,但是按照那个方法作了不成功,能否给个范例工程或者QQ里帮助下~{/pz}
本人刚刚注册,估计没法给出悬赏。。。。很急
可以的人加我QQ463381402
我这里只有100积分, 做出来的话可以全部给,但是目前还不知道怎么给 可以告诉我怎么给就行~ [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
笨笨兜兜
时间:
2007-8-29 22:43
标题:
怎样才能在存档中显示头像而不是行走图?
有在以前的帖子中看到过对于这个的讲解,但是按照那个方法作了不成功,能否给个范例工程或者QQ里帮助下~{/pz}
本人刚刚注册,估计没法给出悬赏。。。。很急
可以的人加我QQ463381402
我这里只有100积分, 做出来的话可以全部给,但是目前还不知道怎么给 可以告诉我怎么给就行~ [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
湛蓝de海
时间:
2007-8-29 22:45
貌似主站有些类似脚本.
不满意可以去悬赏.
作者:
dv890
时间:
2007-8-29 23:02
好像没什么用吧!
作者:
dv890
时间:
2007-8-29 23:04
可以去看大富翁同人游戏里面的脚本!
作者:
Zeiro
时间:
2007-8-29 23:06
提示:
作者被禁止或删除 内容自动屏蔽
作者:
dv890
时间:
2007-8-29 23:10
我搞错了!
抱歉!
作者:
Zeiro
时间:
2007-8-29 23:13
提示:
作者被禁止或删除 内容自动屏蔽
作者:
索尔迦·蓝
时间:
2007-8-29 23:14
提示:
作者被禁止或删除 内容自动屏蔽
作者:
笨笨兜兜
时间:
2007-8-29 23:15
http://rpg.blue/viewthread.php?tid=66798
刚刚找到了一个 可是按照那种方法作了,图片还是出不来。。。。
作者:
dv890
时间:
2007-8-29 23:22
#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
# 显示存档以及读档画面、保存文件的窗口。
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :filename # 文件名
attr_reader :selected # 选择状态
#--------------------------------------------------------------------------
# ● 初始化对像
# file_index : 存档文件的索引 (0~3)
# filename : 文件名
#--------------------------------------------------------------------------
def initialize(file_index, filename)
super(0, 64 + file_index % 4 * 104, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
@file_index = file_index
@filename = "Save#{@file_index + 1}.rxdata"
@time_stamp = Time.at(0)
@file_exist = FileTest.exist?(@filename)
if @file_exist
file = File.open(@filename, "r")
@time_stamp = file.mtime
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@game_system = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
file.close
end
refresh
@selected = false
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 描绘文件编号
self.contents.font.color = normal_color
name = "文件 #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
# 存档文件存在的情况下
if @file_exist
# 描绘角色
for i in
[email protected]
testname = @characters
[2]+"_f.png"
if FileTest.exist?("Graphics/battlers/#{testname}")
sp = Sprite.new
sp.bitmap=Bitmap.new("Graphics/battlers/#{testname}")
sp.zoom_x = 80 / sp.bitmap.width
sp.zoom_y = 80 / sp.bitmap.height
src_rect = Rect.new(0, 0, 80, 80) #——可自己调整大小
x = 300 - @characters.size * 32 + i * 64 - sp.bitmap.width / 2
self.contents.blt(x, 0, sp.bitmap, src_rect)
else
bitmap = RPG::Cache.character(@characters
[0], @characters
[1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
end
# 描绘游戏时间
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
# 描绘时间标记
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
#--------------------------------------------------------------------------
# ● 设置选择状态
# selected : 新的选择状态 (true=选择 false=不选择)
#--------------------------------------------------------------------------
def selected=(selected)
@selected = selected
update_cursor_rect
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
if @selected
self.cursor_rect.set(0, 0, @name_width + 8, 32)
else
self.cursor_rect.empty
end
end
end
作者:
dv890
时间:
2007-8-29 23:22
修改是在
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 描绘文件编号
self.contents.font.color = normal_color
name = "文件 #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
# 存档文件存在的情况下
if @file_exist
# 描绘角色
for i in
[email protected]
testname = @characters
[2]+"_f.png"
if FileTest.exist?("Graphics/battlers/#{testname}")
sp = Sprite.new
sp.bitmap=Bitmap.new("Graphics/battlers/#{testname}")
sp.zoom_x = 80 / sp.bitmap.width
sp.zoom_y = 80 / sp.bitmap.height
src_rect = Rect.new(0, 0, 80, 80) #——可自己调整大小
x = 300 - @characters.size * 32 + i * 64 - sp.bitmap.width / 2
self.contents.blt(x, 0, sp.bitmap, src_rect)
else
bitmap = RPG::Cache.character(@characters
[0], @characters
[1])
cw = bitmap.rect.width / 4
ch = bitmap.rect.height / 4
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
end
# 描绘游戏时间
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
# 描绘时间标记
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
作者:
dv890
时间:
2007-8-29 23:23
然后再加入这脚本:
#==============================================================================
# ■ Scene_Save
#------------------------------------------------------------------------------
# 处理存档画面的类。
#==============================================================================
class Scene_Save < Scene_File
include OPACITY_66RPG
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super("要保存到这个文件吗?")
end
#--------------------------------------------------------------------------
# ● 确定时的处理
#--------------------------------------------------------------------------
def on_decision(filename)
# 演奏存档 SE
$game_system.se_play($data_system.save_se)
# 写入存档数据
file = File.open(filename, "wb")
write_save_data(file)
file.close
# 如果被事件调用
if $game_temp.save_calling
# 清除存档调用标志
$game_temp.save_calling = false
# 切换到地图画面
$scene = Scene_Map.new
return
end
# 切换到菜单画面
$scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# ● 取消时的处理
#--------------------------------------------------------------------------
def on_cancel
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 如果被事件调用
if $game_temp.save_calling
# 清除存档调用标志
$game_temp.save_calling = false
# 切换到地图画面
$scene = Scene_Map.new
return
end
# 切换到菜单画面
$scene = Scene_Menu.new(4)
end
#--------------------------------------------------------------------------
# ● 写入存档数据
# file : 写入用文件对像 (已经打开)
#--------------------------------------------------------------------------
def write_save_data(file)
# 生成描绘存档文件用的角色图形
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
characters.push([actor.character_name, actor.character_hue,actor.battler_name])
end
# 写入描绘存档文件用的角色数据
Marshal.dump(characters, file)
# 写入测量游戏时间用画面计数
Marshal.dump(Graphics.frame_count, file)
# 增加 1 次存档次数
$game_system.save_count += 1
# 保存魔法编号
# (将编辑器保存的值以随机值替换)
$game_system.magic_number = $data_system.magic_number
# 写入各种游戏对像
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
alias m main
def main
create_screen
m
dispose_screen
end
end
作者:
dv890
时间:
2007-8-29 23:24
应该可以吧
作者:
Zeiro
时间:
2007-8-29 23:26
提示:
作者被禁止或删除 内容自动屏蔽
作者:
dv890
时间:
2007-8-29 23:33
啊!我也是不知道啊!
我是新手啊!
刚刚才完成一个试玩版游戏!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1