summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoroeloeloel <[email protected]>2020-08-06 10:04:59 -0400
committerAmir Rajan <[email protected]>2020-09-02 13:30:34 -0500
commitae28b5f4ef18f574b3bc34f921dbfab7b337b234 (patch)
tree10ef7e5d01ef7be5af345cfc913e3e62f9f66a8c
parent92fae00c7d284ac17d28bc0e54e73a1534c613a0 (diff)
downloaddragonruby-game-toolkit-contrib-ae28b5f4ef18f574b3bc34f921dbfab7b337b234.tar.gz
dragonruby-game-toolkit-contrib-ae28b5f4ef18f574b3bc34f921dbfab7b337b234.zip
Update numeric.rb
Added from_top method
-rw-r--r--dragon/numeric.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/dragon/numeric.rb b/dragon/numeric.rb
index 6d8b84d..5485ff8 100644
--- a/dragon/numeric.rb
+++ b/dragon/numeric.rb
@@ -9,6 +9,11 @@ class Numeric
alias_method :gte, :>=
alias_method :lte, :<=
+
+ # Converts numeric value to distance from top of stage
+ def from_top
+ $gtk.args.grid.h - self
+ end
# Converts a numeric value representing seconds into frames.
#