PB5.43 LTS x64 UBUNTU 16.04 LTS
Code: Select all
If InitSprite() = 0 Or InitKeyboard() = 0 : MessageRequester("PROGRAM","Could Not initialize.") : End : EndIf
; create a 800x600 window
OpenWindow(0,0,0,800,600,"PROGRAM",#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget)
OpenWindowedScreen(WindowID(0),0,0,800,600,#True,0,0)
; create a 300 x 200 display in top left corner
StartDrawing(ScreenOutput())
Circle(100,100,50,RGB(0,0,255)) ; a nice blue circle...
Box(150,20,20,20, RGB(0,255,0)) ; and a green box
FrontColor(RGB(255,0,0)) ; Finally, red lines..
For k=0 To 20 : LineXY(10,10+k*8,200, 0) : Next
DrawingMode(#PB_2DDrawing_Transparent)
BackColor(RGB(0,155,155)) ; Change the text back and front colour
FrontColor(RGB(255,255,255))
DrawText(10,50,"Hello, this is a test")
StopDrawing()
; convert top left corner display to 300x200 sprite
GrabSprite(1,0,0,300,200)
FlipBuffers()
; set a breakpoint here, and from the debugger's Library Viewer select sprite Library
; sprite 1's depth=32 in Windows®, depth=0 in UBUNTU Linux
BYEBYE= 0 : REFRESH= 1
; Draw the screen and wait for escape or exit.
Repeat
RELEASE= ElapsedMilliseconds()+ 20
Repeat
X= WindowEvent() : If X = #PB_Event_CloseWindow : BYEBYE+ 1 : EndIf
Until X = 0
If REFRESH
StartDrawing(ScreenOutput())
Box(0,0,800,600,RGB(64,64,64))
StopDrawing()
DisplayTransparentSprite(1,250,200)
FlipBuffers()
REFRESH= 0
EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape) : BYEBYE+ 1 : EndIf
If ElapsedMilliseconds() < RELEASE
Repeat : Delay(2) : Until ElapsedMilliseconds() > RELEASE
EndIf
Until BYEBYE