Reallife404 Posted January 4, 2016 Posted January 4, 2016 شباب كيف اعمل dxDrawRectangle دائري يكون شكله مثل الدائره
shwaeki Posted January 4, 2016 Posted January 4, 2016 https://wiki.multitheftauto.com/wiki/DxDrawCircle
shwaeki Posted January 4, 2016 Posted January 4, 2016 ادخل على الرابط هاذا هو الكود يلي يساوي دائرة مثل هاي https://wiki.multitheftauto.com/wiki/Fi ... xample.png و الكود هاد انسخة و حطة في ملف كلنت function dxDrawCircle( posX, posY, radius, width, angleAmount, startAngle, stopAngle, color, postGUI ) if ( type( posX ) ~= "number" ) or ( type( posY ) ~= "number" ) then return false end 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 = type( radius ) == "number" and radius or 50 width = type( width ) == "number" and width or 5 angleAmount = type( angleAmount ) == "number" and angleAmount or 1 startAngle = clamp( type( startAngle ) == "number" and startAngle or 0, 0, 360 ) stopAngle = clamp( type( stopAngle ) == "number" and stopAngle or 360, 0, 360 ) color = color or tocolor( 255, 255, 255, 200 ) postGUI = type( postGUI ) == "boolean" and postGUI or false if ( stopAngle < startAngle ) then local tempAngle = stopAngle stopAngle = startAngle startAngle = tempAngle end for i = startAngle, stopAngle, angleAmount do local startX = math.cos( math.rad( i ) ) * ( radius - width ) local startY = math.sin( math.rad( i ) ) * ( radius - width ) local endX = math.cos( math.rad( i ) ) * ( radius + width ) local endY = math.sin( math.rad( i ) ) * ( radius + width ) dxDrawLine( startX + posX, startY + posY, endX + posX, endY + posY, color, width, postGUI ) end return true end و هاد مثال عشين تساوي دائرة addEventHandler( "onClientRender", root, function( ) -- We're starting to draw the circle at 0° which means that the first point of the arc is ( 200+50 | 200 ) -- Therefore the last point is ( 200 | 200+50 ). > Our arc is the "lower right" quarter of the circle. dxDrawCircle( 200, 200, 50, 5, 1, 0, 90 ) end )
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