- Joined
- Aug 15, 2012
- Messages
- 1,093
- Reaction score
- 104
- First Language
- English
- Primarily Uses
- N/A
I just have a question about image spacing and format. I have this script WIP on my project:
that basically shows the battler of the character on the screen, however, when I change the max items to display, namely on how many characters I want to show on the window, this problem keeps on coming:
How can I format a proper spacing for the battlers and the stats displayed? I seem to have forgotten something important on this script, but can't figure it out.
module RGSS3C module VIIMenu Counter_Variable = 1 Command_Width = 120 Menu_Names = { 1 => "Items", 2 => "Equip", 3 => "Tech", 4 => "Skills", 5 => "Status", 6 => "Formation", 7 => "Save", 8 => "End" } MenuStatus_Height = Graphics.height - 47 MenuStatus_Y = 0 MenuStatus_ItemMax = 1 end #-------------------------------------------------------------------------- # * CMS Actors Configuration (For Portrait) #-------------------------------------------------------------------------- module CMS_Actor Actor_Portrait = { 1 => "Eric", 2 => "Natalie", 3 => "Terence", 4 => "Ernest", 5 => "Ryoma", 6 => "Brenda", 7 => "Rick", 8 => "Alice", 9 => "Isabelle", 10 => "Noah" } end #-------------------------------------------------------------------------- # Help Indicator Vocabularies #-------------------------------------------------------------------------- module Help_Vocabs Menu = [ "The present items in your inventory.", "Change your equipments.", "Use Your Techniques", "Your skills present to use.", "View your current status", "Change your party formation", "Save your current progress.", "Quit or restart game." ] end endclass Window_HeaderI < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, Graphics.width, 48) refresh end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear draw_text(4, 0, Graphics.width, line_height, RGSS3C::Help_Vocabs::Menu[$game_variables[RGSS3C::VIIMenu::Counter_Variable]]) end #-------------------------------------------------------------------------- # * Open Window #-------------------------------------------------------------------------- def open refresh super endendclass Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 47) select_last puts $game_variables[RGSS3C::VIIMenu::Counter_Variable] = 1 end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_height return 210 end #-------------------------------------------------------------------------- # * Move Cursor Down #-------------------------------------------------------------------------- def cursor_down(wrap = false) if index < item_max - col_max || (wrap && col_max == 1) select((index + col_max) % item_max) if $game_variables[RGSS3C::VIIMenu::Counter_Variable] <= 7 if $game_variables[RGSS3C::VIIMenu::Counter_Variable] != 7 if $game_variables[RGSS3C::VIIMenu::Counter_Variable] > 7 $game_variables[RGSS3C::VIIMenu::Counter_Variable] = 1 else $game_variables[RGSS3C::VIIMenu::Counter_Variable] += 1 end else $game_variables[RGSS3C::VIIMenu::Counter_Variable] = 1 end else $game_variables[RGSS3C::VIIMenu::Counter_Variable] = 1 end end end #-------------------------------------------------------------------------- # * Move Cursor Up #-------------------------------------------------------------------------- def cursor_up(wrap = false) if index >= col_max || (wrap && col_max == 1) select((index - col_max + item_max) % item_max) if $game_variables[RGSS3C::VIIMenu::Counter_Variable] > 1 $game_variables[RGSS3C::VIIMenu::Counter_Variable] -= 1 else $game_variables[RGSS3C::VIIMenu::Counter_Variable] = 7 end end end def update_help @help_window.set_rgss3spvii_help(@index) end endclass Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_command_window create_status_window endendclass Window_Base def draw_actor_simple_status(actor, x, y) draw_actor_name(actor, x - 37, y - 17) draw_actor_icons(actor, x, y + line_height * 2) draw_actor_hp(actor, x - 90, y + line_height * 1 + 185) draw_actor_mp(actor, x - 90, y + line_height * 2 + 185) endendclass Window #-------------------------------------------------------------------------- # * Set Mirai Help #-------------------------------------------------------------------------- def set_rgss3spvii_help(index) return if @index == index # To prevent excessive redrawing @index = index $game_variables[RGSS3C::VIIMenu::Counter_Variable] = index refresh endendclass Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Get Window Width (Completely Modified) #-------------------------------------------------------------------------- def window_width #this returns the change of width to the Menu Command's Width return RGSS3C::VIIMenu::Command_Width end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height return RGSS3C::VIIMenu::MenuStatus_Height end #-------------------------------------------------------------------------- # * Add Main Commands to List (Completely Modified) #-------------------------------------------------------------------------- def add_main_commands add_command(RGSS3C::VIIMenu::Menu_Names.values[0], :item, main_commands_enabled) add_command(RGSS3C::VIIMenu::Menu_Names.values[1], :equip, main_commands_enabled) add_command(RGSS3C::VIIMenu::Menu_Names.values[2], :tech, main_commands_enabled) add_command(RGSS3C::VIIMenu::Menu_Names.values[3], :skill, main_commands_enabled) add_command(RGSS3C::VIIMenu::Menu_Names.values[4], :status, main_commands_enabled) end endclass Scene_Menu < Scene_MenuBase alias :soulpour_scene_menu_start_processing_rgss3spvii :start #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start soulpour_scene_menu_start_processing_rgss3spvii @header_one = Window_HeaderI.new @command_window.help_window = @header_one @header_one.x = 0 @header_one.y = Graphics.height - @header_one.height end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.y = 0 @command_window.set_handler
item, method
command_item)) @command_window.set_handler
equip, method
command_personal)) @command_window.set_handler
tech, method
command_tech)) @command_window.set_handler
skills, method
command_personal)) @command_window.set_handler
status, method
command_personal)) @command_window.set_handler
formation, method
command_formation)) @command_window.set_handler
save, method
command_save)) @command_window.set_handler
game_end, method
command_game_end)) @command_window.set_handler
cancel, method
return_scene)) end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def command_tech end endclass Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height RGSS3C::VIIMenu::MenuStatus_Height endend#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------# This class handles actors. It is used within the Game_Actors class# ($game_actors) and is also referenced from the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables (To Show Portrait) #-------------------------------------------------------------------------- attr_reader :actor_idendclass Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y) super(x, 47, window_width, window_height) @pending_index = -1 refresh self.y = RGSS3C::VIIMenu::MenuStatus_Y end #-------------------------------------------------------------------------- # * Get Number of Items # Changed to 1 to only show 1 party member. #-------------------------------------------------------------------------- def item_max return RGSS3C::VIIMenu::MenuStatus_ItemMax end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height Graphics.height - 47 end def window_width return Graphics.width end def col_max return 3 end #-------------------------------------------------------------------------- # * Draw Item #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) draw_actor_portrait(actor, x - 160, 10, enabled = true) draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2) end #-------------------------------------------------------------------------- # * Draw Actor Portrait #-------------------------------------------------------------------------- def draw_actor_portrait(actor, x, y, enabled = true) bitmap = Cache.picture(RGSS3C::CMS_Actor::Actor_Portrait[actor.actor_id]) rect = Rect.new(0,0, 500, Graphics.height) contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end end

