summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorarngo <[email protected]>2022-01-23 02:09:42 -0500
committerarngo <[email protected]>2022-01-23 02:09:42 -0500
commit140faf8a4d0a86a848294da39ba7b504f073033f (patch)
tree15336e103a4a9eba51141ef41d77a7fdb688ac0a /mrblib
parent49037d3ce6a171a3b1128c2bac6edea22f80d282 (diff)
downloadmruby-raylib-140faf8a4d0a86a848294da39ba7b504f073033f.tar.gz
mruby-raylib-140faf8a4d0a86a848294da39ba7b504f073033f.zip
bindings for DrawRectangleRec, DrawRectangleLinesEx, GetCollideRec under Rectangle class
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/raylib.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/mrblib/raylib.rb b/mrblib/raylib.rb
index e3c99cb..1b0dfda 100644
--- a/mrblib/raylib.rb
+++ b/mrblib/raylib.rb
@@ -1,6 +1,16 @@
Rl = Raylib
module Raylib
+ class Rectangle
+ def draw(color: Rl::Color.new(255,255,255,255))
+ self._draw(color)
+ end
+
+ def draw_lines(line_thick: 1, color: Rl::Color.new(255,255,255,255))
+ self._draw_lines(line_thick, color)
+ end
+ end
+
class Circle
attr_accessor :vector
attr_accessor :radius
@@ -60,8 +70,8 @@ module Raylib
self._draw_texture_ex(texture, pos, rotation, scale, tint)
end
- def draw_texture_pro(texture:, source_rect:, dest_rect:, origin: Rl::Vector.new(0,0), rotation: 0, tint: Rl::Color.new(255,255,255,255))
- self._draw_texture_pro(texture, source_rect, dest_rect, origin, rotation, tint)
+ def draw_texture_pro(texture:, source_rec:, dest_rec:, origin: Rl::Vector.new(0,0), rotation: 0, tint: Rl::Color.new(255,255,255,255))
+ self._draw_texture_pro(texture, source_rec, dest_rec, origin, rotation, tint)
end
def keys_pressed