Class: GGLib::Themes::RubygooTheme
- Inherits:
-
DrawnTheme
- Object
- GGLib::Theme
- DrawnTheme
- GGLib::Themes::RubygooTheme
- Defined in:
- lib/ext/themes.rb
Overview
–
RUBYGOO THEME #
++
Constant Summary collapse
- @@textbox =
nil
Instance Attribute Summary
Attributes inherited from DrawnTheme
Attributes inherited from GGLib::Theme
Instance Method Summary collapse
- #draw(x1, y1, x2, y2, state) ⇒ Object
-
#initialize ⇒ RubygooTheme
constructor
A new instance of RubygooTheme.
- #request(obj) ⇒ Object
Methods inherited from DrawnTheme
Methods inherited from GGLib::Theme
#height, #setDefaultState, #setDownState, #setOverState, #width
Constructor Details
#initialize ⇒ RubygooTheme
Returns a new instance of RubygooTheme.
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/ext/themes.rb', line 113 def initialize 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), 0xff000000, 0xff848484 ) super("Rubygoo.Generic", font) end |
Instance Method Details
#draw(x1, y1, x2, y2, state) ⇒ Object
135 136 137 138 139 140 141 142 143 |
# File 'lib/ext/themes.rb', line 135 def draw(x1,y1, x2, y2, state) if state == 1 $window.draw_quad(x1, y1, 0xffb22222, x2, y1, 0xffb22222, x1, y2, 0xffb22222, x2, y2, 0xffb22222, ZOrder::Widget) $window.draw_quad(x1+1, y1+1, 0xff6e6e6e, x2-1, y1+1, 0xff6e6e6e, x1+1, y2-1, 0xff6e6e6e, x2-1, y2-1, 0xff6e6e6e, ZOrder::Widget) else $window.draw_quad(x1, y1, 0xffb22222, x2, y1, 0xffb22222, x1, y2, 0xffb22222, x2, y2, 0xffb22222, ZOrder::Widget) $window.draw_quad(x1+1, y1+1, 0xff808080, x2-1, y1+1, 0xff808080, x1+1, y2-1, 0xff808080, x2-1, y2-1, 0xff808080, ZOrder::Widget) end end |
#request(obj) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/ext/themes.rb', line 123 def request(obj) if @@textbox == nil #Can't initialize atglobal scope because $window may not have been set @@textbox = RubygooTextTheme.new @@label = RubygooLabelTheme.new end if obj.kind_of?(TextBox) return @@textbox elsif obj.kind_of?(Label) return @@label end return self end |