From bde8c8bd073abeb314748d66d6402f951ecb2902 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Wed, 9 Nov 2022 16:11:15 -0300 Subject: feat create method Rectangle#draw --- test/src/main.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/src/main.rb') diff --git a/test/src/main.rb b/test/src/main.rb index be0ae0b..b7bbe85 100644 --- a/test/src/main.rb +++ b/test/src/main.rb @@ -25,9 +25,12 @@ end def init() texture = CandyGear::Texture.from_image("textures/color_texture.png"); mesh = CandyGear::Mesh.new("meshes/cube.cgmesh"); + + $color = CandyGear::Vector3D.new(0.8, 0.2, 0.2); $model = CandyGear::Model.new(mesh, texture); $sprite = CandyGear::Sprite.new( texture, CandyGear::Vector4D.new(0, 0, 1.0, 1.0)); + $rectangle = CandyGear::Rectangle.new(102.0, 1.0, 101.0, 101.0) $sprite_position = CandyGear::Vector4D.new(1.0, 1.0, 101.0, 101.0); $instances = [ @@ -83,8 +86,9 @@ end def quit() = CandyGear.quit(); def tick() - $view1.draw($sprite, $sprite_position); + $sprite.draw($view1, $sprite_position); $instances_rotation.rotate(0.0, BOX_ROTATION_SPEED); + $rectangle.draw($view1, $color); $instances.each do |i| $model.draw(i, $instances_rotation); end -- cgit v1.2.3