Class: AuthorEngine::SpriteEditor::Pixel

Inherits:
Object
  • Object
show all
Defined in:
lib/author_engine/views/sprite_editor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#colorObject

Returns the value of attribute color.



5
6
7
# File 'lib/author_engine/views/sprite_editor.rb', line 5

def color
  @color
end

#heightObject

Returns the value of attribute height.



5
6
7
# File 'lib/author_engine/views/sprite_editor.rb', line 5

def height
  @height
end

#widthObject

Returns the value of attribute width.



5
6
7
# File 'lib/author_engine/views/sprite_editor.rb', line 5

def width
  @width
end

#xObject

Returns the value of attribute x.



5
6
7
# File 'lib/author_engine/views/sprite_editor.rb', line 5

def x
  @x
end

#yObject

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

#drawObject



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