diff options
Diffstat (limited to 'mrblib/raylib.rb')
| -rw-r--r-- | mrblib/raylib.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mrblib/raylib.rb b/mrblib/raylib.rb index 5ad3e37..e53a15b 100644 --- a/mrblib/raylib.rb +++ b/mrblib/raylib.rb @@ -89,8 +89,19 @@ module Raylib self.data_keys_pressed end - def scissor_mode(x: x, y: y, width: width, height: height, &block) - self.begin_scissor_mode(x, y, width, height) + # 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, y, width, height) + end yield self.end_scissor_mode end |
