Code : Tout sélectionner
If OpenWindow(0, 100, 0, 1820, 980, "2D Drawing Test")
If CreateImage(0, 1820, 980)
If StartDrawing(ImageOutput(0))
x=20
Box(20, 20, 420, 420, RGB(255,255,255))
Box(20, 460, 420, 420, RGB(255,255,255))
Box(460+x, 20, 420, 420, RGB(255,255,255))
Box(460+x, 460, 420, 420, RGB(255,255,255))
Box(26, 25, 98, 98, RGB(0,0,0))
Box(129, 25, 98, 98, RGB(0,0,0))
Box(232, 25, 98, 98, RGB(0,0,0))
Box(335, 25, 98, 98, RGB(0,0,0))
Box(26, 128, 98, 98, RGB(0,0,0))
Box(129, 128, 98, 98, RGB(0,0,0))
Box(232, 128, 98, 98, RGB(0,0,0))
Box(335, 128, 98, 98, RGB(0,0,0))
Box(26, 231, 98, 98, RGB(0,0,0))
Box(129, 231, 98, 98, RGB(0,0,0))
Box(232, 231, 98, 98, RGB(0,0,0))
Box(335, 231, 98, 98, RGB(0,0,0))
Box(26, 334, 98, 98, RGB(0,0,0))
Box(129, 334, 98, 98, RGB(0,0,0))
Box(232, 334, 98, 98, RGB(0,0,0))
Box(335, 334, 98, 98, RGB(0,0,0))
Box(26, 465, 98, 98, RGB(0,0,0))
Box(129, 465, 98, 98, RGB(0,0,0))
Box(232, 465, 98, 98, RGB(0,0,0))
Box(335, 465, 98, 98, RGB(0,0,0))
Box(26, 568, 98, 98, RGB(0,0,0))
Box(129, 568, 98, 98, RGB(0,0,0))
Box(232, 568, 98, 98, RGB(0,0,0))
Box(335, 568, 98, 98, RGB(0,0,0))
Box(26, 671, 98, 98, RGB(0,0,0))
Box(129, 671, 98, 98, RGB(0,0,0))
Box(232, 671, 98, 98, RGB(0,0,0))
Box(335, 671, 98, 98, RGB(0,0,0))
Box(26, 774, 98, 98, RGB(0,0,0))
Box(129, 774, 98, 98, RGB(0,0,0))
Box(232, 774, 98, 98, RGB(0,0,0))
Box(335, 774, 98, 98, RGB(0,0,0))
Box(466+x, 25, 98, 98, RGB(0,0,0))
Box(569+x, 25, 98, 98, RGB(0,0,0))
Box(672+x, 25, 98, 98, RGB(0,0,0))
Box(775+x, 25, 98, 98, RGB(0,0,0))
Box(466+x, 128, 98, 98, RGB(0,0,0))
Box(569+x, 128, 98, 98, RGB(0,0,0))
Box(672+x, 128, 98, 98, RGB(0,0,0))
Box(775+x, 128, 98, 98, RGB(0,0,0))
Box(466+x, 231, 98, 98, RGB(0,0,0))
Box(569+x, 231, 98, 98, RGB(0,0,0))
Box(672+x, 231, 98, 98, RGB(0,0,0))
Box(775+x, 231, 98, 98, RGB(0,0,0))
Box(466+x, 334, 98, 98, RGB(0,0,0))
Box(569+x, 334, 98, 98, RGB(0,0,0))
Box(672+x, 334, 98, 98, RGB(0,0,0))
Box(775+x, 334, 98, 98, RGB(0,0,0))
Box(466+x, 465, 98, 98, RGB(0,0,0))
Box(569+x, 465, 98, 98, RGB(0,0,0))
Box(672+x, 465, 98, 98, RGB(0,0,0))
Box(775+x, 465, 98, 98, RGB(0,0,0))
Box(466+x, 568, 98, 98, RGB(0,0,0))
Box(569+x, 568, 98, 98, RGB(0,0,0))
Box(672+x, 568, 98, 98, RGB(0,0,0))
Box(775+x, 568, 98, 98, RGB(0,0,0))
Box(466+x, 671, 98, 98, RGB(0,0,0))
Box(569+x, 671, 98, 98, RGB(0,0,0))
Box(672+x, 671, 98, 98, RGB(0,0,0))
Box(775+x, 671, 98, 98, RGB(0,0,0))
Box(466+x, 774, 98, 98, RGB(0,0,0))
Box(569+x, 774, 98, 98, RGB(0,0,0))
Box(672+x, 774, 98, 98, RGB(0,0,0))
Box(775+x, 774, 98, 98, RGB(0,0,0))
DrawingMode(#PB_2DDrawing_Transparent)
BackColor(RGB(0,155,155))
FrontColor(RGB(0,0,0))
DrawText(445, 20, "1",RGB(255,255,255))
DrawText(445, 460, "2",RGB(255,255,255))
DrawText(905, 20, "3",RGB(255,255,255))
DrawText(905, 460, "4",RGB(255,255,255))
If OpenGLGadget(0,26,25,98,98,#PB_OpenGL_Keyboard)
If Event = #PB_Event_LeftClick
Circle(75,74,35,RGB(245,218,129))
EndIf
EndIf
StopDrawing()
EndIf
EndIf
If CreateMenu(0, WindowID(0))
MenuTitle("Fichier")
MenuItem(1, "Nouveau" +Chr(9)+"Ctrl+N")
MenuItem(2, "Fermer" +Chr(9)+"Ctrl+F")
EndIf
ImageGadget(0, 0, 0, 0, 0, ImageID(0))
Repeat
Select WaitWindowEvent()
Case #PB_Event_Menu
Select EventMenu()
Case 2
Quit = 1
EndSelect
Case #PB_Event_CloseWindow
Quit = 1
EndSelect
Until Quit = 1
EndIf
End