| 赞 | 5 |
| VIP | |
| 好人卡 | |
| 积分 | 73 |
| 经验 | |
| 最后登录 | 2026-7-13 |
| 在线时间 | 1244 小时 |
- 梦石
- 0
- 星屑
- 7296
- 在线时间
- 1244 小时
- 注册时间
- 2015-8-15
- 回帖
- 473
|
楼主 |
发表于 2016-1-25 11:48:32
|
显示全部楼层
本帖最后由 金芒芒 于 2016-1-25 11:54 编辑
夜狠简单 发表于 2016-1-24 20:47 
$scene = Scene_Menu.new(4) 后面的4就是返回的位置了,把那个数字改为对应的就好
角色图片的光标消失了,下面那张是有的不过选择第2到第4个角色光标位置还在第一个
[pre lang="ruby"]class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化目标
#--------------------------------------------------------------------------
def initialize
super(0, 64, 1200, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = 0 #这里不知道哪里出错了
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# @item_max = 4 #$game_party.actors.size
# @item_may = 4
# @column_max = 4
# for i in 0...4 #$game_party.actors.size
# x = i * 116
# y = 0
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
@column_max = 4
x = ( i + 1 ) * 92 +25
y = 44
actor = $game_party.actors
bitmap = Bitmap.new ("Graphics/Status/" + actor.id. to_s + "_h") #RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - ch , y - cw/ 2, bitmap, src_rect)
#draw_actor_graphic(actor, x - 40, y + 80)
# draw_actor_name(actor, x, y)
# draw_actor_class(actor, x + 144, y)
# draw_actor_level(actor, x, y + 32)
# draw_actor_state(actor, x + 90, y + 32)
# draw_actor_exp(actor, x, y + 64)
# draw_actor_hp(actor, x + 236, y + 32)
# draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# ● 刷新光标矩形
#--------------------------------------------------------------------------
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
end
# 计算光标的宽
cursor_width = 90
#cursor_width = 536 / (@column_max + 1) + 1 #光标大小
# 计算光标坐标
x = 0 + @index % @column_max * (cursor_width + 1) - 4 #光标位置调节 覆盖31行
y = @index / @column_max * 32 - self.oy
# 更新国标矩形
self.cursor_rect.set(x, y, cursor_width, 128)#(x, y, cursor_width, 32)
end
[/pre] |
|