Class: AuthorEngine::SpriteEditor::Pixel
- Inherits:
-
Object
- Object
- AuthorEngine::SpriteEditor::Pixel
- Defined in:
- lib/author_engine/views/sprite_editor.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(x, y, width, height, color) ⇒ Pixel
constructor
A new instance of Pixel.
Constructor Details
#initialize(x, y, width, height, color) ⇒ Pixel
Returns a new instance of Pixel.
6 7 8 |
# File 'lib/author_engine/views/sprite_editor.rb', line 6 def initialize(x, y, width, height, color) @x, @y, @width, @height, @color = x, y, width, height, color end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
5 6 7 |
# File 'lib/author_engine/views/sprite_editor.rb', line 5 def color @color end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/author_engine/views/sprite_editor.rb', line 5 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'lib/author_engine/views/sprite_editor.rb', line 5 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/author_engine/views/sprite_editor.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/author_engine/views/sprite_editor.rb', line 5 def y @y end |
Instance Method Details
#draw ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/author_engine/views/sprite_editor.rb', line 10 def draw Gosu.draw_rect( @x, @y, @width, @height, @color, 5 ) end |