summaryrefslogtreecommitdiffhomepage
path: root/mrblib
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-02-08 07:51:34 -0500
committerrealtradam <[email protected]>2022-02-08 07:51:34 -0500
commit42b452cabe2b7ae6651891616d4d13030c018492 (patch)
treeea82f2cb1ab736e97479de44d72b637c43444fb0 /mrblib
parent864c710a510be8e318023e34565209f9a24a3ac7 (diff)
downloadmruby-raylib-42b452cabe2b7ae6651891616d4d13030c018492.tar.gz
mruby-raylib-42b452cabe2b7ae6651891616d4d13030c018492.zip
reworking some texture stuff
Diffstat (limited to 'mrblib')
-rw-r--r--mrblib/raylib.rb2
-rw-r--r--mrblib/texture.rb23
2 files changed, 24 insertions, 1 deletions
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