Euflorium: The Eufloria Community
Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: Tomfloria on May 08, 2012, 01:26:53 AM
-
I would like to do this, completely restrict the Position and Zoom from the user?
Mainly because say I put SetCameraPosition(0,0) then move the screen somewhere else and then later on the code is SetCameraPosition(100,0) it won't actually go to (100,0), it will go somewhere else depending on where I move the screen, I'm guessing it's not actually coordinates? but how far to move on the x,y position?
-
Try using
x = 0
y = 0
while GameRunning() do
SetCameraPosition(x,y)
end
When you want to change the position of the camera, then change the values of the variables x and y. It will make your code a lot easier to manage and you may not get the bug I think you are having.
-
What about if I wanted to give the user the option to move around and that later?
-
Then put the SetCameraPosition inside an if statement.
x = 0
y = 0
cameraRestricted = true
while GameRunning() do
if cameraRestricted then
SetCameraPosition(x,y)
end
end
-
thanks :) ill add that in later and get back to you!
-
That doesn't seem to work at all
-
What happens when you try?
You're putting this code inside function LevelLogic, right? It won't work if you put it inside LevelSetup.
Also, it's missing a couroutine.yield()
It should be this:
function LevelLogic()
x = 0
y = 0
cameraRestricted = true
while GameRunning() do
if cameraRestricted then
SetCameraPosition(x,y)
end
coroutine.yield()
end
end
-
If you want to restrict the zoom too, use something like this:
function LevelLogic()
x = 0
y = 0
cameraRestricted = true
ZoomAmount = 5
while GameRunning() do
if cameraRestricted then
SetCameraPosition(x,y)
SetCameraZoom(ZoomAmount)
end
coroutine.yield()
end
end
-
It will doesn't work Annikk, It must be an iPad limitation.
-
If you try loading up the level Extreme Pwn Laz0rs, that should restrict your view. Try zooming out. You might notice during the first minute, the amount you can zoom out is gradually increasing. Do you get that on your iPad? If so, what you are trying to do is possible after all. :>