summaryrefslogtreecommitdiffhomepage
path: root/lib/ruby2d/camera/square.rb
diff options
context:
space:
mode:
authortradam <git.tradam.fyi>2021-09-24 18:34:08 -0400
committertradam <git.tradam.fyi>2021-09-24 18:34:08 -0400
commit205282994bba06b3ec6507ac0f42f66b13878db2 (patch)
treecd3a7bf117ac88a4ca546bb06da7ae6de94274ad /lib/ruby2d/camera/square.rb
parentf660af1767ec6243e92f1a41c2d9636e2b88790d (diff)
downloadruby2d-camera-205282994bba06b3ec6507ac0f42f66b13878db2.tar.gz
ruby2d-camera-205282994bba06b3ec6507ac0f42f66b13878db2.zip
Fixed changing z-index after the shape has been added not applying at all
Diffstat (limited to 'lib/ruby2d/camera/square.rb')
-rw-r--r--lib/ruby2d/camera/square.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ruby2d/camera/square.rb b/lib/ruby2d/camera/square.rb
index 75e1e83..b6f0321 100644
--- a/lib/ruby2d/camera/square.rb
+++ b/lib/ruby2d/camera/square.rb
@@ -57,15 +57,20 @@ module Ruby2D
end
# Methods for moving the shape
+ attr_writer :x, :y
+
def x
@x ||= 0
end
- attr_writer :x, :y
-
def y
@y ||= 0
end
+
+ def z=(z)
+ super(z)
+ Ruby2D::Camera._sort_by_z
+ end
end
end
end