How to set text under certain conditions
Posted: Tue Aug 14, 2012 1:46 am
I've been using a pretty inefficient space wasting method for text in my game, I've just been making images with text rather than having a font in my data and setting text in gameEditor. I've got a large amount of text in my pause menu, and I would like to change it from an image to in game text if you know what I mean.
But for something like my upgrades menu, I have it so that if the crosshairs or mouse hover over the "button" to purchase the upgrade, text pops up. But you can switch the menu to be hosting different upgrades. So basically I need to be able to have if statements or switch statements that set the text to be a certain text depending on what menu you are at.
Do I need to have 4 different actors for the text? Or is there some way to set text in script editor? Basically what I'm asking is can text me set under certain conditions like an if statement permits, kind of like:
But for something like my upgrades menu, I have it so that if the crosshairs or mouse hover over the "button" to purchase the upgrade, text pops up. But you can switch the menu to be hosting different upgrades. So basically I need to be able to have if statements or switch statements that set the text to be a certain text depending on what menu you are at.
Do I need to have 4 different actors for the text? Or is there some way to set text in script editor? Basically what I'm asking is can text me set under certain conditions like an if statement permits, kind of like:
- Code: Select all
if(Upgrades_state==2)
{
setText(Bomb Text)
}