Class: GGLib::Themes::ShadeCheckGenTheme

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

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

#initializeShadeCheckGenTheme

Returns a new instance of ShadeCheckGenTheme.



245
246
247
248
249
250
251
252
253
254
# File 'lib/ext/themes.rb', line 245

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),
              0xffe6e6e6,
              0xff848484
            )
  super("Shade.Checkable.Unchecked", font)
end

Instance Method Details

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



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/ext/themes.rb', line 255

def draw(x1,y1, x2, y2, state)
  if state == 1
    $window.draw_quad(x1, y1, 0xff2e2e2e, x2, y1, 0xff2e2e2e, x1, y2, 0xff2e2e2e, x2, y2, 0xff2e2e2e, ZOrder::Widget) 
    $window.draw_quad(x1+2, y1+2, 0xffbdbdbd, x2-2, y1+2, 0xffbdbdbd, x1+2, y2-2, 0xffbdbdbd, x2-2, y2-2, 0xffbdbdbd, ZOrder::Widget) 
    $window.draw_quad(x1+3, y1+3, 0xff2e2e2e, x2-3, y1+3, 0xff2e2e2e, x1+3, y2-3, 0xff2e2e2e, x2-3, y2-3, 0xff2e2e2e, ZOrder::Widget) 
    $window.draw_quad(x1+4, y1+4, 0xfffeeeee, x2-4, y1+4, 0xffeeeeee, x1+4, y2-4, 0xffeeeeee, x2-4, y2-4, 0xffeeeeee, ZOrder::Widget)
    $window.draw_quad(x1+5, y1+5, 0xff2e2e2e, x2-5, y1+5, 0xff2e2e2e, x1+5, y2-5, 0xff2e2e2e, x2-5, y2-5, 0xff2e2e2e, ZOrder::Widget) 
  else
    $window.draw_quad(x1, y1, 0xff2e2e2e, x2, y1, 0xff2e2e2e, x1, y2, 0xff2e2e2e, x2, y2, 0xff2e2e2e, ZOrder::Widget) 
    $window.draw_quad(x1+2, y1+2, 0xffffffff, x2-2, y1+2, 0xffffffff, x1+2, y2-2, 0xffffffff, x2-2, y2-2, 0xffffffff, ZOrder::Widget) 
    $window.draw_quad(x1+3, y1+3, 0xff2e2e2e, x2-3, y1+3, 0xff2e2e2e, x1+3, y2-3, 0xff2e2e2e, x2-3, y2-3, 0xff2e2e2e, ZOrder::Widget) 
    $window.draw_quad(x1+4, y1+4, 0xffffffff, x2-4, y1+4, 0xffffffff, x1+4, y2-4, 0xffffffff, x2-4, y2-4, 0xffffffff, ZOrder::Widget)
    $window.draw_quad(x1+5, y1+5, 0xff2e2e2e, x2-5, y1+5, 0xff2e2e2e, x1+5, y2-5, 0xff2e2e2e, x2-5, y2-5, 0xff2e2e2e, ZOrder::Widget) 
  end
end