MRXBBC Posted November 25, 2019 Share Posted November 25, 2019 (edited) To fazendo um sistema que pra quando o player clica no botão o dxDrawRectangle cresce e se ele clicar de novo o Retângulo diminui até sumir, como posso fazer o mesmo? meu codigo: local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local estado = false cor = {} scale = {} tick = getTickCount() function draw_Login() local between = interpolateBetween(0, 0, 0, x*600, 0, 0, ((getTickCount() - tick) / 2000), "SineCurve") scale[1] = 75 scale[2] = 55 dxDrawRectangle(x*815, y*45, between/5, y*30, tocolor(100, 0, 0, 200), false) end addEventHandler("onClientRender", root, draw_Login) function Click( button, state ) end addEventHandler("onClientClick", getRootElement(),click) Edited November 25, 2019 by MRXBBC Link to comment
Other Languages Moderators Lord Henry Posted November 26, 2019 Other Languages Moderators Share Posted November 26, 2019 Faça o dxDraw do retângulo usando posições e escalas de variáveis. Dai ao clicar vc apenas altera o valor dessas variáveis. 1 Link to comment
DNL291 Posted November 27, 2019 Share Posted November 27, 2019 Você pode usar a função útil https://wiki.multitheftauto.com/wiki/DxDrawLoading e fazer as modificações necessárias, daí o resto fica a alternância entre cada clique. 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