summaryrefslogtreecommitdiffhomepage
path: root/lib/ruby2d/camera/image.rb
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-08-08 01:52:47 -0400
committerrealtradam <[email protected]>2021-08-08 01:52:47 -0400
commite9a05cecd41b244977c794931b4706015097774f (patch)
tree21c506d87226dd794635ab944317892eccc42fcb /lib/ruby2d/camera/image.rb
parent4a759ba2710de0b7335e6cfcd6db8bc16795c13b (diff)
downloadruby2d-camera-e9a05cecd41b244977c794931b4706015097774f.tar.gz
ruby2d-camera-e9a05cecd41b244977c794931b4706015097774f.zip
working copy
Diffstat (limited to 'lib/ruby2d/camera/image.rb')
-rw-r--r--lib/ruby2d/camera/image.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/ruby2d/camera/image.rb b/lib/ruby2d/camera/image.rb
index 19f9084..fe777b3 100644
--- a/lib/ruby2d/camera/image.rb
+++ b/lib/ruby2d/camera/image.rb
@@ -7,6 +7,7 @@ module Camera
# Recalculates real coordiantes
# Use after changing variables
def _draw
+ return if @hide
temp_angle = Camera.angle * (Math::PI / 180)
half_width = Window.width * 0.5
half_height = Window.height * 0.5
@@ -26,10 +27,17 @@ module Camera
color: [self.color.r, self.color.g, self.color.b, self.color.a])
end
- def initialize(opts= {})
- super(opts)
+ def initialize(path, opts= {})
+ super(path, opts)
Ruby2D::Camera << self
- self.remove
+ Window.remove(self)
end
+ def remove
+ @hide = true
+ end
+
+ def add
+ @hide = false
+ end
end
end