summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2015-11-13 00:48:30 -0500
committerTom Black <[email protected]>2015-11-13 00:48:30 -0500
commit211d858a78c856b1a2682cfe9bd67703784d8265 (patch)
tree52938b715c69a5752000cc509b1f12d3370f3792
parent05c80440cb1c0da84a479bfb4e6dbf9b894f7198 (diff)
downloadruby2d-211d858a78c856b1a2682cfe9bd67703784d8265.tar.gz
ruby2d-211d858a78c856b1a2682cfe9bd67703784d8265.zip
Adding `remove` methods to visual objects
-rw-r--r--lib/ruby2d/image.rb6
-rw-r--r--lib/ruby2d/quad.rb6
-rw-r--r--lib/ruby2d/text.rb6
-rw-r--r--lib/ruby2d/triangle.rb6
4 files changed, 24 insertions, 0 deletions
diff --git a/lib/ruby2d/image.rb b/lib/ruby2d/image.rb
index 280d742..2ebb63b 100644
--- a/lib/ruby2d/image.rb
+++ b/lib/ruby2d/image.rb
@@ -19,5 +19,11 @@ module Ruby2D
end
end
+ def remove
+ if defined? Ruby2D::DSL
+ Ruby2D::Application.remove(self)
+ end
+ end
+
end
end
diff --git a/lib/ruby2d/quad.rb b/lib/ruby2d/quad.rb
index 910d046..2567185 100644
--- a/lib/ruby2d/quad.rb
+++ b/lib/ruby2d/quad.rb
@@ -30,6 +30,12 @@ module Ruby2D
update_color(c)
end
+ def remove
+ if defined? Ruby2D::DSL
+ Ruby2D::Application.remove(self)
+ end
+ end
+
private
def update_color(c)
diff --git a/lib/ruby2d/text.rb b/lib/ruby2d/text.rb
index bd4637f..b92f348 100644
--- a/lib/ruby2d/text.rb
+++ b/lib/ruby2d/text.rb
@@ -31,6 +31,12 @@ module Ruby2D
update_color(c)
end
+ def remove
+ if defined? Ruby2D::DSL
+ Ruby2D::Application.remove(self)
+ end
+ end
+
private
def resolve_path(font)
diff --git a/lib/ruby2d/triangle.rb b/lib/ruby2d/triangle.rb
index 8fdd72c..d8f14d2 100644
--- a/lib/ruby2d/triangle.rb
+++ b/lib/ruby2d/triangle.rb
@@ -26,6 +26,12 @@ module Ruby2D
@color = c
end
+ def remove
+ if defined? Ruby2D::DSL
+ Ruby2D::Application.remove(self)
+ end
+ end
+
private
def update_color(c)