From 42b452cabe2b7ae6651891616d4d13030c018492 Mon Sep 17 00:00:00 2001 From: realtradam Date: Tue, 8 Feb 2022 07:51:34 -0500 Subject: reworking some texture stuff --- mrblib/raylib.rb | 2 +- mrblib/texture.rb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 mrblib/texture.rb (limited to 'mrblib') diff --git a/mrblib/raylib.rb b/mrblib/raylib.rb index 0e60abf..41249be 100644 --- a/mrblib/raylib.rb +++ b/mrblib/raylib.rb @@ -64,7 +64,7 @@ module Raylib end def draw_texture(texture:, x:, y:, tint: Rl::Color.new(255,255,255,255)) - self._draw_texture(texture, x, y, tint) + texture.draw(x, y, tint) end def draw_texture_ex(texture:, pos:, rotation: 0, scale: 1, tint: Rl::Color.new(255,255,255,255)) diff --git a/mrblib/texture.rb b/mrblib/texture.rb new file mode 100644 index 0000000..4b5dea7 --- /dev/null +++ b/mrblib/texture.rb @@ -0,0 +1,23 @@ +module Raylib + class Texture + # @!visibility private + def h + self.height + end + + # @!visibility private + def h=(height) + self.height = height + end + + # @!visibility private + def w + self.width + end + + # @!visibility private + def w=(width) + self.width = width + end + end +end -- cgit v1.2.3