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 / GetSpriteHit doesn't work with FixSpriteToScreen command

Author
Message
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 14th Apr 2013 19:28 Edited at: 14th Apr 2013 19:29
it seems GetSpriteHit doesn't take the FixToScreen mode into account. When changing screen offset, the sprite is still at the same place (good) but doesn't trigger the GetSpriteHit anymore (not good)

Normal ?
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 14th Apr 2013 20:12
I had the same problem but my sprites were buttons. I changed them over to virtual buttons and that fixed it. Not sure what to do if they are not buttons though.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 14th Apr 2013 20:23
May be normal. Simply add GetViewOffsetX and Y and it's ok .. just wanted to be sure if it is the correct behavior
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 14th Apr 2013 20:24
May be normal. Simply add GetViewOffsetX and Y and it's ok .. just wanted to be sure if it was the correct behavior
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Apr 2013 20:29 Edited at: 14th Apr 2013 20:31
for me it works, the description for screentoworldx i found in getspritehit

if getpointerpressed()=1
x#=screentoworldx(getpointerx())
y#=screentoworldy(getpointery())
spr=getspritehit(x#,y#)
if spr = bManual
ret=1
exit
endif

i using fix to screen too:
function MenuButton(img,x#,y#,s#)

spr=createsprite(img)
setspritepositionbyoffset(spr,x#,y#)
setspritedepth(spr,0)
setspritesize(spr,-1,s#)
FixSpriteToScreen( spr, 1 ) //FEST

endfunction spr
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 14th Apr 2013 20:34
yes it's the same thing

ok.. so it's a normal behaviour
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Apr 2013 20:53
based on the current view offset and zoom

Login to post a reply

Server time is: 2024-05-01 01:16:17
Your offset time is: 2024-05-01 01:16:17