Why the Animated Window starts empty?
Posted: Fri Apr 18, 2025 1:38 am
This is the code for a small animated window with text in the center. The issue is that the text stays invisible when the window first appears and only becomes visible once it reaches the center of the screen!
Any suggestions will be greatly appreciated.
Any suggestions will be greatly appreciated.
Code: Select all
Global.i WinWidth = 420
Global.i WinHeight = 320
If OpenWindow(0, 0, 0, winWidth, WinHeight, "Title", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(1, 94, 120, winWidth, 20, "HELP ME SHOWING MYSELF FROM START!")
ExamineDesktops()
finalX = (DesktopWidth(0) - winWidth) / 2
finalY = (DesktopHeight(0) - winHeight) / 2
Direction.s = "right-then-right"
startX = DesktopWidth(0) : startY = finalY
exitX = startX : exitY = startY
For x = startX To finalX Step -5
ResizeWindow(0, x, finalY, #PB_Ignore, #PB_Ignore)
Delay(5)
Next
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
CloseWindow(0)
Break
EndSelect
ForEver
EndIf