~Site
¤Accueil
¤Forum
¤Admin

~Base de scripts
¤Scripts de base
¤Scripts Menu
¤Scripts Combat
¤Scripts Système
¤Scripts Modifiés

Scripts de Base
Game_Temp
Game_System
Game_Switches
Game_Variables
Game_SelfSwitches
Game_Screen
Game_Picture
Game_Battler 1
Game_Battler 2
Game_Battler 3
Game_BattleAction
Game_Actor
Game_Enemy
Game_Actors
Game_Party
Game_Troop
Game_Map
Game_CommonEvent
Game_Character 1
Game_Character 2
Game_Character 3
Game_Event
Game_Player
Sprite_Character
Sprite_Battler
Sprite_Picture
Sprite_Timer
Spriteset_Map
Spriteset_Battle
Window_Base
Window_Selectable
Window_Command
Window_Help
Window_Gold
Window_PlayTime
Window_Steps
Window_MenuStatus
Window_Item
Window_Skill
Window_SkillStatus
Window_Target
Window_EquipLeft
Window_EquipRight
Window_EquipItem
Window_Status
Window_SaveFile
Window_ShopCommand
Window_ShopBuy
Window_ShopSell
Window_ShopNumber
Window_ShopStatus
Window_NameEdit
Window_NameInput
Window_InputNumber
Window_Message
Window_PartyCommand
Window_BattleStatus
Window_BattleResult
Window_DebugLeft
Window_DebugRight
Window_Dataset
Arrow_Base
Arrow_Enemy
Arrow_Actor
Interpreter 1
Interpreter 2
Interpreter 3
Interpreter 4
Interpreter 5
Interpreter 6
Interpreter 7
Scene_Title
Scene_Map
Scene_Menu
Scene_Item
Scene_Skill
Scene_Equip
Scene_Status
Scene_File
Scene_Save
Scene_Load
Scene_End
Scene_Battle 1
Scene_Battle 2
Scene_Battle 3
Scene_Battle 4
Scene_Shop
Scene_Name
Scene_Gameover
Scene_Debug
Main


Window_NameEdit ::: posté le 2006-02-16 @ 09:57:00
Auteur: Yukihiro matsumoto

#============================================
# ¡ Window_NameEdit
#----------------------------------------------
# @–¼‘O“ü—͉æ–Ê‚ÅA–¼‘O‚ð•ÒW‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#============================================

class Window_NameEdit < Window_Base
#------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#------------------------------------------
attr_reader :name # –¼‘O
attr_reader :index # ƒJ[ƒƒ‹ˆÊ’u
#------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
# max_char : ő啶Žš”
#------------------------------------------
def initialize(actor, max_char)
super(0, 0, 640, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@actor = actor
@name = actor.name
@max_char = max_char
# –¼‘O‚ðő啶Žš”ˆÈ“à‚ÉŽû‚ß‚é
name_array = @name.split(//)[0...@max_char]
@name = ""
for i in 0...name_array.size
@name += name_array[i]
end
@default_name = @name
@index = name_array.size
refresh
update_cursor_rect
end
#------------------------------------------
# œ ƒfƒtƒHƒ‹ƒg‚Ì–¼‘O‚É–ß‚·
#------------------------------------------
def restore_default
@name = @default_name
@index = @name.split(//).size
refresh
update_cursor_rect
end
#------------------------------------------
# œ •¶Žš‚̒ljÁ
# character : ’ljÁ‚·‚镶Žš
#------------------------------------------
def add(character)
if @index < @max_char and character != ""
@name += character
@index += 1
refresh
update_cursor_rect
end
end
#------------------------------------------
# œ •¶Žš‚Ìíœ
#------------------------------------------
def back
if @index > 0
# ˆêŽšíœ
name_array = @name.split(//)
@name = ""
for i in 0...name_array.size-1
@name += name_array[i]
end
@index -= 1
refresh
update_cursor_rect
end
end
#------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#------------------------------------------
def refresh
self.contents.clear
# –¼‘O‚ð•`‰æ
name_array = @name.split(//)
for i in 0...@max_char
c = name_array[i]
if c == nil
c = "Q"
end
x = 320 - @max_char * 14 + i * 28
self.contents.draw_text(x, 32, 28, 32, c, 1)
end
# ƒOƒ‰ƒtƒBƒbƒN‚ð•`‰æ
draw_actor_graphic(@actor, 320 - @max_char * 14 - 40, 80)
end
#------------------------------------------
# œ ƒJ[ƒƒ‹‚Ì‹éŒ`XV
#------------------------------------------
def update_cursor_rect
x = 320 - @max_char * 14 + @index * 28
self.cursor_rect.set(x, 32, 28, 32)
end
#------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#------------------------------------------
def update
super
update_cursor_rect
end
end
Design By RaZ © Watery Build 2005