Jump to content

Retângulo em relativo


Recommended Posts

local screenW, screenH = guiGetScreenSize()
dxDrawRectangle(screenW * 0.4319, screenH * 0.0898, screenW * 0.1464, screenH * 0.0195, tocolor(0, 0, 0, 39), false) 
dxDrawRectangle(screenW * 0.4319, screenH * 0.0898, screenW*(conta1*2), screenH * 0.0195, tocolor(251, 165, 0, 254), false) -- quadrado que varia do valor de conta1

Bom, o conta1 ele varia de 0 até 100, eu queria saber como posso deixar o quadrado certo em todas as resoluções

Link to comment
  • Other Languages Moderators

Ta ae:

dxDrawRectangle (screenW * 0.4319, screenH * 0.0898, screenW * 0.1464, screenH * 0.0195, tocolor(0, 0, 0, 39), false)
dxDrawRectangle (screenW * 0.4319, screenH * 0.0898, screenW * 0.1464 * (conta1/100), screenH * 0.0195, tocolor(251, 165, 0, 254), false) -- retângulo que varia de acordo com o valor de conta1
dxDrawText (conta1, screenW * 0.4319, screenH * 0.0898, screenW * 0.5783, screenH * 0.1093, tocolor(0, 255, 0, 255), 1, 1, "default", "center", "center")

Botei esse drawText só pra testar o valor de conta1.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...