Well,
I've been using dbpro for awhile; however, posted in this board because I feel the question should be self explanatory.
I am trying to have an animated sprite play in the background of another animated sprite that has holes in it (transparent letters to be exact).
My code looks as follows:
Backdrop On
Color Backdrop 0
`Load Background Images
`Wood Texture
MenuBGSpriteNum = GetNextSpriteNum()
MenuBGImageNum = GetNextImageNum()
Load Image "Media\Menu\1080p.png", MenuBGImageNum
Sprite MenuBGSpriteNum, 0, 0, MenuBGImageNum
Set Sprite Priority MenuBGSpriteNum, 1
`Fire
MenuFireSpriteNum = GetNextSpriteNum()
MenuFireImageNum = GetNextSpriteNum()
Create Animated Sprite MenuFireSpriteNum, "Media\Menu\FireAnimated.gif", 256, 300, MenuFireImageNum
Set Sprite Priority MenuFireSpriteNum, 0
Play Sprite MenuFireSpriteNum, 1, 60, 1
Do
If spacekey() = 1 then end
Loop
Function GetNextSpriteNum()
If OldReturnValue = 0 then OldReturnValue = 100
For i = 1 to 1000
If Sprite exist(i) = 0
If ReturnValue <> OldReturnValue
ReturnValue = i
EndIf
EndIf
Next i
OldReturnValue = ReturnValue
EndFunction ReturnValue
Function GetNextImageNum()
If OldReturnValue = 0 then OldReturnValue = 100
For i = 1 to 1000
If Image Exist(i) = 0
If ReturnValue <> OldReturnValue
ReturnValue = i
EndIf
EndIf
Next i
OldReturnValue = ReturnValue
EndFunction ReturnValue
EDIT:
More Information that I forgot...
The fire is an animated gif, 60 frames long.
Also, I've tried the following code to no avail:
Backdrop On
Color Backdrop 0
`Load Background Images
`Wood Texture
MenuBGSpriteNum = GetNextSpriteNum()
MenuBGImageNum = GetNextImageNum()
Load Image "Media\Menu\1080p.png", MenuBGImageNum
Sprite MenuBGSpriteNum, 0, 0, MenuBGImageNum
Set Sprite Priority MenuBGSpriteNum, 1
`Fire
MenuFireSpriteNum = GetNextSpriteNum()
MenuFireImageNum = GetNextSpriteNum()
Load Image "Media\Menu\FireAnimated.gif", MenuFireImageNum
Sprite MenuFireSpriteNum, 700, 455, MenuFireImageNum
Set Sprite Priority MenuFireSpriteNum, 0
Play Sprite MenuFireSpriteNum, 1, 60, 1
Do
If spacekey() = 1 then end
Loop
EDIT 2:
Figured out what the problem was. I was trying to use an animated Gif... luckily Spooky had some code on how to use it.
Here is how I got it to work for anyone interested:
sync on : sync rate 60
Backdrop On
Color Backdrop 0
`Load Background Images
`Wood Texture
MenuBGSpriteNum = Find Free Sprite()
MenuBGImageNum = Find Free Image()
Load Image "Media\Menu\1080p.png", MenuBGImageNum
Sprite MenuBGSpriteNum, 0, 0, MenuBGImageNum
`Fire
MenuFireImageNum = Find Free Image()
MenuFireAnimationNum = Find Free Animation()
MenuFireObjectNum = Find Free Object()
Load Animation "Media\Menu\FireAnimated.gif", MenuFireAnimationNum
MenuFireAnimationW = Animation Width(MenuFireAnimationNum)
MenuFireAnimationNumH = animation height(MenuFireAnimationNum)
Play Animation to Image MenuFireAnimationNum, MenuFireImageNum, 0, 0, MenuFireAnimationW, MenuFireAnimationNumH
Make Object Cube MenuFireObjectNum, 25
Texture Object MenuFireObjectNum, MenuFireImageNum
Position Object MenuFireObjectNum, -5, Object Position Y (MenuFireObjectNum), Object Position Z(MenuFireObjectNum)
Do
If Spacekey() = 1 Then End
`Load Animation to Object
Paste Image MenuFireImageNum,0,0
Turn Object Left MenuFireObjectNum,0.7
Pitch Object Up MenuFireObjectNum,0.5
Sync
Loop
Really neat effect!
If at first you dont succeed, LOWER YOUR STANDARDS.