Click or drag to resize
SpriteBaseGetNearestSpriteIndex Method
Compute the index of the nearest active sprite from the specified category and return it.

Namespace: (Default Namespace)
Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax
C#
public virtual int GetNearestSpriteIndex(
	SpriteCollection Target
)

Parameters

Target
Type: (Default Namespace)SpriteCollection
Sprite category whose sprites will be searched for sprites near this sprite.

Return Value

Type: Int32
An integer representing the 0-based index of the nearest active sprite, or -1 if there are no active sprites in the specified category.
Remarks
The output of this function would commonly be stored in a sprite parameter for passing to PushTowardCategory(SpriteCollection, Int32, Int32).
See Also