Class: Ruby2D::Image
- Inherits:
-
Object
- Object
- Ruby2D::Image
- Defined in:
- lib/ruby2d/image.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, path) ⇒ Image
constructor
A new instance of Image.
- #remove ⇒ Object
Constructor Details
#initialize(x, y, path) ⇒ Image
Returns a new instance of Image.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ruby2d/image.rb', line 8 def initialize(x, y, path) unless File.exists? path raise Error, "Cannot find image file `#{path}`" end @type_id = 3 @x, @y, @path = x, y, path if defined? Ruby2D::DSL Ruby2D::Application.add(self) end end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/ruby2d/image.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
6 7 8 |
# File 'lib/ruby2d/image.rb', line 6 def y @y end |
Instance Method Details
#remove ⇒ Object
22 23 24 25 26 |
# File 'lib/ruby2d/image.rb', line 22 def remove if defined? Ruby2D::DSL Ruby2D::Application.remove(self) end end |