Class: GGLib::Themes::BlueSteelTheme
- Inherits:
-
ImageTheme
- Object
- GGLib::Theme
- ImageTheme
- GGLib::Themes::BlueSteelTheme
- Defined in:
- lib/ext/themes.rb
Constant Summary collapse
nil
Instance Attribute Summary
Attributes inherited from ImageTheme
#font, #height, #image, #width
Attributes inherited from GGLib::Theme
Instance Method Summary collapse
-
#initialize ⇒ BlueSteelTheme
constructor
A new instance of BlueSteelTheme.
- #request(obj) ⇒ Object
Methods inherited from ImageTheme
Methods inherited from GGLib::Theme
#height, #setDefaultState, #setDownState, #setOverState, #width
Constructor Details
#initialize ⇒ BlueSteelTheme
Returns a new instance of BlueSteelTheme.
9 10 11 12 13 |
# File 'lib/ext/themes.rb', line 9 def initialize image = ThemeImageGroup.new( $gglroot+"/media/bluesteel/generic/menusmall.png", $gglroot+"/media/bluesteel/generic/menusmall.png", $gglroot+"/media/bluesteel/generic/menusmall.png" ) font = ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20)) super("BlueSteel.Generic", font, image) end |
Instance Method Details
#request(obj) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ext/themes.rb', line 14 def request(obj) if @@button == nil #Can't initialize atglobal scope because $window may not have been set @@button = ImageTheme.new("BlueSteel.Button", ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20)), ThemeImageGroup.new( $gglroot+"/media/bluesteel/button/button.png", $gglroot+"/media/bluesteel/button/buttonup.png" , $gglroot+"/media/bluesteel/button/buttonup.png" )) @@textbox = ImageTheme.new("BlueSteel.TextBox", ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20)), ThemeImageGroup.new( $gglroot+"/media/bluesteel/textbox/textbox.png", $gglroot+"/media/bluesteel/textbox/textboxactive.png" , $gglroot+"/media/bluesteel/textbox/textboxactive.png" )) @@label = ImageTheme.new("BlueSteel.Label", ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20)), ThemeImageGroup.new( $gglroot+"/null.png", $gglroot+"/null.png" , $gglroot+"/null.png" ) ) end if obj.kind_of?(Button) return @@button elsif obj.kind_of?(TextBox) return @@textbox elsif obj.kind_of?(Label) return @@label end return self end |