Text popup box for set time question...
For some reason I'm struggling with this.
I have a pop-up box that displays different text depending on which actor you click on screen.
I want it to display for 3 seconds and then disappear -
so in the actor I click I have a rule that changes a boolean attribute TextDisplay to 1.
And a timer - After 3 seconds change TextDisplay to 0.
Works fine - until I click a 2nd actor with the same rule and the 3 second timer doesn't reset, so I may only have a flash of the text the 2nd actor triggers (because the timer is still being used from that 1st actor)
Can anyone help? Sorry, difficult to explain - hope it makes sense.
I have a pop-up box that displays different text depending on which actor you click on screen.
I want it to display for 3 seconds and then disappear -
so in the actor I click I have a rule that changes a boolean attribute TextDisplay to 1.
And a timer - After 3 seconds change TextDisplay to 0.
Works fine - until I click a 2nd actor with the same rule and the 3 second timer doesn't reset, so I may only have a flash of the text the 2nd actor triggers (because the timer is still being used from that 1st actor)
Can anyone help? Sorry, difficult to explain - hope it makes sense.
Comments
Bray
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
gameAttribute … text type… text2Display
Actor1
Rule: when
Event: touch is pressed
--changeAttribute: game.text2Display To: this actor's text
--spawn textActor
(add with correctText for all the touchable actors … )
textActor:
Display Text … Text: game.text2Display
Rule: when
Attribute: self.Time = 3
--Destroy
@};- MH
The problem is with the timer.
Here's what I have currently:
RULE: When Actor receives Touch
--changeAttribute: game.textBox to: tableCellvalue....
--changeAttribute: game.TextBoxDisplay to TRUE
-- Timer> After 3 secs change game.TextBoxDisplay to FALSE
The problem is that if I touch it again within the 3 second timer it doesn't restart the 3 secs count. And therefore if touching another scene object that triggers text display in the same box, it may just flash briefly on-off if the original 3 sec count is coming to an end.
If I can find a way of making this work it'll save a huge amount of work down the line because the Text Box actor will be a single Prototype used in all scenes and the text to be displayed will just be pulled from a table.