Thanks guys, this was an image of what it should look like.
Code: Select all
; 0,0,0,0,0,0,0,0,0,0,0,0,0
; 0,1,0,0,0,0,0,0,0,0,0,1,0
; 0,1,1,0,0,0,0,0,0,0,1,1,0
; 0,1,1,1,0,0,0,0,0,1,1,1,0
; 0,1,1,1,1,0,0,0,1,1,1,1,0
; 0,1,1,1,1,1,0,1,1,1,1,1,0
; 0,1,1,1,1,1,1,1,1,1,1,1,0
; 0,1,1,1,1,1,1,1,1,1,1,1,0
; 0,1,1,1,1,1,1,1,1,1,1,1,0
; 0,0,1,1,1,1,1,1,1,1,1,0,0
; 0,0,0,1,1,1,1,1,1,1,0,0,0
; 0,0,0,0,1,1,1,1,1,0,0,0,0
; 0,0,0,0,0,1,1,1,0,0,0,0,0
; 0,0,0,0,0,0,1,0,0,0,0,0,0
; 0,0,0,0,0,0,0,0,0,0,0,0,0
size = 60
d=5
Procedure.b Draw_Arrow( x.l, y.l, size.a, direction.a, style.b = 1, FrameColor = $ff000000, Color = $ffffffff )
Protected x1.l, y1.l
If Style
If Style =- 1
; ProcedureReturn Arrow( x, y, Size, Direction, Color )
Else
For x1 = 0 To size
For y1 = x1 To size-x1
If direction = 0 ; left
Box(x+size/2-x1*Style,y+y1,Style,1, FrameColor)
EndIf
If direction = 1 ; up
Box(x+y1,y+size/2-x1*Style,1,Style, FrameColor)
EndIf
If direction = 2 ; right
Box(x+size/2+x1*Style,y+y1,Style,1, FrameColor)
;Box(x-size/2+x1,y+y1,1,1, FrameColor)
EndIf
If direction = 3 ; down
Box(x+y1,y+size/2+x1*Style,1,Style, FrameColor)
;Box(x+y1,y-size/2+x1,1,1, FrameColor)
EndIf
Next
Next
For x1 = 1 To size-1
For y1 = x1+1 To size-1-x1
If direction = 0 ; left
Box(x+size/2-x1*Style,y+y1,Style,1, Color)
EndIf
If direction = 1 ; up
Box(x+y1,y+size/2-x1*Style,1,Style, Color)
EndIf
If direction = 2 ; right
Box(x+size/2+x1*Style,y+y1,Style,1, Color)
;Box(x-size/2+x1,y+y1,1,1, Color)
EndIf
If direction = 3 ; down
Box(x+y1,y+size/2+x1*Style,1,Style, Color)
;Box(x+y1,y-size/2+x1,1,1, Color)
EndIf
Next
Next
EndIf
EndIf
EndProcedure
If OpenWindow(0, 0, 0, 400, 400, "2DDrawing Example DPI", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If CreateImage(0, 400, 400, 24, $BFBFEC) And StartDrawing(ImageOutput(0))
SetOrigin(size/2,size/2)
x=0
y=size*2+d
Draw_Arrow(x,y, size, 0,2)
x=size*2+d*2+size*2
Draw_Arrow(x,y, size, 2,2)
y=0
x=size*2+d
Draw_Arrow(x,y, size, 1)
y=size*2+d*2+size*2
Draw_Arrow(x,y, size, 3)
StopDrawing()
ImageGadget(0, 0, 0, 200, 200, ImageID(0))
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf