summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/ruby2d/sprite.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ruby2d/sprite.rb b/lib/ruby2d/sprite.rb
index 5e88975..e6a6efa 100644
--- a/lib/ruby2d/sprite.rb
+++ b/lib/ruby2d/sprite.rb
@@ -63,6 +63,14 @@ module Ruby2D
end
end
+ def width
+ @current_animation ? @animations[@current_animation][@current_frame][2] : @default[2]
+ end
+
+ def height
+ @current_animation ? @animations[@current_animation][@current_frame][3] : @default[3]
+ end
+
private
def clip(x, y, w, h)