Hi !
Could you help me with this code. The canvas grid is not displayed correctly (refresh pb with the pixmap ?). where is my mistake. (Should be easy to find...). Thanks
Could you help me with this code. The canvas grid is not displayed correctly (refresh pb with the pixmap ?). where is my mistake. (Should be easy to find...). Thanks
Strict Global Win2:TGadget = CreateWindow("Sélection de map...",(GadgetWidth(Desktop())-540)/2,(GadgetHeight(Desktop())-650)/2,540,650,Null,WINDOW_MENU|WINDOW_TITLEBAR|WINDOW_HIDDEN) Global Panel_choix_map : Tgadget = CreatePanel (0,0,700,40, Win2) Global Canvas2:TGadget= CreateCanvas(10,50,512,512,Win2) ' + 30 en y Global tiles : TPixmap = CreatePixmap (512 , 512 , PF_BGRA8888) ' ------------------------------------------------------------------------------------------- Function Afficher_grille() Local x Local y Local r SetColor 50,50,50 For x=0 To 512 Step 32 DrawLine x, 0, x, 512 Next r = 0 For y=0 To 512 - 32 Step 32 DrawLine 0, y, 512, y DrawText String (r), 10, y + 8 r = r + 1 Next End Function ' ------------------------------------------------------------------------------------------- Function Fenetre_choix_tile() ShowGadget Win2 Global Timer:TTimer = CreateTimer(60) While WaitEvent() Select EventID() Case EVENT_TIMERTICK SetGraphics CanvasGraphics(Canvas2) Cls SetColor 255,255,255 DrawPixmap tiles, 0,0 Afficher_grille() Flip Case EVENT_WINDOWCLOSE Exit End Select Wend HideGadget Win2 End Function Fenetre_choix_tile()
