ID:160819
 
Hey,
Now i think this might be a little hard for me to explain but ill try the best i can. What i want to learn is how to make a label with the statistics of the User inside it, i worked out one way which is by using:
mob/Login(){src << ouput("Stats go here..","Label1")}


But i was wondering if there is a more appropiate way which is easier to actually layout several stats..together in one label

-SubZeroChaos
If you do it like that, it will only output it once, therefore they will never be updated.
If you want to display several stats, a grid would be better to use.

Hey, Andre, I see that you're being active here in the forum. :)
In response to Andre-g1
Well guyz what ive done is:

I used the output method and made a proc which updates all my labels in side this Parent label, so everytime a stat changing action has taken place ill call this proc to update everything

-SubZeroChaos
In response to SubZeroChaos
If you want to put several stats, as Jemai said, a grid is better.

However if you're still with the idea of keeping the labels, they seem fine like that to me. ( With the proc updating them )
In response to Andre-g1
Yeah thanx guyz but you know.. i dont see anything wrong with this and i really dont have the time at the moment to redo it so yeah when i have some more time ill work on that..

Thanx Again :D

-SubZeroChaos
You can use the output proc to set labels?

I would use the winset proc to edit a label. You might try something like this (if you really need to use labels instead of grids):
/mob/proc/UpdateStats()
winset(src, "Label1", "text=\"HP: [hp]\n Experience: [exp]")

/mob/Login()
UpdateStats()
return ..()

/mob/TakeDamage(amt)
hp-=amt
deathcheck()
UpdateStats()

Just call UpdateStats() whenever something changes.
In response to Nickr5
Umm... Im doing the same thing with the output. I have another question. Is it possible to show the users icon inside a label e.g in statpanels its quite easy
stat(src)
but im not sure how to set an image but if we could it could easily be updated through mob/Move() function but how do i set the image in the first place and remember im talking about setting it inside a label.

-SubZeroChaos
In response to SubZeroChaos
Labels have an image attribute, see the Skin Reference.