GeneralRulesSelectTargetSpriteFor Method |
Namespace: (Default Namespace)Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax public virtual bool SelectTargetSpriteFor(
SpriteCollection Sprites,
int Index,
string TargetName
)
Parameters
- Sprites
- Type: (Default Namespace)SpriteCollection
Collection from which sprite is selected - Index
- Type: SystemInt32
0-based index within the collection of the sprite to be selected - TargetName
- Type: SystemString
A global name (quoted string) to indicate for what this sprite is being selected
Return Value
Type:
BooleanTrue if the specified index is within the bounds of the collection, False otherwise.
Remarks If the Index is beyond the bounds of the collection, the target reference cleared.
This function is useful in conjunction with
SetTargetParameterFor(String, Int32, String) and
GetTargetParameterFor(String, String) to set properties of arbitrary sprites within a
collection to trigger various behaviors based on their rules, or get properties to affect
the currently executing rules based on other sprites.
TargetName allows you to select any number of sprites by assigning each a globally
unique name to be used by any plan or sprite rules. Only one sprite can ever be associated with that
target name at a time. Assigning another to that name will replace the existing target with the new
one. Specify -1 for
Index to clear selection for the specified target.
See Also