- 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
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).
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.
I have my main menu pretty much up and running (see spoiler 1).
Menu Pic
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[
utline]
@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
# ■ 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[
@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
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:

