summaryrefslogtreecommitdiffhomepage
path: root/lib/ruby2d/camera/triangle.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ruby2d/camera/triangle.rb')
-rw-r--r--lib/ruby2d/camera/triangle.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/ruby2d/camera/triangle.rb b/lib/ruby2d/camera/triangle.rb
index 356222b..4065b62 100644
--- a/lib/ruby2d/camera/triangle.rb
+++ b/lib/ruby2d/camera/triangle.rb
@@ -6,6 +6,7 @@ module Ruby2D
# Recalculates real coordiantes
# Use after changing variables
def _draw
+ return if @hide
angle = Ruby2D::Camera.angle * (Math::PI / 180)
half_width = Window.width * 0.5
half_height = Window.height * 0.5
@@ -29,7 +30,15 @@ module Ruby2D
def initialize(opts= {})
super(opts)
Ruby2D::Camera << self
- self.remove
+ Window.remove(self)
+ self.add
+ end
+ def remove
+ @hide = true
+ end
+
+ def add
+ @hide = false
end
#Methods for moving the shape