Class: GGLib::Themes::RubygooTextTheme

Inherits:
DrawnTheme show all
Defined in:
lib/ext/themes.rb

Constant Summary collapse

@@textbox =
nil

Instance Attribute Summary

Attributes inherited from DrawnTheme

#font

Attributes inherited from GGLib::Theme

#name

Instance Method Summary collapse

Methods inherited from DrawnTheme

#height, #newInstance, #width

Methods inherited from GGLib::Theme

#height, #request, #setDefaultState, #setDownState, #setOverState, #width

Constructor Details

#initializeRubygooTextTheme

Returns a new instance of RubygooTextTheme.



148
149
150
151
152
153
154
155
156
157
# File 'lib/ext/themes.rb', line 148

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, 
              0xffb22222
            )
  super("Rubygoo.TextBox", font)
end

Instance Method Details

#draw(x1, y1, x2, y2, state) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/ext/themes.rb', line 158

def draw(x1,y1, x2, y2, state)
  if state == 1
    $window.draw_quad(x1, y1, 0xff6e6e6e, x2, y1, 0xff6e6e6e, x1, y2, 0xff6e6e6e, x2, y2, 0xff6e6e6e, ZOrder::Widget) 
    $window.draw_quad(x1+2, y1+2, 0xff000000, x2-2, y1+2, 0xff000000, x1+2, y2-2, 0xff000000, x2-2, y2-2, 0xff000000, ZOrder::Widget) 
    $window.draw_quad(x1+3, y1+3, 0xff6e6e6e, x2-3, y1+3, 0xff6e6e6e, x1+3, y2-3, 0xff6e6e6e, x2-3, y2-3, 0xff6e6e6e, ZOrder::Widget) 
  else
    $window.draw_quad(x1, y1, 0xff808080, x2, y1, 0xff808080, x1, y2, 0xff808080, x2, y2, 0xff808080, ZOrder::Widget) 
    $window.draw_quad(x1+2, y1+2, 0xff000000, x2-2, y1+2, 0xff000000, x1+2, y2-2, 0xff000000, x2-2, y2-2, 0xff000000, ZOrder::Widget) 
    $window.draw_quad(x1+3, y1+3, 0xff808080, x2-3, y1+3, 0xff808080, x1+3, y2-3, 0xff808080, x2-3, y2-3, 0xff808080, ZOrder::Widget) 
  end
end