mehmet Posted January 22, 2019 Share Posted January 22, 2019 (edited) Hello guys, I use dxdrawcircle function, how do I draw a circle? and how to make a circle transparent? shader? 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 January 22, 2019 by mehmet Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 (edited) Sorry about my stupidity, I got it. Topic closed Edited January 22, 2019 by mehmet Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 But I do not understand. how to make empty inside Link to comment
Overkillz Posted January 22, 2019 Share Posted January 22, 2019 Just create more circles leaving some spaces between them ... Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 1 minute ago, Overkillz said: Just create more circles leaving some spaces between them ... But in the center nothing should be Link to comment
Overkillz Posted January 22, 2019 Share Posted January 22, 2019 5 minutes ago, mehmet said: But in the center nothing should be Read carefully the function. It allows you to leave the middle empty. Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 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
Overkillz Posted January 22, 2019 Share Posted January 22, 2019 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
Dimos7 Posted January 22, 2019 Share Posted January 22, 2019 Put center color invsible Link to comment
Overkillz Posted January 22, 2019 Share Posted January 22, 2019 Just now, Dimos7 said: Put center color invsible It makes a fade effect. 1 Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 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
Dimos7 Posted January 22, 2019 Share Posted January 22, 2019 (edited) 1 hour ago, mehmet said: for example, what is a Shader? circle.fx? https://wiki.multitheftauto.com/wiki/Shader_examples and how to work with them? dxDrawCircle(950, 500, 250, 360, 0, tocolor(0, 0, 0, 1000),invsible, 100) so? dxDrawCircle(950, 500, 250, 360, 0, tocolor(0, 0, 0, 255), tocolor (0, 0, 0, 0),100) Edited January 22, 2019 by Dimos7 Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 6 hours ago, Dimos7 said: dxDrawCircle(950, 500, 250, 360, 0, tocolor(0, 0, 0, 255), tocolor (0, 0, 0, 0),100) It makes a fade effect. I need the middle empty Link to comment
Dimos7 Posted January 22, 2019 Share Posted January 22, 2019 Make more than one and make be in center of and make it Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 5 minutes ago, Dimos7 said: Make more than one and make be in center of and make it I didn't understand. show me an example? you speak Russian?)) Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 in the center of the circle transparent do? Link to comment
DNL291 Posted January 22, 2019 Share Posted January 22, 2019 I would do that using image. 1 Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 2 minutes ago, DNL291 said: I would do that using image. and how do I then give the image effect? Link to comment
Moderators IIYAMA Posted January 22, 2019 Moderators Share Posted January 22, 2019 You might be able to do that with a mask shader: https://wiki.multitheftauto.com/wiki/Shader_examples#Hud_mask 1 Link to comment
mehmet Posted January 22, 2019 Author Share Posted January 22, 2019 (edited) 3 minutes ago, IIYAMA said: You might be able to do that with a mask shader: https://wiki.multitheftauto.com/wiki/Shader_examples#Hud_mask with this Shader, can I make the center empty? or can I give the image an effect? Edited January 22, 2019 by mehmet Link to comment
Moderators IIYAMA Posted January 22, 2019 Moderators Share Posted January 22, 2019 (edited) 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 January 22, 2019 by IIYAMA Link to comment
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