Displaying an image like this in gamesalad?

allc1865allc1865 Member, PRO Posts: 777
Hello! I want to display text like this that comes across your screen when your game starts and then goes away. This was the best example I had to show what I was trying to do.

image

It comes across the screen and then leaves. I'd imagine you'd just have constrain attributes, but I'm not sure how to have it pop up when the game starts and then of course, leave.

Any help will be great! Thanks.

Best Answers

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,772
    Accepted Answer
    Treat it like any actor in the game. You can use the GS Behaviors to Move it, Spawn it, whatever you want to happen.

    For example if you want it to move right to left. Place it off the screen to the right and add a Move Behavior to move it across the screen until it is gone off the left side. When that is is displayed the text will move across the screen.
  • KillerPenguinStudiosKillerPenguinStudios Posts: 1,291
    Accepted Answer
    I personally like to use the interpolate behavior for things like that. Just tell it how many seconds you want it to go from point A to point B.

    The issue I find when people use the move behavior is that they never tell the actor to stop moving. If you don't tell it to stop moving then technically it is still moving forever and always running which takes up a small amount of performance. Anything that goes off screen (out of the scene) should be either stopped, recycled, or destroyed just some good for thought!
  • KevinCrossKevinCross London, UKPosts: 1,894
    Accepted Answer
    @KillerPenguinStudios if it goes too far off the scene I believe it's destroyed, from what I've read here and my own tests.

Answers

  • allc1865allc1865 Member, PRO Posts: 777
    @KillerPenguinStudios, "If you don't tell it to stop moving then technically it is still moving forever and always running which takes up a small amount of performance."

    Oh okay. I used the Move To behavior and set it's X and Y coords on where I wanted it to appear. Then I said, when touch is pressed > destroy actor. Does that still use up performance?
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @KillerPenguinStudios if it goes too far off the scene I believe it's destroyed, from what I've read here and my own tests.
    Wasn't aware that GameSalad did that. I am just use to straight coding and making sure to get rid of things when done with them or recycling them so you don't have so called memory leaks. It's just a good habit to get into to then! :D
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @KillerPenguinStudios, "If you don't tell it to stop moving then technically it is still moving forever and always running which takes up a small amount of performance."

    Oh okay. I used the Move To behavior and set it's X and Y coords on where I wanted it to appear. Then I said, when touch is pressed > destroy actor. Does that still use up performance?
    It does use performance when you destroy things. I would maybe just leave it in there where you have it end at and maybe even just tell it to change it's alpha to 0 once at it's ending location.

  • allc1865allc1865 Member, PRO Posts: 777
    @KillerPenguinStudios, alpha is a good suggestion, thanks for your help. :D
    @jamie_c, thanks for your help, that did it! :)
  • allc1865allc1865 Member, PRO Posts: 777
    @KevinCross, that's good to know. I'll make sure to keep that in mind. Thanks! :D :)
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    @KevinCross, that's good to know. I'll make sure to keep that in mind. Thanks! :D :)
    @allx1865,
    Even though GameSalad may do that for you, I would still recommend taking that unwanted actor and/or actors and either place them somewhere out of the scene, recycle them, hide them, or destroy them rather than leaving it up to GameSalad to get rid of them. Doing so will help with performance, it's cleaner, it's good practice, and it's an extremely good habit to have. You will thank yourself in the end!
  • allc1865allc1865 Member, PRO Posts: 777
    Okay, so placing them out of the scene and, for an example, destroy the actor -- when a touch is pressed? Destroy it that way?
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    If you're moving it across the screen, you could use a rule to automatically destroy it after it reaches a certain X or Y location.
Sign In or Register to comment.