Alignment for Level text in Main Menu

beenbaba

Slowly getting there
Veteran
Joined
Apr 28, 2015
Messages
289
Reaction score
159
First Language
English
Hi,
 
I have my main menu pretty much up and running (see spoiler 1). 

Menu Pic

Menu.png
The only thing that's bugging me is aligning the level to the center of the rect and not the left, there isn't an option for it on the Config so I went digging and found this line of code commented out in Menu Luna, (line 791, highlighted bold and underlined in spoiler).

#==============================================================================
# ■ SpriteMenu_Level
#==============================================================================
 
class SpriteMenu_Level < Sprite
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(viewport, spriteset, setting)
    super(viewport)
    @spriteset = spriteset
    @battler = spriteset.battler
    @level = 0
    @setting = setting
  end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    return unless setting[:enable]
    #---
    super
    refresh if level_change?
    #---
    self.x = screen_x; self.y = screen_y; self.z = screen_z
    self.opacity = real_opacity
    self.visible = @spriteset.visible
  end
    
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    return unless setting[:enable]
    color = setting[:color]
    out = setting[:outline]
    @level = @battler.level
    #---
    text = setting[:vocab]
    text = sprintf(text, @level)
    bitmap = Bitmap.new(setting[:width], setting[:height])
    bitmap.font.name = setting[:font]
    bitmap.font.size = setting[:size]
    bitmap.font.bold = setting[:bold]
    bitmap.font.italic = setting[:italic]
    if color.is_a?(String)
      bitmap.font.color = eval(color)
    else
      bitmap.font.color = Color.new(color[0], color[1], color[2], color[3])
    end
    if out.is_a?(String)
      bitmap.font.out_color = eval(out)
    else
      bitmap.font.out_color = Color.new(out[0], out[1], out[2], out[3])
    end
    #bitmap.draw_text(0, 0, bitmap.width, bitmap.height, text, setting[:align])
    #---
    self.bitmap.dispose if self.bitmap
    self.bitmap = bitmap
    draw_text_ex(0, 0, text)
  end
My question is, is this functionality available as it's written here and I can just comment it back in, add the :align command into the config and get rid of the draw_text_ex line or has it been commented it out because of a bug or something?

Thanks

EDIT: For anyone who comes across this that might want to know, enabling this section of the script and commenting the other did work and doesn't seem to have any bugs.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top