This function draws a ring by using [https://wiki.multitheftauto.com/wiki/DxDrawLine<span style="color: blue">dx-lines</span>]. It can also draw an incomplete ring. This is a client-side only function and it should be used in conjunction with [[onClientRender]] in order to display continuously.

+

This function draws a ring by using [[dxDrawLine|dx-lines]]. It can also draw an incomplete ring. This is a client-side only function and it should be used in conjunction with [[onClientRender]] in order to display continuously.

==Syntax==

==Syntax==

Latest revision as of 01:02, 21 February 2019

This function draws a ring by using dx-lines. It can also draw an incomplete ring. This is a client-side only function and it should be used in conjunction with onClientRender in order to display continuously.

Required Arguments

posX: An integer representing the absolute X position of the ring center, represented by pixels on the screen.

posY: An integer representing the absolute Y position of the ring center, represented by pixels on the screen.

radius: An integer representing the radius scale of the ring that is being drawn.

width: An integer representing the width of the ring.

startAngle: An integer representing the angle which the ring will start to being drawn.

amount: An integer/float representing how many angles the ring will draw. Using 1 will draw a full ring, while 0.5 will draw a 180 degree ring and so on. If parameter absoluteAmount is used, you can use degree values from 0-360 instead of 0-1. By default it uses float values from 0 to 1.

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.

postGUI: A bool representing whether the line should be drawn on top of or behind any ingame GUI.

absoluteAmount: A bool representing whether the parameter amount should use degree values or not.

anglesPerLine: An integer representing how many degrees each line will represent. This is 1 by default, so a full ring will draw 360 lines. If 2 is used, 180 lines will draw a full ring and so on. Higher values will increase performance but ring smoothness will decrease. If you use too high values, you can get a dashed ring effect.

Returns

Returns an integer representing how many lines are being used to draw the ring if the operation was successful, false otherwise.

Examples

Click to collapse [-]

Example1

This example draws a health ring which changes it's color according to player's health value.
It also shows how many lines are being used to draw the background ring and the health ring. And shows the player's health value inside the ring.