Jump to content

dxDrawCircle


mehmet

Recommended Posts

Hello guys,

 I use dxdrawcircle function, how do I draw a circle? and how to make a circle transparent? shader?efed35-20170505160427_1.jpg

function dxDrawRoundedRectangle(x, y, rx, ry, color, radius)
    rx = rx - radius * 2
    ry = ry - radius * 2
    x = x + radius
    y = y + radius

    if (rx >= 0) and (ry >= 0) then
        dxDrawRectangle(x, y, rx, ry, color)
        dxDrawRectangle(x, y - radius, rx, radius, color)
        dxDrawRectangle(x, y + ry, rx, radius, color)
        dxDrawRectangle(x - radius, y, radius, ry, color)
        dxDrawRectangle(x + rx, y, radius, ry, color)

        dxDrawCircle(x, y, radius, 180, 270, color, color, 7)
        dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7)
        dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7)
        dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7)
    end
end


addEventHandler( "onClientRender", root,
    function()
        dxDrawRoundedRectangle(350, 50, 100, 100, tocolor(0, 255, 0, 255), 20)
    end
)

 

Edited by mehmet
Link to comment
2 minutes ago, Overkillz said:

Read carefully the function. It allows you to leave the middle empty.

Quote

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • startAngle: An integer representing the angle of the first point of the circle.
  • stopAngle: An integer representing the angle of the last point of the circle.
  • theColor: An integer of the hex color, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).
  • theCenterColor: An integer of the hex color, produced using tocolor or 0xAARRGGBB (AA = alpha, RR = red, GG = green, BB = blue).
  • segments: An integer ranging from 3-1024 representing how many triangles are used to form the circle, more segments = smoother circle. Note: using lots of segments may cause lag.
  • ratio: Ratio between width and height, e.g: 2 would mean that the width of the circle is 2 times the height.
  • postGUI: A bool representing whether the circle should be drawn on top of or behind any ingame GUI (rendered by CEGUI).

 

where?

Link to comment
15 minutes ago, mehmet said:

 

where?

Well, mybad. I have realized that this function has been updated. Previously there was the same function but made with dxDrawLines. It used to be a bit blurred but u could reach what are u looking for. Probabilly u will need to work with shaders or dxDrawImage/dxDrawImageSection

Link to comment
2 minutes ago, Overkillz said:

Well, mybad. I have realized that this function has been updated. Previously there was the same function but made with dxDrawLines. It used to be a bit blurred but u could reach what are u looking for. Probabilly u will need to work with shaders or dxDrawImage/dxDrawImageSection

for example, what is a Shader? circle.fx? https://wiki.multitheftauto.com/wiki/Shader_examples
and how to work with them?

3 minutes ago, Dimos7 said:

Put center color invsible

dxDrawCircle(950, 500, 250, 360, 0, tocolor(0, 0, 0, 1000),invsible, 100)

so?

Link to comment
  • Moderators
24 minutes ago, mehmet said:

with this Shader, can I make the center empty? or can I give the image an effect?

To cut out stuff: nightly.multitheftauto.com/files/shaders/shader_hud_mask.zip

But as @DNL291 said, an image might be easier. (also for the effect)

 

 

 

 

 

 

 

Edited by IIYAMA
Link to comment

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