summaryrefslogtreecommitdiffhomepage
path: root/mrblib/core.rb
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-02-08 03:12:31 -0500
committerrealtradam <[email protected]>2022-02-08 03:12:31 -0500
commit864c710a510be8e318023e34565209f9a24a3ac7 (patch)
treef42c172c290df6ba587042f978747dc4f88ba352 /mrblib/core.rb
parent187cab9f77a6274ba4e5bb9c012fca5549c020fb (diff)
downloadmruby-raylib-864c710a510be8e318023e34565209f9a24a3ac7.tar.gz
mruby-raylib-864c710a510be8e318023e34565209f9a24a3ac7.zip
move stuff to types.h
Diffstat (limited to 'mrblib/core.rb')
-rw-r--r--mrblib/core.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/mrblib/core.rb b/mrblib/core.rb
index 5d27566..8f93772 100644
--- a/mrblib/core.rb
+++ b/mrblib/core.rb
@@ -1,6 +1,20 @@
module Raylib
- class Color
- class << self
+ class << self
+ # The code block version of {Raylib.begin_scissor_mode} and {Raylib.end_scissor_mode}
+ # @overload scissor_mode(x: 0, y: 0, width: 10, height: 10, &block)
+ # @param x [Integer]
+ # @param y [Integer]
+ # @param width [Integer]
+ # @param height [Integer]
+ # @param block [Proc] The code to be executed in the scissor mode
+ def scissor_mode(*args, x: 0, y: 0, width: 10, height: 10, &block)
+ if args.length == 4
+ self.begin_scissor_mode(args[0], args[1], args[2], args[3])
+ else
+ self.begin_scissor_mode(x: x, y: y, width: width, height: height)
+ end
+ yield
+ self.end_scissor_mode
end
end
end