Show number

ShpintShpint Member Posts: 404
edited November -1 in Working with GS (Mac)
Hi all,
How can I show a number on screen. Like the amount of character with this "TAG" on screen?

Thanks

Comments

  • Rob2Rob2 Member Posts: 2,402
    Display text behavior
  • ShpintShpint Member Posts: 404
    How exactly?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You will need to use global attributes

    i.e.

    Lets say you're spawning charcaters on to the screen

    Create a global integer attribute and call it something like character.count with a value of 0

    On your character;

    change attribute - character.count to character.count+1

    Then you will need to create a new actor,name it what you like, then inside;

    Behaviour - Display Text - use the expression editor (e) next to the blank box and then find the game attribute called 'character.count'

    That way, when a new character is spawned onto the scene it adds 1 to the character count value and the display text acor will display the number for you.

    If your character is going to die you may want to add a rule on the character that says change attribute game.character.count to game.character.count - 1 before the character is destroyed.

    You may not be spawning characters but the principles are still the same
  • ShpintShpint Member Posts: 404
    Thank you so much!!!!!!!!!!
Sign In or Register to comment.