Sha256: b19f0178d18728d662be4fe58c34adbd50b0f0753b835035d6745ff2d127943e
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
# Ruby2D::Renderable module Ruby2D module Renderable attr_reader :z # Set the z position (depth) of the object def z=(z) remove @z = z add end # Add the object to the window def add if Module.const_defined? :DSL Window.add(self) end end # Remove the object from the window def remove if Module.const_defined? :DSL Window.remove(self) end end # Allow shortcuts for setting color values def r; self.color.r end def g; self.color.g end def b; self.color.b end def a; self.color.a end def r=(c); self.color.r = c end def g=(c); self.color.g = c end def b=(c); self.color.b = c end def a=(c); self.color.a = c end def opacity; self.color.opacity end def opacity=(val); self.color.opacity = val end # Allow British English spelling of color def colour; self.color end def colour=(c); self.color = c end # Add a contains method stub def contains?(x, y) raise Error, "\`#contains?\` not implemented for this class yet" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ruby2d-0.7.0 | lib/ruby2d/renderable.rb |
ruby2d-0.6.1 | lib/ruby2d/renderable.rb |
ruby2d-0.6.0 | lib/ruby2d/renderable.rb |