From 187cab9f77a6274ba4e5bb9c012fca5549c020fb Mon Sep 17 00:00:00 2001 From: realtradam Date: Mon, 7 Feb 2022 05:11:26 -0500 Subject: reworked some more functions --- mrblib/color.rb | 2 +- mrblib/raylib.rb | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'mrblib') 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 -- cgit v1.2.3