Creating a Camera2D returns a Camera3D #12
-
Hi, i'm trying to create a Camera2D, but it looks like i get a Camera3D instead. Code: var camera = Camera2D.create();
// Vector2 should be Vector3
camera.target = Vector2.create(0, 0);
// Camera has no field zoom
camera.zoom = 2; And here are a list of things that i did to try to fix this:
Example of cast camera2D: // Doesn't compile
var camera = cast(Camera2D.create(), Camera2D); Example of use camera with vector3 and add to a BeginMode2D() var camera = Camera2D.create();
camera.target = Vector3.create(0, 0, 0);
while(!WindowShouldClose())
{
BeginDrawing();
BeginMode2D(camera);
ClearBackground(Colors.RAYWHITE);
EndMode2D();
EndDrawing();
} I'm pretty new to the haxe language, so i don't if i'm doing something bad. |
Beta Was this translation helpful? Give feedback.
Answered by
foreignsasquatch
Dec 12, 2021
Replies: 1 comment 2 replies
-
Thank you for noticing this 😓it seems that |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Caresle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for noticing this 😓it seems that
Camera2D.create
just returns a Camera instead of a Camera2D. It will be fixed soon :)