aboutsummaryrefslogtreecommitdiff
path: root/src/example/rendering_particle.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-22 13:54:13 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-22 13:54:13 +0100
commit385f19a8c896ec126c569f1e5337d6d370d20517 (patch)
treebdadcca9c504176ada3ba4ef8e9754df8042e52e /src/example/rendering_particle.cpp
parentad0dcad1f11d698abf71bf69fb0927c26298d253 (diff)
working aspect ratio in world units. and add pillarboxing/letterboxing depending on ratio
Diffstat (limited to 'src/example/rendering_particle.cpp')
-rw-r--r--src/example/rendering_particle.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 4571afb..96ef3df 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -23,16 +23,18 @@ using namespace std;
int main(int argc, char * argv[]) {
ComponentManager mgr;
- GameObject game_object = mgr.new_object("", "", Vector2{100, 100}, 0, 0.1);
+ GameObject game_object = mgr.new_object("", "", Vector2{400, 300}, 0, 0.1);
RenderSystem sys{mgr};
ParticleSystem psys{mgr};
Color color(255, 255, 255, 255);
Sprite & test_sprite = game_object.add_component<Sprite>(
- make_shared<Texture>("../asset/texture/img.png"), color, FlipSettings{false, false});
+ make_shared<Texture>("asset/texture/test_ap43.png"), color, FlipSettings{false, false});
test_sprite.order_in_layer = 5;
+
+ /*
auto & test = game_object.add_component<ParticleEmitter>(ParticleEmitter::Data{
.position = {0, 0},
.max_particles = 10,
@@ -52,13 +54,17 @@ int main(int argc, char * argv[]) {
},
.sprite = test_sprite,
});
+ */
+
game_object.add_component<Camera>(Color::WHITE);
+ /*
game_object
- .add_component<Sprite>(make_shared<Texture>("../asset/texture/img.png"), color,
+ .add_component<Sprite>(make_shared<Texture>("asset/texture/img.png"), color,
FlipSettings{false, false})
.order_in_layer
= 6;
+ */
auto start = std::chrono::steady_clock::now();
while (std::chrono::steady_clock::now() - start < std::chrono::seconds(5)) {