Hi to all ...
I tried to use the command DrawBox, but if I change the SetViewZoom( zoom# ) the sprite is scaled but the Box (or Line or elipse) remain in the original size.
I use AppGameKit trial version and i don't know if in final release they work fine!
Sorry for my bad english, I'm Italian!
This is my code test:
SetWindowTitle( "NoName " )
SetWindowSize( 1366, 768, 1 )
SetPrintSize( 20 )
initDisplay ( 768 )
SetViewZoomMode( 0 )
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
obal 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