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 / Set/Get SpriteCategoryBit

Author
Message
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 9th Feb 2015 01:13 Edited at: 9th Feb 2015 03:22
Please have a look a the Code:

I gave each sprite a category and then Tried to get the sprite number of certain category (in this case first sprite). but when the mouse rollover,
it seems that am getting the all sprite numbers as the command is not using the mask.

EDIT:
Problem solved. (sorry for throwing the post)



Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Feb 2015 17:42 Edited at: 11th Feb 2015 17:44
Edit: Ah, I see you already marked the problem as solved, but I'll leave my answer here in case anyone else has the same problem.

The SetSpriteCategoryBit command is for when you don't want to use binary numbers, for example you set each category bit individually in the range 1 to 16 like so


The SetSpriteCategoryBits command is if you want to use binary numbers to set all the bits at once


You are currently using the first command but with binary numbers, it looks like you meant to use the second command.

Login to post a reply

Server time is: 2024-05-18 20:42:27
Your offset time is: 2024-05-18 20:42:27