Hi all!
I have little problem when use DrawBox (or DrawLine etc.) and SetViewZoom( zoom# ).
If I change the value zoom# (es.: 2.0) the sprites are scaled correctly, but the Box (Line, elipse etc) remain at the same size.
I use the AppGameKit Trial version and I dont'know if in final version they works correctly !
Sorry for my bad english I'm Italian!
This is my test code:
SetWindowSize( 1366, 768, 0 )
SetPrintSize( 20 )
initDisplay ( 768 )
LoadImage(1,"1.png")
id_loading=CreateSprite(1)
CreateSprite(1,0)
do
if getRawKeyState(27) then exit
zoom# = zoom# + (GetRawMouseWheelDelta() / 30)
if zoom# <= 0.10 then zoom# = 0.10
if zoom# >= 2 then zoom# = 2
SetViewZoom( zoom# )
pos_x# = (virtualWidth /2) - (GetSpriteWidth(id_loading)/2)
pos_y# = (virtualHeight/2) - (GetSpriteHeight(id_loading))
RMX# = GetRawMouseX()
RMY# = GetRawMouseY()
PSX# = pos_x#
PSY# = pos_y#
GSW# = GetSpriteWidth(id_loading)
GSH# = GetSpriteHeight(id_loading)
DrawBox( PSX#, PSY#, GSW# + PSX#, GSH# + PSY#, 255, 255, 255, 255, 0 )
SetSpriteX(id_loading,pos_x# )
SetSpriteY(id_loading,pos_y# )
DrawSprite(id_loading)
Print( ScreenFPS() )
Print ("Cursor X: " + str(GetRawMouseX(),2))
Print ("Cursor Y: " + str(GetRawMouseY(),2))
Print ("Zoom: " + str(zoom#,2))
Sync()
loop
global virtualWidth
global virtualHeight
function initDisplay ( height# )
device_width# = GetDeviceWidth ( )
device_height# = GetDeviceHeight ( )
virtual_width_multiplier# = device_width# / device_height#
if ( device_width# < device_height# )
virtual_width_multiplier# = device_height# / device_width#
endif
SetVirtualResolution ( height# * virtual_width_multiplier#, height# )
virtualWidth = height# * virtual_width_multiplier#
virtualHeight = height#
endfunction