Display text question

RedRoboRedRobo 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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2014

    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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited May 2014

    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.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @strag said:
    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.

    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.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @tatiang said:
    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.

    Brute force ! Lol :)

    Not sure how you would change the display opacity ? Would you have 10 separate actors with different display text opacities ?

  • RedRoboRedRobo Member, PRO Posts: 682

    @Socks said:
    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.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @strag said:
    I'm also not sure where the display text opacity

    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.

  • RedRoboRedRobo Member, PRO Posts: 682

    @Socks said:
    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.

    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.

  • RedRoboRedRobo Member, PRO Posts: 682

    @tatiang said:
    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.

    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)?

  • SocksSocks London, UK.Member Posts: 12,822

    @strag said:
    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 . .

    It might be easier to simply create the text elements externally (in something like Photoshop).

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @strag said:
    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)?

    You can't animate the opacity or colour of text.

  • RedRoboRedRobo Member, PRO Posts: 682

    @tatiang said:
    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.

    @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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2014

    @Socks

    @Socks said:
    It might be easier to simply create the text elements externally (in something like Photoshop).

    Not with 500 elements. ;)

    @Socks said:
    You can't animate the opacity or colour of text.

    Sure you can...

    @strag said:
    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)?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2014

    @tatiang said:
    Not with 500 elements.

    He said he has 10, I still think it would be easier / quicker to do via Photoshop.

    @tatiang said:
    Sure you can....... strag: "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)?"

    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.

  • RedRoboRedRobo Member, PRO Posts: 682

    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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2014

    @Socks

    Here's where I got 500:

    @strag said:
    I have about 500 words which I need to fade in and do not want to create that many images.

    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. :smile:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RedRoboRedRobo Member, PRO Posts: 682

    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!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @strag said:
    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.

    Yes, I see what you mean. How strange!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    Ah ! Clever stuff, all in one actor too. :)

Sign In or Register to comment.