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 / Question about SetSpriteScissor

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Jun 2013 23:13
The SetSpriteScissor command has great potential.

But the way the inputs are applied are somewhat counter intuitive for me.

I would expect that the x/y positions would be relative to the upper left corner of the sprite and not associated with the sprite's position in the display.

And it would be great if you could cut from the right side instead of only from the left.

Does anyone know how to do that?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th Jun 2013 23:28
the Description says world coords,
x1,y1 to x2,y2 ist just a recangle on the screen and in it you can see the sprite i think.
and i think x2 must be > x1 and y2 must be > y1
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Jun 2013 17:43
You can clip from any direction.

If your sprite is at x,y and its 128x128 and you want to clip the 32 pixels off from the left:

setSpriteScissor(x+32, y, x+128, y+128)


If your sprite moves, just call scissor again.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Jun 2013 18:33
Thank you. That makes sense.

I've actually changed how I was doing the thing to using Memblocks and it is working very nicely.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 16:05:11
Your offset time is: 2024-11-24 16:05:11