summaryrefslogtreecommitdiff
path: root/test/src/mode
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/mode')
-rw-r--r--test/src/mode/demo.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/src/mode/demo.rb b/test/src/mode/demo.rb
index b3be78d..5f28454 100644
--- a/test/src/mode/demo.rb
+++ b/test/src/mode/demo.rb
@@ -29,16 +29,15 @@ module Mode
@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));
+ @sprite = CandyGear::Sprite.new(texture, 0, 0, 1.0, 1.0);
@rectangle = CandyGear::Vector4D.new(103.0, 1.0, 100.0, 100.0);
@sprite_position = CandyGear::Vector4D.new(1.0, 1.0, 100.0, 100.0);
@japanese_text_sprite = CandyGear::Sprite.new(
- japanese_text, CandyGear::Vector4D.new(0, 0, 1.0, 1.0));
+ japanese_text, 0, 0, 1.0, 1.0);
@japanese_text_position = CandyGear::Vector4D.new(
204.0, 1.0, japanese_text.width, japanese_text.height);
@english_text_sprite = CandyGear::Sprite.new(
- english_text, CandyGear::Vector4D.new(0, 0, 1.0, 1.0));
+ english_text, 0, 0, 1.0, 1.0);
@english_text_position = CandyGear::Vector4D.new(
204.0, japanese_text.height + 2.0,
english_text.width, english_text.height);
@@ -100,9 +99,15 @@ module Mode
end
def tick()
- @sprite.draw(@view1, @sprite_position);
- @japanese_text_sprite.draw(@view1, @japanese_text_position);
- @english_text_sprite.draw(@view1, @english_text_position);
+ @sprite.draw(
+ @view1, @sprite_position.x, @sprite_position.y,
+ @sprite_position.w, @sprite_position.h);
+ @japanese_text_sprite.draw(
+ @view1, @japanese_text_position.x, @japanese_text_position.y,
+ @japanese_text_position.w, @japanese_text_position.h);
+ @english_text_sprite.draw(
+ @view1, @english_text_position.x, @english_text_position.y,
+ @english_text_position.w, @english_text_position.h);
@instances_rotation.rotate(0.0, BOX_ROTATION_SPEED);
@rectangle.draw_rectangle(@view1, @color);
@instances.each do |i|