diff options
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/color.rb | 2 | ||||
| -rw-r--r-- | mrblib/raylib.rb | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/mrblib/color.rb b/mrblib/color.rb index b4fa9c3..2625f34 100644 --- a/mrblib/color.rb +++ b/mrblib/color.rb @@ -60,7 +60,7 @@ module Raylib end end - # Hash of all web colors + # Hash of all web colors, RayWhite, and Clear ColorList = { :clear=>{:r=>0, :g=>0, :b=>0, :a=>0}, :ray_white=>{:r=>245, :g=>245, :b=>245}, 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 |
