I hope I'm not missing the point as I often do. My personal approach makes this sort of thing easy to work around.
First, I create a 'UDT' for sprites.
Second, I create an array with the UDT as the TYPE.
Third, I declare A variable to keep track of how many Sprites I've created.
Like:
Type Sprite_Type
ID As Integer
IndexID As Integer
Label As String
Pos_X As Float
Pos_Y As Float
Size_X As Float
Size_Y As Float
Ang As Float
EndType
Global Sprite As Sprite_Type[]
Global Sprite_Counter As Integer
I create Functions for pretty much EVERYTHING, so to create/load Sprites, I would call a Function like:
Sprite_Counter = Sprite_Counter + 1
AddNewSprite( Sprite_Counter , MySpritesImageID )
And the function would look something like:
Function AddNewSprite( IndexID As Integer , ImgID As Integer )
If IndexID > Sprite.Length
Sprite.Length = IndexID
Endif
Sprite[ IndexID ].ID = CreateSprite( ImgID )
EndFunction
I could easily add "Group As Integer" to the UDT and with a FOR/NEXT, get a quantity of Sprites in a group, extract an ID, or anything else I wish.
temp_Qty = 0
MyChosenGroup = 12345
If Sprite_Counter > 0
For temp_Count = 1 To Sprite_Counter
If Sprite[temp_Count].Group = MyChosenGroup
temp_Qty = temp_Qty + 1
Endif
Next
Endif
MyChosenGroup = 12345
MyFirstSpriteInGroup = 0
For temp_Count = 1 To Sprite_Counter
If Sprite[temp_Count].Group = MyChosenGroup
MyFirstSpriteInGroup = Sprite[temp_Count].ID
Endif
Next
I hope that makes sense, and that there aren't any errors. I've not tested this code.
|,,|, (Dead Knot Broken) ,|,,|