Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[system.bindMouse("Thewav",true)
- players={}
- players["Thewav"]=
- {
- firstPoint=nil
- }
- id=1
- function eventMouse(name,xCursor,yCursor)
- if(not players[name].firstPoint)then
- tfm.exec.chatMessage("First Point set:"..xCursor.."-"..yCursor,name)
- players[name].firstPoint={x=xCursor,y=yCursor}
- else
- drawLine(players[name].firstPoint,{x=xCursor,y=yCursor},1)
- players[name].firstPoint = nil
- end
- end
- --]]
- function drawLine(point1,point2,res)
- a=(point1.y-point2.y)/(point1.x-point2.x)
- b=point1.y-a*point1.x
- if(point1.x>point2.x) then point1,point2=point2,point1 end
- for i=point1.x,point2.x,res do
- ui.addTextArea(id,"",nil,i,a*i+b, 1, 1, "0xF20F0F", "0xF20F0F")
- id=id+1
- end
- end
- function drawCircle(point1,point2)
- r=math.sqrt(math.pow((point1.x-point2.x),2)+math.pow((point1.y-point2.y),2))
- res=1-r*math.pow(10,-2)
- if(res<0.1)then res =0.1 end
- for i=0,2*math.pi,res do
- ui.addTextArea(id,"",nil,point1.x+r*math.cos(i),point1.y+r*math.sin(i), 1, 1, "0xF20F0F", "0xF20F0F")
- id=id+1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment