Camera Coordinates

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

baenyth
Koopa
Koopa
Posts: 16
Joined: Mon Sep 07, 2020 6:34 pm
Pronouns: she/her

Camera Coordinates

Postby baenyth » Sat Feb 20, 2021 10:59 pm

Is there a way to use the coordinates of the camera? Such as have NPCs positioned in terms of the camera? Thanks in advance.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Camera Coordinates

Postby Hoeloe » Sun Feb 21, 2021 6:15 am

You can just use "camera.x" and "camera.y" in your Lua code, but note that these will be one frame behind in functions other than onDraw, onCameraDraw, or onDrawEnd, and onCameraUpdate may be affected by other Lua code, so you should try to make sure you use onDraw or onCameraDraw.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari