Jump to content

Help - Filling Labels


manve1

Recommended Posts

Posted

I am trying to make a script which set one label to a random number between 1 and 90, but when i set it using math.random it sets it only to 1 number, and i want like to expand it, and have it like filled fully, till the end of the label, not just one number

local rp = guiCreateWindow( 0.1, 0.15, 0.8, 0.75, '', true ) 
local troll = guiCreateLabel( 0.05, 0.05, 0.9, 0.05, '', true, rp) 
  
setTimer( 
function() 
guiSetText( troll, math.random( 1, 90 ) ) 
end, 5000, 1 
) 

Edit: would it be possible to make all numbers different?

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

You mean keep adding numbers to what is already on the label?

guiSetText( troll, guiGetText( troll ) .. tostring( math.random( 90 ) ) ); 

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Not adding to the label numbers, but like if i created a label at a wide of '0.8' i want to fill all of it in but with random numbers till 90

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

He already knows that Teteomar, he wants to fill all the label with random numbers.

@Manve: Maybe you can use this function:

guiLabelGetTextExtent 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...