summaryrefslogtreecommitdiff
path: root/test/src/mode/demo.rb
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2025-06-21 16:51:22 -0300
committerFrederico Linhares <fred@linhares.blue>2025-06-21 16:51:22 -0300
commit8bedf8a366cb6c1179bc89678c863517b9356d48 (patch)
tree4a285592f804802d59f2af090113f607344ffdce /test/src/mode/demo.rb
parentb3428170ac0a1837d3568f7b49312cbb01179f5d (diff)
refa Remove View2DHEADmaster
View2D is almost useless and add too much complexity for the engine, so I am removing it.
Diffstat (limited to 'test/src/mode/demo.rb')
-rw-r--r--test/src/mode/demo.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/src/mode/demo.rb b/test/src/mode/demo.rb
index 65ea52a..86ef578 100644
--- a/test/src/mode/demo.rb
+++ b/test/src/mode/demo.rb
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Frederico de Oliveira Linhares
+# Copyright 2022-2025 Frederico de Oliveira Linhares
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -81,14 +81,12 @@ module Mode
@camera_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0);
color = CandyGear::Vector3D.new(0.12, 0.12, 0.18);
- @view1 = CandyGear::View2D.new(
- CandyGear::Vector4D.new(0, 0, 1280, 240), 640, 120);
- @view2 = CandyGear::View3D.new(
+ @view = CandyGear::View.new(
CandyGear::Vector4D.new(0, 240, 1280, 480), 1280, 480);
- CandyGear.views = [@view1, @view2];
+ CandyGear.change_views([@view], 640, 360);
- @view2.camera_position = @camera_position;
- @view2.camera_orientation = @camera_orientation;
+ @view.camera_position = @camera_position;
+ @view.camera_orientation = @camera_orientation;
end
def key_down(key)
@@ -125,16 +123,16 @@ module Mode
def tick()
@sprite.draw(
- @view1, @sprite_position.x, @sprite_position.y,
+ @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.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.x, @english_text_position.y,
@english_text_position.w, @english_text_position.h);
@instances_orientation.rotate(0.0, BOX_ROTATION_SPEED, 0.0);
- @rectangle.draw_rectangle(@view1, @color);
+ @rectangle.draw_rectangle(@color);
@instances.each {_1.draw()};
@skeletal_model.draw();
# @sprite_3d.draw();