Dunque,stavo creando un menù da zero,in pratica i classici comandi a destra di status etc + il face e lo stato dell'eroe...Però la window command si muove ma se aziono,per esempio status,rimane immobile... Poi se ho due eroi e cerco di scorrere con Q mi dà un errore al dispose...Per farvi un esempio del menù:
Face eroe e stato window command
gold tempo di gioco
W/Q dovrebbero cambiare l'eroe visualizzato...Ecco lo script fatto da me...Se capite il problema :smile:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Window_MenuStatus < Window_Selectable
def initialize(actor)
super(0, 0, 405, 96+32)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 255
@actor = actor
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = 1
x = -0
y = 0
actor = @actor
self.contents.font.size = 18
draw_actor_name(actor, x + 100, y)
draw_actor_face(actor, x , y + 90)
draw_actor_class(actor, x + 180, y + 30)
draw_actor_hp(actor, x + 180, y)
draw_actor_sp(actor, x + 180, y + 15)
draw_actor_state(actor, x + 100, y + 18)
draw_actor_level(actor, x + 100, y + 36)
draw_actor_exp(actor, x + 100, y + 54)
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 96, self.width - 32, 96)
end
end
end
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
@actor_index = 0
@target = ""
scene_window
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
scene_dispose
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def scene_window
@actor = $game_party.actors[@actor_index]
# Make command window
@spriteset = Spriteset_Map.new
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.x = 490
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(4)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 490
@playtime_window.y = 316
# Make steps window
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 490
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new(@actor)
@status_window.x = 3
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@spriteset.dispose
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
if $game_party.actors.size > 1
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
scene_dispose
scene_window
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
scene_dispose
scene_window
return
end
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 5 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
end
Question
Squall_Leonheart
Dunque,stavo creando un menù da zero,in pratica i classici comandi a destra di status etc + il face e lo stato dell'eroe...Però la window command si muove ma se aziono,per esempio status,rimane immobile...
Edited by ApoPoi se ho due eroi e cerco di scorrere con Q mi dà un errore al dispose...Per farvi un esempio del menù:
Face eroe e stato window command
gold tempo di gioco
W/Q dovrebbero cambiare l'eroe visualizzato...Ecco lo script fatto da me...Se capite il problema :smile:
Aggiornato tag script
Iscriviti sul mio canale youtube -
https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber
Seguimi su Instagram -
https://www.instagram.com/ancestralguitarist/
---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------
FACE CONTEST # 3
BANNER CONTEST #69
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now