Omar Mohamed Posted May 21, 2017 Share Posted May 21, 2017 سلام عليكم ورحمة الله وبركاتة ابي كود تحريك لوحة او صورة من يمين الي شمال مع شرحة وشكرا Link to comment
MR.StoRm Posted May 21, 2017 Share Posted May 21, 2017 TimeGuiSetRightC = { } function guiMoveRightToCenter(gui) if getElementData(gui,"HelhGui") == false then setElementData(gui,"HelhGui",true) local s1,s2=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (s1-w1)/2,(s2-w2)/2 guiSetPosition(gui,-x,y,false) TimeGuiSetRightC[gui] = setTimer(guiMoveRightToCenter,50,0,gui) end local a,b=guiGetScreenSize() local w1,w2=guiGetSize(gui,false) local x,y = (a-w1)/2,(b-w2)/2 local x1,y1 = guiGetPosition ( gui, false) if (x1 >= x) then killTimer(TimeGuiSetRightC[gui]) setElementData(gui,"HelhGui",false) else guiSetPosition(gui,x1+10,y,false) end end By : Booo Link to comment
iMr.WiFi..! Posted May 21, 2017 Share Posted May 21, 2017 (edited) ليش كل هذا , تقدر تختصره بهذا function guiMoveRtoC( gui ) local w,h = guiGetSize(gui); local _,y = guiGetPosition(gui); local scW,scH = guiGetScreenSize(); local cpos = (w-scW)/2; local x = interpolateBetween(0,0,0,cpos,0,0,(getTickCount()-MyCount)/1000,"OutQuad") guiSetPosition(gui,x,y,false) MyCount = getTickCount() addEventHandler("onClientRender",root,guiMoveRtoC) if x == cpos then removeEventHandler("onClientRender",root,guiMoveRtoC) end end Edited May 21, 2017 by iMr.WiFi..! 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