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.

AppGameKit Classic Chat / Thank you for SetViewZoomMode(1) and ScreenToWorldX()

Author
Message
IBOL
Retired Moderator
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 19th Oct 2016 17:05
So yeah, Thank you for SetViewZoomMode(1) and ScreenToWorldX() !

I have to re-write my RTS game "Not Your Space" (for about the 6th time!) and i was trying AppGameKit 2 .

My first problem was zooming the screen and keeping the camera centered. I tried some fiddly math, spent about 15 minutes, but couldn't get it right.

Then i searched the command list. Lo and behold, SetViewZoomMode(). Worked like a charm.

Then i thought, ok, problem 1 solved, now onto problem 2: getting the mouse screen position to correspond to the actual sprite positions, once the view has been zoomed or scrolled.

Again with the fiddly math failure. But after my previous success, i wasted only 10 minutes before searching the commands...and...

ScreenToWorldX() works like a charm.

So thank you AGK2 !

Login to post a reply

Server time is: 2024-11-25 01:59:33
Your offset time is: 2024-11-25 01:59:33