Open Snky opened 9 years ago
Hi,
we could have a get accessor, offset used to exist as an actual property we had to set before the multi-resolution system was created. I believed that it was no longer useful to have to give an absolute value because the stage could change size either at the start or during a game so a factor (like center is now) was better, not knowing the final stage size anyway. offset is still used internally by the camera though.
If you're not using camera rotation, camera.getRect() will be the camera bounding box (AABB actually) in the citrus world's space.
otherwise you can project any point of the "screen" into the citrus world , even when using rotation and/or zooming, using camera.pointFromLocal(0,0,resultPoint); you'll get a point that represents the top left of the camera regardless of the zoom or rotation so its safe.
substracting offset.x to campos.x as you do (by the way campos was never supposed to be public but since I've seen people using it a lot, it got left like that) is not safe - regarding zoom or rotate. in fact campos is created with pointFromLocal(offset.x, offset.y, _camPos);
Anyway I'll consider that.
ACitrusCamera.as protected var offset:Point = new Point();
Was wondering if it would be a good idea to expose ACitrusCamera.as offset publicly instead of protected, or make a getter/setter as standard with CE. I found this very useful to replicate HUD/GUI/addChild like positioning when testing several different resolutions.
My issue was this: campos.manualposition = x50000 y50000 anchor.x = campos.x + stagewidth - 300; The anchor appears in different places depending on resolution. Solution: anchor.x = campos.x - cam.offset.x + stagewidth - 300;
If there was a way to get the camera left bounding box of the actual current view.. sorry for this post, and please let me know, I've spent some time looking for that stuff but I didn't find anything.
::adl -screensize 1080x1920:1080x1920 "%APP_XML%" "%APP_DIR%" adl -screensize 0980x1720:0980x1720 "%APP_XML%" "%APP_DIR%" adl -screensize 0750x1334:0750x1334 "%APP_XML%" "%APP_DIR%" adl -screensize 0752x1280:0752x1280 "%APP_XML%" "%APP_DIR%" ::adl -screensize 0640x1136:0640x1136 "%APP_XML%" "%APP_DIR%" adl -screensize 0640x0960:0640x0960 "%APP_XML%" "%APP_DIR%" ::adl -screensize 0540x0960:0540x0960 "%APP_XML%" "%APP_DIR%" ::adl -screensize 0480x0800:0480x0800 "%APP_XML%" "%APP_DIR%" adl -screensize 0320x0480:0320x0480 "%APP_XML%" "%APP_DIR%"