09-05-2018, 05:17 AM
(This post was last modified: 09-05-2018, 06:24 AM by DerVVulfman.)
I always seem to flip scripts around a bit and break them into modules of their own. Hell, I took the filenames and put them into a separate LilyFrog config module:
I hate those icon menus. They give ME headaches. Unless you have something that overwrites the default hidden Window class, remember that you should have a 16px border around everything. So if you have a window with 4qty 32x32 icons, it isn't the space of 32x4 (or 128), but with 16px on either side too... (128+32 ... aka 160) That eliminates the scrolling arrow appearing on the right.
EDIT: There was a flub in the initial posting of the script.
Code:
module LilyMenu
# HERO'S VARIABLE OF CHOICE
# =========================
#
HEROVARIABLE = 1
# MENU BACKGROUND
# ===============
#
MENUBACK = [ 'backtest1', 'backtest2' ]
# HERO'S EMOTIONAL REACTION
# =========================
#
HEROFACE = [ 'hanneutral', 'hanworry', 'penneutral', 'penhappy',
'penworry', 'penpsych', 'penaffect' ]
# HERO'S NAME
# ===========
#
HERONAME = [ 'testname1', 'testname2' ]
end
#==============================================================================
# ** Menu_Graphics
#------------------------------------------------------------------------------
# This window displays the main window for LilyFrog's game using graphics
# based on standard RMXP game variables
#==============================================================================
class Menu_Graphics < Window_Base
#----------------------------------------------------------------------
# * Object Initialization
#----------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
# Acquire value of game variable
gamevar = $game_variables[LilyMenu::HEROVARIABLE]
# Now draw them
initialize_background(gamevar)
initialize_character_graphic(gamevar)
initialize_character_name(gamevar)
end
#-----------------------------------------------------------------------
# * Draw Background
# gamevar : game variable data
#-----------------------------------------------------------------------
def initialize_background(gamevar)
# Create the Background Sprite and set position
@menuback = Sprite.new
@menuback.x = 0
@menuback.y = 0
# Determine Background based on game variable state
temp_image = (gamevar < 5 ) ? LilyMenu::MENUBACK[0] : LilyMenu::MENUBACK[1]
# Load Background Bitmap
@menuback.bitmap = RPG::Cache.picture(temp_image)
end
#-----------------------------------------------------------------------
# * Draw Character Graphic
# gamevar : game variable data
#-----------------------------------------------------------------------
def initialize_character_graphic(gamevar)
# Create the character graphic and set position
@charactergraphic = Sprite.new
@charactergraphic.x = 375
@charactergraphic.y = 50
# Acquire image from array by game variable data
temp_image = LilyMenu::HEROFACE[gamevar]
# Draw image
@charactergraphic.bitmap = RPG::Cache.picture(temp_image)
end
#-----------------------------------------------------------------------
# * Character Names And Changes
# gamevar : game variable data
#-----------------------------------------------------------------------
def initialize_character_name(gamevar)
# Create the character name display and set position
@charactername = Sprite.new
@charactername.x = 310
@charactername.y = 15
# Acquire image from array by game variable data
temp_image = (gamevar <= 2 ) ? LilyMenu::HERONAME[0] : LilyMenu::HERONAME[1]
# Draw image
@charactername.bitmap = RPG::Cache.picture(temp_image)
end
end
I hate those icon menus. They give ME headaches. Unless you have something that overwrites the default hidden Window class, remember that you should have a 16px border around everything. So if you have a window with 4qty 32x32 icons, it isn't the space of 32x4 (or 128), but with 16px on either side too... (128+32 ... aka 160) That eliminates the scrolling arrow appearing on the right.
EDIT: There was a flub in the initial posting of the script.