Display text question
RedRobo
Member, PRO Posts: 682
Does anyone know of a way to get display text to fade in gradually. I know it is possible with an image but I have about 500 words which I need to fade in and do not want to create that many images.
Thanks.
Comments
The only way I know is tedious but it works:
DisplayText opacity 0% Timer after 0.1 seconds DisplayText opacity 10% Timer after 0.2 seconds DisplayText opacity 20% Timer after 0.3 seconds DisplayText opacity 30%
etc. all the way to 100% opacity.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
An alternate option would be to not fade the type in but fade out an actor placed over the text. So if your text had a 100% pure black actor over top of it, then you fade out the black actor, the text would appear to fade in.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The less information you supply the harder it is to help you, what colour is the text, what colour is the background, is the text on top of an image . . . etc etc.
If the text (and this is a guess) is white on a black background you can simply place a black square over the top and fade-out the black square, but like I say without any information this is just guess work.
Brute force ! Lol
Not sure how you would change the display opacity ? Would you have 10 separate actors with different display text opacities ?
Yes, I'm also not sure where the display text opacity setting is? Changing the color opacity within the actor just changes the background color opacity not the text.
I meant I am not sure how you would change it over time (i.e. animate its opacity) - if you want to change the opacity of text simply click on the colour indicator within the Display Text behaviour so you can access its colour and opacity.
I want to have about 10 words gradually fading in at random positions within a circle. The words could possibly overlap each other so I'm not sure if having an actor in front of each would work as ideally they would all fade in at slightly different rates and also to a different final opacity setting, for example once they have finished fading in, some words could be about 50% opaque others could be 90% etc...
The background is black and ideally I would like to have variation in the text colour although if I have to stick to one colour it's not a major issue.
Thanks for all your suggestions so far.
Oh, I think I get it now....are you just layering multiple display text behaviours one on top of another gradually increasing in visibility which could maybe be done by changing the colour from black gradually to white (as I am on a black background)?
It might be easier to simply create the text elements externally (in something like Photoshop).
You can't animate the opacity or colour of text.
@tatiang Thanks so much for this suggestion...I've been playing about with this idea. You are right, it is very tedious but it looks like it will solve all my problems so I will just have to knuckle down and get on with it!
Thanks very much for your help.
@Socks
Not with 500 elements.
Sure you can...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
He said he has 10, I still think it would be easier / quicker to do via Photoshop.
I still don't understand how you would animate the opacity or colour of the text ? You can't animate (change over time) the opacity or colour of text . . . unless you are using a fiendish trick you are keeping secret !!
If you could change the colour of text 'gradually' - there would be no reason to layer multiple text behaviours . . . !?
Unless you are spawning actors on top of each other, so building up a single piece of type from - for example - 10 actors . . . !? In which case your hypothetical 500 elements would need 5,000 actors !!!
I'm stumped ! I think I need a lie down.
Just to clarify, I am fading in about 10 words but they are grabbed randomly from a table of about 500 words (see original post).
the idea I have taken from @tatiang is to layer up display text attributes using a timer. if each one is set to 10% alpha for example the effect is to gradually increase the total alpha value resulting in text which fades in. The more steps the smoother the effect.
@Socks
Here's where I got 500:
I'll post a demo of text fading in a little bit...
By the way, this is one of those algorithms that shouldn't work but does.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Socks
https://www.dropbox.com/s/e641ovjtod0f7km/Fade words.zip
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes this is the approach i am using.
What I found is that you can set the alpha setting on all the repeating display text attributes to the same i.e. they do not have to increase as they seem to be additive as each one is applied.
I have them all set to 5 and it is increasing very smoothly although I have to have about 50 steps!
Yes, I see what you mean. How strange!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ah ! Clever stuff, all in one actor too.