仙剑之十里坡
标题:
【开荒】请问如何在存档界面调用角色等级?
[打印本页]
作者:
BlackFeather
时间:
2010-2-10 17:54
标题:
【开荒】请问如何在存档界面调用角色等级?
要做一个战棋……用了截图脚本“其实截图功能太冲突,#了”
准备把原本的截图区改为角色档案,却不知调用,怎么办?
附:时间记录已删除
作者:
七夕小雨
时间:
2010-2-10 22:48
其实很简单~据我的了解,6R过去只有一个截图调用的脚本
找到脚本内class Window_File这个东东具体内容在下面
然后一直到这个class的end 修改成我的样子就好了,不过坐标自己对齐,这里只表现第一位角色信息
class Window_File < Window_Base
attr_accessor :index
def initialize(index = 0)
super(160,0,480,480)
self.contents = Bitmap.new(width - 32, height - 32)
@index = index
@sp_ch = []
@sp_ch[0] = Sprite.new
refresh
end
def refresh
self.contents.clear
for i in @sp_ch
i.visible = false
end
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
else
self.contents.draw_text(32,64,400,32,"无存档")
end
file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "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
for i in
0...@characters.size
@sp_ch
= Sprite.new
@sp_ch
.visible = true
@sp_ch
.bitmap = RPG::Cache.battler(@characters
[3], @characters
[4])
@sp_ch
.x = 180 + i*100
@sp_ch
.y = 460 - @sp_ch
.bitmap.height
@sp_ch
.z = 101
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, 390, 420, 32, time_string, 2)
# 描绘时间标记
self.contents.font.color = normal_color
draw_actor_class($game_actors[1], 400, 32)
draw_actor_level($game_actors[1], 300, 32)
draw_actor_state($game_actors[1], 480, 32)
draw_actor_hp($game_actors[1], 300, 64, 150)
draw_actor_sp($game_actors[1], 300, 96, 150)
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 420, 420, 32, time_string, 2)
else
self.contents.draw_text(32,64,400,32,"这个存档是空的")
end
end
def dispose
super
for i in @sp_ch
i.dispose
end
end
end
作者:
BlackFeather
时间:
2010-2-12 08:17
能把注释写具体吗?
作者:
七夕小雨
时间:
2010-2-12 13:07
你粘贴换上用不就好了嘛~
draw_actor_class($game_actors[1], 400, 32)
draw_actor_level($game_actors[1], 300, 32)
draw_actor_state($game_actors[1], 480, 32)
draw_actor_hp($game_actors[1], 300, 64, 150)
draw_actor_sp($game_actors[1], 300, 96, 150)
这几行是绘制状态的,$game_actors[1]代表一号角色,
后面是坐标,具体可以自己试试看
作者:
BlackFeather
时间:
2010-2-22 19:04
这个……
我是想要按队伍中的角色来的……
作者:
七夕小雨
时间:
2010-2-23 20:30
= =做循环不就好了~然后调整好坐标
def一个绘制
比如
def draw_saveload(a,x,y)
draw_actor_class($game_actors[a], x+100, y)
draw_actor_level($game_actors[a], x, y)
draw_actor_state($game_actors[a], x+180, y)
draw_actor_hp($game_actors[a], 300, x, y+100)
draw_actor_sp($game_actors[a], 300, x, y+100)
end
然后调用定义好的方法
for i in 0...$game_party.actors.size
def draw_saveload(i,i*160,i*32)
end
如此就好了啊
欢迎光临 仙剑之十里坡 (http://palslp.com/bbs/)
Powered by Discuz! X2.5