赞 | 123 |
VIP | 13 |
好人卡 | 16 |
积分 | 194 |
经验 | 38692 |
最后登录 | 2024-11-17 |
在线时间 | 3102 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 19433
- 在线时间
- 3102 小时
- 注册时间
- 2013-1-11
- 帖子
- 1291
|
如果要循环的话就加个坐标超出判断在还原
- class Window_XXX < Window_Selectable
-
- def initialize
- @s_index = -1
- @deviation = Array.new(item_max, 0)
- super(0, 0, 300, 96)
- activate
- select(0)
- refresh
- end
-
- def item_max
- return 3
- end
- alias :old_update :update
- def update
- old_update
- if @index != @s_index
- @s_index = @index
- @deviation = Array.new(item_max, 0)
- end
- @deviation[@index] += 2 ######
- self.cursor_rect.x = @rect.x + @deviation[@index]
- refresh
- end
- def draw_item(index)
- @rect = item_rect(index)
- @rect.x += @deviation[index]
- draw_text(@rect, "XXXXX")
- end
- end
- class Scene_Map < Scene_Base
-
- alias :old_create_all_windows :create_all_windows
- def create_all_windows
- old_create_all_windows
- @xxx = Window_XXX.new
- end
-
- end
复制代码 |
|