Jump to content

idiot question


Whit3

Recommended Posts

Posted

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 

  • Moderators
Posted

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).

Posted
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

Posted

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

Posted

That's because the arguments are:

function dxDrawPartialCircle(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) 

You're missing a ton of arguments...

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...