diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 17:50:17 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 17:50:17 +0100 |
commit | 9288e4964526f1ce6b7d0aca0f075a04f56ede32 (patch) | |
tree | 7277b99336d528b1ee7aebb278c84e0353ddcf01 /src/example | |
parent | 121b64b1cb6cfead5814070c8b0185d3d7308095 (diff) |
first version world postions with camera
Diffstat (limited to 'src/example')
-rw-r--r-- | src/example/rendering.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp index c9e62f1..3631c76 100644 --- a/src/example/rendering.cpp +++ b/src/example/rendering.cpp @@ -23,7 +23,7 @@ int main() { ComponentManager mgr{}; RenderSystem sys{mgr}; - GameObject obj = mgr.new_object("name", "tag", Vector2{0, 0}, 1, 1); + GameObject obj = mgr.new_object("name", "tag", Vector2{250, 0}, 0, 1); GameObject obj1 = mgr.new_object("name", "tag", Vector2{500, 0}, 1, 0.1); GameObject obj2 = mgr.new_object("name", "tag", Vector2{800, 0}, 1, 0.1); @@ -32,13 +32,16 @@ int main() { Color color(0, 0, 0, 0); obj.add_component<Sprite>(make_shared<Texture>("../asset/texture/img.png"), color, FlipSettings{false, false}); - obj.add_component<Camera>(Color::get_red()); + Camera & cam = obj.add_component<Camera>(Color::get_red()); + } + /* { Color color(0, 0, 0, 0); obj1.add_component<Sprite>(make_shared<Texture>("../asset/texture/second.png"), color, FlipSettings{true, true}); } + */ /* { |