Class: GGLib::ImageThemeInstance
- Inherits:
-
ThemeInstance
- Object
- ThemeInstance
- GGLib::ImageThemeInstance
- Defined in:
- lib/theme.rb
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(klass, wid) ⇒ ImageThemeInstance
constructor
A new instance of ImageThemeInstance.
- #setCoords(x1, y1, x2, y2) ⇒ Object
- #setDefaultState ⇒ Object
- #setDownState ⇒ Object
- #setOverState ⇒ Object
- #setSleepState ⇒ Object
- #setWakeState ⇒ Object
Methods inherited from ThemeInstance
#draw, #font, #height, #name, #width
Constructor Details
#initialize(klass, wid) ⇒ ImageThemeInstance
Returns a new instance of ImageThemeInstance.
103 104 105 106 |
# File 'lib/theme.rb', line 103 def initialize(klass, wid) super(klass, wid) @image = $window.newTexture(@x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.default) end |
Instance Method Details
#image ⇒ Object
139 140 141 |
# File 'lib/theme.rb', line 139 def image return @klass.image end |
#setCoords(x1, y1, x2, y2) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/theme.rb', line 107 def setCoords(x1,y1,x2,y2) super(x1,y1,x2,y2) return if @image == -1 if @state == 1 $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.default) elsif @state == 2 $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.over) elsif @state == 3 $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.down) end end |
#setDefaultState ⇒ Object
118 119 120 121 |
# File 'lib/theme.rb', line 118 def setDefaultState super $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.default) end |
#setDownState ⇒ Object
126 127 128 129 |
# File 'lib/theme.rb', line 126 def setDownState super $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.down) end |
#setOverState ⇒ Object
122 123 124 125 |
# File 'lib/theme.rb', line 122 def setOverState super $window.setTexture(@image, @x1, @y1, @x2, @y2, ZOrder::Widget, @klass.image.over) end |
#setSleepState ⇒ Object
130 131 132 133 134 |
# File 'lib/theme.rb', line 130 def setSleepState super @image = -1 $window.deleteImage(@image) end |