Okay, I've been all over this forum and the Mudlet Manual.
I've read up on how to make Labels and think I have a pretty good understanding of what they are and how they work... I just have a few questions that the manual didn't cover and that I need answered before I can move on with my project.
Where do the 'labels' go? Do I make them within the 'script' section?
Secondly, what would you coding look like if I wanted the labels to change color when they are activated? Like say I was making a 'label' that was called 'Slickness' and I wanted to make it so that when I had 'slickness' the label would change to red and when it was cured it would change to white.
I'm unsure of how to do this and would appreciate a step by step... Not a redirection to someone else's coding to look at, as I am a new coder and I find it extremely easier if someone just explains it to me rather then me having to rip apart someone else's coding and still come out not knowing what I am doing.
How to make 'Labels'
Re: How to make 'Labels'
You make them with coding - createLabel spawns you a label.
To change colour, you can uset setLabelStylesheet and adjust the background-colour property
To change colour, you can uset setLabelStylesheet and adjust the background-colour property
Re: How to make 'Labels'
Didn't know about 'setLabelStylesheet' thanks.
Just a few questions, I currently have my coding set up like so:
WindowWidth=0;
WindowHeight=0;
WindowWidth, WindowHeight = getMainWindowSize();
function affliction_gauges()
createLabel("Slickness",0,0,0,1);
setBackgroundColor("Slickness",32,124,215,255)
end
Just to get a label started so it gives me something to work with, but when I have a new script set with just affliction_gauges() it comes up saying 'wrong argument type' so it doesn't really work... Am I doing something wrong here?
Just a few questions, I currently have my coding set up like so:
WindowWidth=0;
WindowHeight=0;
WindowWidth, WindowHeight = getMainWindowSize();
function affliction_gauges()
createLabel("Slickness",0,0,0,1);
setBackgroundColor("Slickness",32,124,215,255)
end
Just to get a label started so it gives me something to work with, but when I have a new script set with just affliction_gauges() it comes up saying 'wrong argument type' so it doesn't really work... Am I doing something wrong here?
Re: How to make 'Labels'
Yes, you were missing the height argument of createLabel. This will work:
createLabel("Slickness",0,0,0,0,1);
... but it's not like you'll see anything, because the given label has a height and width of zero.
createLabel("Slickness",0,0,0,0,1);
... but it's not like you'll see anything, because the given label has a height and width of zero.
Re: How to make 'Labels'
Aye, I was attempting to just get the code working first.
Now I have it set up so that it shows up and the like... Few problems though.
1) I can't seem to get it so that 'Slickness' is shown on the Label
2) I couldn't find any information for 'setLabelStylesheet' so I'm not exactly sure as to how it would be used....?
Now I have it set up so that it shows up and the like... Few problems though.
1) I can't seem to get it so that 'Slickness' is shown on the Label
2) I couldn't find any information for 'setLabelStylesheet' so I'm not exactly sure as to how it would be used....?
Re: How to make 'Labels'
echo("Slickness", "Slickness")
You just give it CSS code... my fancy gauges here on forums makes use of it.
You just give it CSS code... my fancy gauges here on forums makes use of it.
Re: How to make 'Labels'
I have no clue what CSS coding means.... Would you mind just giving me an example of what it would look like? It's much easier for me to figure things out that way.
Re: How to make 'Labels'
I've tried to look at your 'Fancy Gauges' and change them to what I need... But I just can't seem to understand the coding behind it.
Thats your coding as I'm sure you know.... But I don't see how that helps me in anyway to get something as simple as:
To change to a red color if I have Slickness... Is there no way to simply put in an 'if' statement in there so that it changes the color?
Re: How to make 'Labels'
setGaugeStyleSheet("Slickness", [[background-color: green]])
Re: How to make 'Labels'
Holy crap.... I understand now, thank you and sorry for the many questions