Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Percentage screen and world questions

Author
Message
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 23rd Apr 2017 01:26
I am new to app game kit, but I am programmer professionally and i have made a game that's out there using LibGdx. I wanted a framework that makes it easier for me to create games and so far I'm impressed with App Game Kit. One area that I'm struggling a little bit with is the percentage positioning system. Looking trough the documentation it seems to indicate that world coordinates are from 0 to 100 in both the xy axises. But then in places I read that screen space is also 0 to 100. What I am wondering if I want to build a world that is bigger than the view port, how do I specify positions off of the screen, but in the world, when I place sprites ?

Any feedback would be greatly appreciated.

Thank you.
programming is ace
User Banned
Posted: 23rd Apr 2017 12:57
I think can get it by

objectwidth# / getdevicewidth() * 100

objectheight# / getdevicehieght() * 100


Maybe

RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 23rd Apr 2017 13:54
Thanks for the reply. I guess what I'm trying to get an understanding of is if the world is bigger than the viewport and I want to place the object in the world, but outside of the current viewport how do I do that?

Do you try to set the position at 120% or do you have to use some form of zooming to accomplish that with the percentage system?
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 23rd Apr 2017 14:52
Just use values <0 and >100
PSY LABS Games
Coders don't die, they just gosub without return
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 23rd Apr 2017 19:45
I will do that, thank you.
programming is ace
User Banned
Posted: 23rd Apr 2017 19:55
The world is what you make it, just set the X#, Y#, Z# to what ever values you want

To extend the camera viewport - eg SetCameraRange(1,0,100000)

You got a sample code already, then can work something out to achieve your goal

programming is ace
User Banned
Posted: 23rd Apr 2017 20:07
setcamerarange(cameraID,1,10000) - it doesn't except 0 as a near - or something similar to view the whole world

BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2017 12:13
RGBZ, please ignore the advice on SetCameraRange. It sounds like you are talking about 2D (Viewport, sprites, XY). Camera range only affects 3D.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 25th Apr 2017 12:53
I figured they were talking 3D. You are correct that I was talking about 2D. I was just curious how you place things in the world when you are dealing with a percentage system. Since the viewport is goes up to 100%, that you can place things off screen using percentages over 100%.
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2017 13:20
Personally I don't use the percentage system as it confuses me.
Rather than call it percentage, it makes more sense to say that the screen is 100 units by 100 units. Then it becomes obvious that you can place a sprite at 120 units, or -20 units.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
RGBZ
6
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 25th Apr 2017 14:10
That does make a lot of sense to think of it that way. Thanks.

Login to post a reply

Server time is: 2024-03-28 09:20:26
Your offset time is: 2024-03-28 09:20:26