DrawLine Thickness

Monkey Forums/Monkey Programming/DrawLine Thickness

hardcoal(Posted 2011) [#1]
I guess its not possible but still i will ask.
is it possible to change the Line thickness On Draw?


hardcoal(Posted 2011) [#2]
heres a function for line with thickness ive made





Jesse(Posted 2011) [#3]
sorry hardcoal but I didn't like how it was
added rounded ends option and centered:

Function DrawLine_PL:Void(XPos#,YPos#,XPos2#,YPos2#,Thickness#=3,roundedEnds:Int=False)
	Local vx:Float = Xpos2 - Xpos
	Local vy:Float = Ypos2 - Ypos
	Local Angle:Float=ATan2(vy,vx)
	Local c:Float = Cos(Angle)
	Local s:Float = Sin(Angle)
	Local LineLength:Float = c*vx+s*vy
	Local cl:Float = LineLength*c
	Local sl:Float = LineLength*s
	Local r:Float = Thickness/2.0
	Local sr:Float = s*r
	Local cr:Float = c*r
	'Left Top Coords
	Coords[0]=XPos+sr
	Coords[1]=YPos-cr
	'Right Top Coords
	Coords[2]=cl+XPos+sr
	Coords[3]=sl+YPos-cr
	'Right Down Coords
	Coords[4]=cl-sr+XPos
	Coords[5]=sl+cr+YPos
	'Left Down Coords
	Coords[6]=XPos-sr
	Coords[7]=YPos+cr
	DrawPoly(Coords)	
	If roundedEnds = True	
		DrawCircle(XPos,YPos,r)
		DrawCircle(XPos2,YPos2,r)
	Endif
End Function



hardcoal(Posted 2011) [#4]
Im glad you improved it.

now im going to make the same but for poly outline.

A Silly quastion.
when you put Void like in DrawLine_PL:Void

what does it mean?
that there is no return answer from the function?


Jesse(Posted 2011) [#5]
with void under strict you don't have to return a value for methods and function otherwise a return is required.


hardcoal(Posted 2011) [#6]
got it!