AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite.SetCollideBit Method

Sets or removes a category that this sprite can collide with.

Syntax
Pascal
procedure SetCollideBit(const Category: Cardinal; const Enabled: Boolean);
Parameters 
Description 
const Category: Cardinal 
The category to set collision on or off for this sprite, must be between 1 and 16 inclusive. 
const Enabled: Boolean 
True to set collision on, or False to turn it off. 

Sprites are assigned categories using SetCategoryBit. There are 16 categories. A value of 1 for that category represents that this sprite will collide with sprites from that category and 0 that it will not collide with that category, regardless of which category this sprite itself belongs to. By default all sprites belong to category 1 and collide with all categories. This command is similar to CollideBits except this command sets one category at a time whilst that command sets them all at once using a bit mask.

Copyright (c) 2012. All rights reserved.