|
Post by Elmigo on Nov 2, 2017 10:56:01 GMT
how to move camera over scene? SetCameraPos(vector2(x,y)) dont work from scene update callback
|
|
|
Post by Admin on Nov 2, 2017 14:57:46 GMT
I just put together a quick example:
void GameLoop() {
// CameraControl ETHInput @input = GetInputHandle(); vector2 screenSize = GetScreenSize(); vector2 cameraPos = GetCameraPos(); vector2 cursorMove = input.GetMouseMove(); vector2 cursorPos = input.GetCursorPos(); const uint camSpeed = 10;
//Center camera on player -----> SetCameraPos(player.GetPositionXY() - (screenSize / 2.0f)); //Use mouse, or arrow keys for scrolling if (cursorPos.x > (screenSize.x - 10)) { AddToCameraPos(vector2(camSpeed, 0)); } if (cursorPos.x < (10)) { AddToCameraPos(vector2(-camSpeed, 0)); } if (cursorPos.y > (screenSize.y - 10)) { AddToCameraPos(vector2(0, camSpeed)); } if (cursorPos.y < (10)) { AddToCameraPos(vector2(0, -camSpeed)); } if (input.KeyDown(K_UP)) { AddToCameraPos(vector2(0, -camSpeed)); }
if (input.KeyDown(K_DOWN)) { AddToCameraPos(vector2(0, camSpeed)); } if (input.KeyDown(K_LEFT)) { AddToCameraPos(vector2(-camSpeed, 0)); } if (input.KeyDown(K_RIGHT)) { AddToCameraPos(vector2(camSpeed, 0)); } }
If that isn't quite what you were looking for, just let me know, I might have misunderstood.
|
|
|
Post by Elmigo on Nov 4, 2017 6:59:21 GMT
thanks
|
|
|
Post by Admin on Nov 4, 2017 21:15:51 GMT
No problem, did you figure out the android build? If you had no issues with compiling 0-9-11 I keep getting boost sdk error.
|
|
|
Post by Elmigo on Nov 5, 2017 16:38:09 GMT
i spend some time to research theme of building for android with ndk and can say that i dont ready write Android.mk and so on build tutor with lib android project interesting for me as before
additionaly: i remarked that simple quick start demo some lagged, reason of this lag vsync=true in config of all demos with vsync=false all ok, but... float speed = UnitsPerSecond(5.0f); with vsync=false give different speed on realmachine (win7) with virtual (ubuntu vbox winXP) UnitsPerSecond(5.0f) on win7 === UnitsPerSecond(120) on winxp
|
|
|
Post by Elmigo on Nov 7, 2017 10:19:45 GMT
dont keep getting boost, cancel android machine issue, sorry for bother
|
|
|
Post by Admin on Nov 7, 2017 14:05:46 GMT
OK, the dev never responded yet anyway, so no worries. That units per second issue, I'm wondering if that isn't just a vbox issue. I run all my stuff in Linux under wine and they run exactly the same as windows 7,8,10
|
|
|
Post by Elmigo on Nov 9, 2017 10:35:26 GMT
>OK, the dev never responded yet anyway i dont see any reason publish win,mac projects without android project for machine maybe there is hidden plan >That units per second issue, I'm wondering if that isn't just a vbox issue. i think so
|
|