iiv03 Posted August 26, 2019 Share Posted August 26, 2019 (edited) سلأم عليكم معي مشكله ب كود هنا لما اسوي الريكتآنجل تتغير آرقام alpha يعني مقصود من 0-255 -> 255-0 يعني كل ثانيه يسوي كذا ومايوقف كود حقي local tick = getTickCount() function test() local progress = math.min((getTickCount()-tick)/1500*1,1) dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, 255*progress), false) end addEventHandler("onClientRender", root, test) Edited August 26, 2019 by xFabel Link to comment
#\_oskar_/# Posted August 26, 2019 Share Posted August 26, 2019 math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح or math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات ---- اذا في شئ ثاني تفضل قوله Link to comment
iiv03 Posted August 26, 2019 Author Share Posted August 26, 2019 On 26/08/2019 at 18:28, #\_oskar_/# said: math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح or math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات ---- اذا في شئ ثاني تفضل قوله Expand آلحين 0-255 وتعيد نفس شي كيف اخليه من 0-255 لين 255-0 يعني العكس Link to comment
iiv03 Posted August 26, 2019 Author Share Posted August 26, 2019 On 26/08/2019 at 18:44, #\_oskar_/# said: مافهمت Expand آول شي يعني تفتح تسوي حركه مثل كذا بعدين تنغلق وحده تسوي حركه كمان فهمت ول لسآ؟ Link to comment
nxFairlywell Posted August 26, 2019 Share Posted August 26, 2019 On 26/08/2019 at 18:52, xFabel said: آول شي يعني تفتح تسوي حركه مثل كذا بعدين تنغلق وحده تسوي حركه كمان فهمت ول لسآ؟ Expand يعني أول مايوصل 255 يرجع يعد عكس لين 0 ؟ Link to comment
iiv03 Posted August 26, 2019 Author Share Posted August 26, 2019 On 26/08/2019 at 21:27, NX_CI said: يعني أول مايوصل 255 يرجع يعد عكس لين 0 ؟ Expand كفو عليك كذا قصدي ومايوقف Link to comment
nxFairlywell Posted August 26, 2019 Share Posted August 26, 2019 local rectAlpha = 0; local state = "up"; function test() if state == "up" then rectAlpha=rectAlpha+1 end if state == "down" then rectAlpha=rectAlpha-1 end if rectAlpha == 255 then state = "down" elseif rectAlpha == 0 then state = "up" end dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, rectAlpha), false) end addEventHandler("onClientRender", root, test) 1 Link to comment
iiv03 Posted August 26, 2019 Author Share Posted August 26, 2019 On 26/08/2019 at 22:17, NX_CI said: local rectAlpha = 0; local state = "up"; function test() if state == "up" then rectAlpha=rectAlpha+1 end if state == "down" then rectAlpha=rectAlpha-1 end if rectAlpha == 255 then state = "down" elseif rectAlpha == 0 then state = "up" end dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, rectAlpha), false) end addEventHandler("onClientRender", root, test) Expand مشككككككككور ي حبيب Link to comment
N3xT Posted August 27, 2019 Share Posted August 27, 2019 function test() local alpha = math.sin ( getTickCount () / 200 ) dxDrawRectangle ( 416, 174, 498, 373, tocolor(0, 0, 0, 255*alpha), false ) end addEventHandler("onClientRender", root, test) 1 1 Link to comment
Master_MTA Posted August 29, 2019 Share Posted August 29, 2019 On 27/08/2019 at 09:07, N3xT said: function test() local alpha = math.sin ( getTickCount () / 200 ) dxDrawRectangle ( 416, 174, 498, 373, tocolor(0, 0, 0, 255*alpha), false ) end addEventHandler("onClientRender", root, test) Expand اخص اللي يفهم رياضيات 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