Class: Image
- Inherits:
-
Object
- Object
- Image
- Defined in:
- lib/r2d/image.rb
Overview
image.rb
Instance Attribute Summary collapse
-
#f_x ⇒ Object
readonly
Returns the value of attribute f_x.
-
#f_y ⇒ Object
readonly
Returns the value of attribute f_y.
-
#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
- #adapter ⇒ Object
- #add ⇒ Object
-
#initialize(x, y, path, visible = true) ⇒ Image
constructor
A new instance of Image.
- #remove ⇒ Object
Constructor Details
#initialize(x, y, path, visible = true) ⇒ Image
Returns a new instance of Image.
8 9 10 11 12 13 14 15 |
# File 'lib/r2d/image.rb', line 8 def initialize(x, y, path, visible=true) @x, @y, @path = x, y, path @f_x, @f_y = 1, 1 @image = R2D::Adapters.image(path) @o_w, @o_h = @image.width, @image.height @width, @height = @o_w, @o_h if visible then add end end |
Instance Attribute Details
#f_x ⇒ Object (readonly)
Returns the value of attribute f_x.
6 7 8 |
# File 'lib/r2d/image.rb', line 6 def f_x @f_x end |
#f_y ⇒ Object (readonly)
Returns the value of attribute f_y.
6 7 8 |
# File 'lib/r2d/image.rb', line 6 def f_y @f_y end |
#height ⇒ Object
Returns the value of attribute height.
6 7 8 |
# File 'lib/r2d/image.rb', line 6 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
6 7 8 |
# File 'lib/r2d/image.rb', line 6 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/r2d/image.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/r2d/image.rb', line 5 def y @y end |
Instance Method Details
#adapter ⇒ Object
35 36 37 |
# File 'lib/r2d/image.rb', line 35 def adapter @image end |