Whit3 Posted June 5, 2014 Posted June 5, 2014 That's an idiot question. Problem when i use this code : dxDrawPartialCircle(rx/7.75, ry/1.1949, 108,tocolor(0, 11, 255, 255), 3,nil,3.60) I would like to use my color .. function dxDrawPartialCircle(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) local function clamp(val, lower, upper) if (lower > upper) then lower, upper = upper, lower end return math.max(lower, math.min(upper, val)) end radius = radius or 50 width = width or 5 startAngle = clamp(startAngle or 0, 0, 360) endAngle = clamp(endAngle or 360, 0, 360) angleAmount = angleAmount or 1 color = color or tocolor(0, 11, 255, 255) postGUI = postGUI or false if (endAngle < startAngle) then local temp = endAngle endaAngle = startAngle startAngle = temp end for i=startAngle,endAngle,angleAmount do local _i = i*(math.pi/180) dxDrawLine(math.cos(_i)*(radius-width)+posX, math.sin(_i)*(radius-width)+posY, math.cos(_i)*(radius+width)+posX, math.sin(_i)*(radius+width)+posY, color, width, postGUI) end return true end
Max+ Posted June 5, 2014 Posted June 5, 2014 i think he mean he want to use his own color , to the script , change the color to his own one ,
Moderators Citizen Posted June 5, 2014 Moderators Posted June 5, 2014 change the values in the tocolor() function: tocolor(red, green, blue, alpha) Example: tocolor(255, 0, 0, 255) Will draw your circle in full red (so no green and no blue in that color).
Dealman Posted June 5, 2014 Posted June 5, 2014 local cR, cG, cB, cA = 255, 0, 0, 255 local theColour = tocolor(cR, cG, cB, cA) Use this and you can change the colour while it's rendering. Simply replace tocolor(x, x, x, x) with theColour. Change as you please
Whit3 Posted June 5, 2014 Author Posted June 5, 2014 no, i want use 2 type of dxDrawPartialCircle with different color dxDrawPartialCircle(rx/7.75, ry/1.1949, 108,tocolor(0, 11, 255, 255), 3,nil,3.60)--1 ) dxDrawPartialCircle(rx/7.75, ry/1.1949, 118, tocolor(255, 0, 0, 255),3,nil,3.60)--2 ) but it don't work
xXMADEXx Posted June 5, 2014 Posted June 5, 2014 That's because the arguments are: function dxDrawPartialCircle(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) You're missing a ton of arguments...
Whit3 Posted June 6, 2014 Author Posted June 6, 2014 That's because the arguments are: function dxDrawPartialCircle(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) You're missing a ton of arguments... Ah yes, solved thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now