Module: Ruby2D::Renderable
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
- #a ⇒ Object
- #a=(c) ⇒ Object
-
#add ⇒ Object
Add the object to the window.
- #b ⇒ Object
- #b=(c) ⇒ Object
-
#colour ⇒ Object
Allow British English spelling of color.
- #colour=(c) ⇒ Object
-
#contains?(x, y) ⇒ Boolean
Add a contains method stub.
- #g ⇒ Object
- #g=(c) ⇒ Object
- #opacity ⇒ Object
- #opacity=(val) ⇒ Object
-
#r ⇒ Object
Allow shortcuts for setting color values.
- #r=(c) ⇒ Object
-
#remove ⇒ Object
Remove the object from the window.
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def color @color end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def width @width end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
6 7 8 |
# File 'lib/ruby2d/renderable.rb', line 6 def z @z end |
Instance Method Details
#a ⇒ Object
42 |
# File 'lib/ruby2d/renderable.rb', line 42 def a; self.color.a end |
#a=(c) ⇒ Object
46 |
# File 'lib/ruby2d/renderable.rb', line 46 def a=(c); self.color.a = c end |
#add ⇒ Object
Add the object to the window
16 17 18 19 20 |
# File 'lib/ruby2d/renderable.rb', line 16 def add if Module.const_defined? :DSL Window.add(self) end end |
#b ⇒ Object
41 |
# File 'lib/ruby2d/renderable.rb', line 41 def b; self.color.b end |
#b=(c) ⇒ Object
45 |
# File 'lib/ruby2d/renderable.rb', line 45 def b=(c); self.color.b = c end |
#colour ⇒ Object
Allow British English spelling of color
35 |
# File 'lib/ruby2d/renderable.rb', line 35 def colour; self.color end |
#colour=(c) ⇒ Object
36 |
# File 'lib/ruby2d/renderable.rb', line 36 def colour=(c); self.color = c end |
#contains?(x, y) ⇒ Boolean
Add a contains method stub
51 52 53 |
# File 'lib/ruby2d/renderable.rb', line 51 def contains?(x, y) x >= @x && x <= (@x + @width) && y >= @y && y <= (@y + @height) end |
#g ⇒ Object
40 |
# File 'lib/ruby2d/renderable.rb', line 40 def g; self.color.g end |
#g=(c) ⇒ Object
44 |
# File 'lib/ruby2d/renderable.rb', line 44 def g=(c); self.color.g = c end |
#opacity ⇒ Object
47 |
# File 'lib/ruby2d/renderable.rb', line 47 def opacity; self.color.opacity end |
#opacity=(val) ⇒ Object
48 |
# File 'lib/ruby2d/renderable.rb', line 48 def opacity=(val); self.color.opacity = val end |
#r ⇒ Object
Allow shortcuts for setting color values
39 |
# File 'lib/ruby2d/renderable.rb', line 39 def r; self.color.r end |
#r=(c) ⇒ Object
43 |
# File 'lib/ruby2d/renderable.rb', line 43 def r=(c); self.color.r = c end |