Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Scene_Custom < Scene_Base
- def start
- super
- create_background
- create_icons
- @current_index = 0
- @message_window = Window_Message.new
- end
- def create_background
- @back = Sprite.new
- @back.bitmap = Cache.picture('back')
- end
- def create_icons
- @icons = Array.new(4){Sprite.new}
- @icons.each_with_index{|item, index|
- case index
- when 0
- pic = 'char3'
- x, y = 69, 100
- when 1
- pic = 'char1'
- x, y = 214, 104
- when 2
- pic = 'char2'
- x, y = 393, 89
- when 3
- pic = 'icon'
- x, y = 468, 342
- end
- item.bitmap = Cache.picture(pic)
- item.x, item.y, item.z = x, y, 1
- }
- end
- def update
- super
- update_input
- update_icon
- end
- def update_input
- return if $game_message.busy?
- if Input.repeat?(:RIGHT)
- Sound.play_cursor
- @current_index = (@current_index+1)%4
- end
- if Input.repeat?(:LEFT)
- Sound.play_cursor
- @current_index = (@current_index-1)%4
- end
- if Input.trigger?(:C)
- if @current_index <= 2
- text = ['...','你好','嘿嘿']
- $game_message.add(text[@current_index])
- else
- end
- end
- end
- def update_icon
- @icons.each_with_index{|item, index|
- index == @current_index ? item.tone.set(255,0,0) : item.tone.set(0,0,0)
- }
- end
- def terminate
- super
- @back.dispose
- @icons.each{|item| item.dispose}
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement