Code: Select all
ExamineDesktops()
InitSprite()
InitKeyboard()
Global Window_0.i
Procedure OutOfService()
#Font = 0
#Sprite = 0
Define Quit.b = #False
Define ScreenH.i = DesktopHeight(0)
Define ScreenW.i = DesktopWidth(0)
Define Text.s = "Out Of Service"
Define x.i = 1
Define y.i = 1
Define xd.i = 1
Define yd.i = 1
Define SpriteH.i
Define SpriteW.i
Define TWidth.i
Define THeight.i
Define TextFont.i = LoadFont(#Font, "Tahoma", 32, #PB_Font_Bold)
If OpenWindowedScreen(WindowID(Window_0), 0, 0, ScreenW, ScreenH) = 0
End
EndIf
ClearScreen(RGB(0,0,0))
StartDrawing(ScreenOutput())
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(Textfont)
DrawText(0, 0, Text, #White, #Black)
TWidth = TextWidth(Text)
THeight = TextHeight(Text)
StopDrawing()
GrabSprite(#Sprite, 0, 0, TWidth, THeight, #PB_Sprite_PixelCollision)
SpriteH = SpriteHeight(#Sprite)
SpriteW = SpriteWidth(#Sprite)
Repeat
ClearScreen(RGB(0, 0, 0))
DisplaySprite(#Sprite, x, y)
x=x+xd:y=y+yd
If y>ScreenH - SpriteH
yd=-1
EndIf
If x>ScreenW - SpriteW
xd=-1
EndIf
If y<0
yd=1
EndIf
If X<0
xd=1
EndIf
FlipBuffers()
ExamineKeyboard()
Delay(1)
Until KeyboardPushed(#PB_Key_Escape)
FreeSprite(#Sprite)
CloseScreen()
EndProcedure
Width = DesktopWidth(0)
Height = DesktopHeight(0)
Depth = DesktopDepth(0)
; Create borderless window with above measurements and black background.
Window_0 = OpenWindow(#PB_Any, 0, 0, Width, Height, "", #PB_Window_BorderLess)
SetWindowColor(Window_0, RGB(0,0,0))
OutOfService()