BindSprite() (Basic4GL)

BindSprite(sprite variable) is used to tell the program that, out of all the sprites in your program, you want all your commands that affect sprites to affect the sprite designated by BindSprite() until you designate another sprite to be affected by sprite commands with BindSprite(). This stops sprite commands from affecting sprites you don't want to be changed. It is used as so:


That would set sprite1's location to 5,5 and sprite2's location to 10,10. However, without the BindSprite(), both SprSetPos() commands would have affected sprite1 and it's original position would have been overridden by the second SprSetPos, placing it at 10,10.

It is important to constantly Bind sprites in programs so that it is affected by the right commands.

When a sprite is created, it is automatically Bound.

This page has been recommended for cleanup, integration, etc.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.