Language Reference Guide : System Classes : SpriteDescriptor Class : Populate Method
 
Share this page          
Populate Method
The Populate method populates a SpriteDescriptor object's attributes with the properties encoded in a sprite's descriptor string.
The passed string may contain a single sprite descriptor string. The string may also be a full spritemap defining all the sprites displayed on a background—in this case an index is also passed, to identify the individual descriptor string to be applied. The properties encoded in the passed or extracted descriptor string are applied to the corresponding attributes of curobject.
Typically the passed string is derived from a call to the BitmapObject GetDisplayedElement method. For sample code on how this is used, see the BitMapObject class GetDisplayedElement Method.
This method has the following syntax:
integer = SpriteDescriptor.Populate(string = StringObject [,indx = integer]
          [, spritesource = BitmapObject])
This method has the following parameters:
string
(Required) Specifies the stringobject containing the descriptor string. The string can define a single sprite or multiple sprites. If multiple, then the indx parameter must be set to identify which sprite description to use.
indx
Specifies the index of the sprite description to populate the object with.
spritesource
Specifies a bitmapobject to set the SpriteSource attribute to. Sprite descriptor strings do not specify the sprite bitmapobject itself.
The method returns ER_OK if the descriptor was applied successfully to populate the spritedescriptor object, or ER_FAIL if the call failed.