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 / Move 2D view without affecting box 2D Physics?

Author
Message
Braude Interactive
17
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Sheffield, UK
Posted: 12th Feb 2019 23:21
Just getting started with AppGameKit today, and I'm loving it so far.

I'm used to DBPro, where you'd just position images at say:


Then you could move the "view"around as you pleased.

In AppGameKit I'm really impressed with the simplicity of the Box2D system and I want to make a dead simple platformer that uses it.

But I don't want to interfere with the sprite co-ordinates, I want to let the physics solver deal with that (as I think I'm supposed to).

So my question is, how do we move the "view" when using box physics?

Please, point me to another thread if this is a common question- I couldn't see anything on here.
I wish I could change my forum name. I\'m not a company, and I\'m not 14 anymore. *sigh*
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Feb 2019 23:46 Edited at: 12th Feb 2019 23:48
Have a look at SetViewOffset()
SetViewZoom() as well if you want to zoom in out

FixSpriteToScreen() for your HUD stuff
Braude Interactive
17
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Sheffield, UK
Posted: 13th Feb 2019 06:55
No way! I didn't expect it to be built in! Thank you.
I wish I could change my forum name. I\'m not a company, and I\'m not 14 anymore. *sigh*

Login to post a reply

Server time is: 2024-04-24 07:56:45
Your offset time is: 2024-04-24 07:56:45