[SOVLED]Set Text For Health

Get help using Construct 2

Post » Sun Feb 24, 2013 6:42 am

Hello. I've put a text named Health at the upper left corner of the screen to display the health. However, no text is showing. I've created a global variable PlayerHealth = 100. Whenever the player is hit by an enemy arrow or snowball, the player loses health. I want the health to be display at all times. I did System->Every tick Health->Set text to "Health: " & PlayerHealth. No text shows up on screen when I start the game. If I do not put & PlayerHealth after it, it works. If I just put PlayerHealth with no other strings, it also works. I've tried replacing PlayerHealth with str(PlayerHealth) in the set Text, but it still does not work. The player does lose health and die in the game. So there must something wrong with the PlayerHealth variable. Here is the capx: https://www.dropbox.com/s/x868kwda9knfww1/Test.capxandroidmt3192013-02-25 02:46:56
B
3
Posts: 18
Reputation: 311

Post » Sun Feb 24, 2013 7:29 am

@androidmt319
A common reason for text not displaying is not sizing a large enough area in which to show it. Trying increasing the dimensions of your Health text object.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Sun Feb 24, 2013 5:53 pm

Thanks,Velojet. It works now.
B
3
Posts: 18
Reputation: 311


Return to How do I....?

Who is online

Users browsing this forum: Naightwolf and 21 guests