Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Scene_NameInput
- def adjust_char_texts
- end
- RectWidths = 0
- Bases_X = [2000, 3000, 4000, 5000, 5000]
- def initialize(default_name, max_length, character = nil)
- @default_name = default_name
- @name = default_name.split(//)[0,max_length]
- @max_length = max_length
- @viewport = Viewport.create(:main, 20000)
- @background = Sprite.new(@viewport)
- .set_bitmap("NameInput_Fond", :interface)
- adjust_char_texts
- init_key_text
- init_input_chars
- @cursor = Sprite.new(@viewport)
- @maj_c = Sprite::WithColor.new(@viewport)
- .set_position(230, 200)
- .set_bitmap("", :interface)
- .set_color([0, 1.0, 0.39, 1.0])
- @character = Sprite.new(@viewport)
- #>Pokémon
- if(character.class == PFM::Pokemon)
- @character.bitmap = character.icon
- @character.set_position(18, 8).mirror = true
- @character.src_rect.width = @character.src_rect.height
- elsif(character)
- @character.bitmap = RPG::Cache.character(character)
- width = @character.bitmap.width/4
- height = @character.bitmap.height/4
- @character.src_rect.set(0, 0, width, height)
- @character.set_position(10 + (48 - width)/2, (48 - height) / 2)
- end
- @index_x = 0
- @index_y = 0
- @opacity = 10
- end
- def update
- op = @cursor.opacity
- @cursor.opacity += @opacity
- @opacity -= 2*@opacity if op == @cursor.opacity
- unless(@cursor.visible)
- return update_keyboard
- end
- @cursor.visible = false
- @lastctrl = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement