summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/renderable.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ruby2d/renderable.rb b/lib/ruby2d/renderable.rb
index 18c7a78..0e5da50 100644
--- a/lib/ruby2d/renderable.rb
+++ b/lib/ruby2d/renderable.rb
@@ -5,18 +5,21 @@ module Ruby2D
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)