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 / Get Screen Resolution After Zooming!

Author
Message
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Sep 2015 01:19 Edited at: 16th Sep 2015 01:33
As the title suggested, how do i get screen resolution, both width and height, after zooming in or out?

Is there a function like "GetScreenResolutionWidth()" or "GetScreenResolutionHeight()"?

Or a function like "GetViewOffsetByZoomX()" or "GetViewOffsetByZoomY()"?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Sep 2015 01:46 Edited at: 16th Sep 2015 01:53
something like?
GetViewZoom
GetVirtualHeight
GetVirtualWidth
ScreenToWorldX ( x )
ScreenToWorldY ( y )
WorldToScreenX ( x )
WorldToScreenY ( y )
i believe the virtual screen size stay the same but the sprites are shown bigger/smaller, so i think the converting commands can help.

something i used for moving something with zoom


AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Chmava
11
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 16th Sep 2015 02:12
No, i have my own calculation for scroll on keyboard and multitouch.

What i mean is if zoom mode is set to center, but then you want to calculate base on top, left, bottom and right.

Basically scrolling with the screen border hitting the edge.

This is impossible when using multitouch scroll after zooming!
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Sep 2015 14:15
here i limiting the visible screen view offset,
i used 100x100 units and zoom from center.

if you know where the level ends, you have a position,
this you can transform from world in screencoords and compare if it is inside
0 - virtualwith

Quote: " ex#=GetRawTouchCurrentX(t)
ey#=GetRawTouchCurrentY(t)
dx#=ex#-zoom_sx#
dy#=ey#-zoom_sy#
dx#=dx#/getviewzoom()
dy#=dy#/getviewzoom()
vx#=getviewoffsetx()-dx#
vy#=getviewoffsety()-dy#
if vx#<-50 then vx#=-50.0
if vx#> 50 then vx#= 50.0
if vy#<-50 then vy#=-50.0
if vy#> 50 then vy#= 50.0
setviewoffset(vx#,vy#)
zoom_sx#=ex#
zoom_sy#=ey#"


AGK (Steam) V2 Beta .. : Windows 10 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-09-29 05:25:11
Your offset time is: 2024-09-29 05:25:11