does not work with OpenScreen()

Sorry.
This is now obsolete, see further posts,
Code: Select all
Init Display, Screen, etc.
Radar=0
Frame=1
MaxFrames=24
Repeat
FlipBuffers()
ClearScreen(RGB(0,0,0))
DisplaySprite(1000,0,0) ; THIS IS THE BACKGROUND OF THE GAME
Gosub Routine1
Gosub Routine2
Gosub RoutineToVerifyIfRadarMustBeShown
If Radar = 1 ; The Radar Animation must be displayed
DisplaySprite(HandScan,200,150) ; This displays the device JPG on Top of the Background (It's a Game Window)
DisplaySprite(Frame,500,250) ; This displays one Frame of the GIF that I Photoshoped and converted into 24 small JPGs on top of HandScan
Frame=Frame+1 ; Here I increment the Frame to show (IF)
If Frame > MaxFrames
Frame = 1
EndIf
Gosub RoutineFINDobjects ;This Puts Another Sprite GIF on Top OF this Frame To Show Things IF detected
EndIf
Gosub Routine3
Gosub Routine4
Gosub Routine5
If Saved=1
DisplaySprite(1005,0,0)
EndIf
etc, etc, etc... More than 2000 lines inside this LOOP
Until Condition to end this Repeat and start another one, unless game ends or user saves and quits.
Code: Select all
OpenScreen(1920, 1080, 32, "", #PB_Screen_WaitSynchronization, 64)
Code: Select all
If Sprite = #PB_Any
Result = CreateSprite(#PB_Any, ImageWidth(Image), ImageHeight(Image), Mode)
Else
CreateSprite(Sprite, ImageWidth(Image), ImageHeight(Image), Mode)
result = sprite
EndIf
Code: Select all
If Sprite = #PB_Any
Sprite = CreateSprite(#PB_Any, ImageWidth(Image), ImageHeight(Image), Mode)
Result = Sprite
Else
Result = CreateSprite(Sprite, ImageWidth(Image), ImageHeight(Image), Mode)
EndIf
Try this code:PB Doc for CreateSprite wrote:Return value
Nonzero if the sprite has been created, zero otherwise. If #PB_Any was used for the #Sprite parameter then the generated number is returned on success.
Code: Select all
InitSprite()
OpenWindow(0,0,0,640,480,"")
OpenWindowedScreen(WindowID(0),0,0,640,480)
result = CreateSprite(8,32,32)
Debug result
Code: Select all
If Result
*AnimatedGIFSprite = AddMapElement(AnimatedGIFSprite\GIFInfoMap(), Str(Sprite))
*AnimatedGIFSprite\OrgImage = Image
*AnimatedGIFSprite\Sprite = Sprite