peter
21-02-2014, 01:45
Hi,
Canvas_Line test.
I am missing thickness for the line. But on the other hand, I think it won't much used.
Anyhow, here are some canvas - lines.
Uses "ui"
#INCLUDE "api.inc"
DWord hwnd, hdc
hwnd = Canvas_Window("api_app",xMid(640),yMid(480),640,480)
Canvas_Attach(hwnd,0,%TRUE)
hdc = Canvas_GetDC()
Canvas_Font "arial",16, %CANVAS_FONTSTYLE_BOLD
Long dir, x, y, love, col, j, fx
Single wz, r
love = LoadImage "bmp/jeses.bmp",2
While IsWindow(hwnd) And KeyDown(27)=0
Canvas_Clear 0
col = Rgb(Rnd(64,255),Rnd(64,255),Rnd(64,255))
For j=0 To 39
Canvas_Line((0,j*12), (640,480-j*12), col)
Canvas_Line((j*16,0), (640-j*16,480), col)
Next
DrawText 256,10,"NO JOKE!",&HFFFFFF
If dir=0 Then x +=1
If dir=1 Then x -=1
If x=380 Then dir=1
If x=0 Then dir=0
DrawImage love, x+Sin(r)*10,176+Cos(r)*8,256,128,fx
wz +=.1
If wz >=2 Then
wz=0
fx +=1
If fx=2 Then fx=0
End If
r +=.1
If r >=360 Then r=0
Canvas_Redraw
Sleep 10
Wend
FreeImages
Canvas_Window End
Canvas_Line test.
I am missing thickness for the line. But on the other hand, I think it won't much used.
Anyhow, here are some canvas - lines.
Uses "ui"
#INCLUDE "api.inc"
DWord hwnd, hdc
hwnd = Canvas_Window("api_app",xMid(640),yMid(480),640,480)
Canvas_Attach(hwnd,0,%TRUE)
hdc = Canvas_GetDC()
Canvas_Font "arial",16, %CANVAS_FONTSTYLE_BOLD
Long dir, x, y, love, col, j, fx
Single wz, r
love = LoadImage "bmp/jeses.bmp",2
While IsWindow(hwnd) And KeyDown(27)=0
Canvas_Clear 0
col = Rgb(Rnd(64,255),Rnd(64,255),Rnd(64,255))
For j=0 To 39
Canvas_Line((0,j*12), (640,480-j*12), col)
Canvas_Line((j*16,0), (640-j*16,480), col)
Next
DrawText 256,10,"NO JOKE!",&HFFFFFF
If dir=0 Then x +=1
If dir=1 Then x -=1
If x=380 Then dir=1
If x=0 Then dir=0
DrawImage love, x+Sin(r)*10,176+Cos(r)*8,256,128,fx
wz +=.1
If wz >=2 Then
wz=0
fx +=1
If fx=2 Then fx=0
End If
r +=.1
If r >=360 Then r=0
Canvas_Redraw
Sleep 10
Wend
FreeImages
Canvas_Window End