diff options
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/mode/demo.rb | 20 | ||||
-rw-r--r-- | test/src/mode/title.rb | 7 |
2 files changed, 12 insertions, 15 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(); diff --git a/test/src/mode/title.rb b/test/src/mode/title.rb index 6347b70..2e5a35b 100644 --- a/test/src/mode/title.rb +++ b/test/src/mode/title.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. @@ -15,12 +15,11 @@ module Mode class Title def initialize() - @view = CandyGear::View2D.new( + @view = CandyGear::View.new( CandyGear::Vector4D.new(0, 0, 1280, 720), 640, 360); - CandyGear.views = [@view]; + CandyGear.change_views([@view], 640, 360); @menu = CandyGear::Menu.new( - @view, $global_data[:menu_view], 10, 10, [ {text: "Demo", action: -> {change_mode(:demo);}}, |