Is it possible to display an alterable value in a game to show health or ammo or something? I have tried everything I can think of and can't figure this out. Is it possible? If so how can I do it?
Printable View
Is it possible to display an alterable value in a game to show health or ammo or something? I have tried everything I can think of and can't figure this out. Is it possible? If so how can I do it?
Counter object
- set value of counter to Alterable Value A("Object storing alterable value")
I tried that but the Counter object is always behind every other object. How can I bring it to the front? I tried setting the order but that didn't work.
Uncheck "Display as background" in the properties :)
Oh ill try that, thanks.
They are in the front in the frame editor but they are still in the back when I test the game.
Another alternative is to use a String object and change the alterable string to Str$(variablehere) This lets you easily change the font and stuff to whatever you want. The counter is good if you want to do that by drawing your own images for the numbers. =)
Plus using the String lets you do stuff like displaying "You have 100 health" or whatever. Which would be "You have " + Str$(healthvaluehere) + " health."
If you create objects at runtime, they will be on top of the counter. Try also having an event: Always - Bring Counter to Front (the command can be found under the counter's "Order" menu.)Quote:
Originally Posted by games1101
And if you have any other objects set to the front by events, but still want them behind the counter, just put the counter event after the other object's event. That way the other objects are set to front, and then the counter is set on top of them.
If you are using MMF2 it's probably a lot easier to just put the counter on a layer above your game field. This gets around any event problems you might have with ordering.
Layers can be found with View -> Toolbars -> Layers Toolbar.
I tried everything you guys said and nothing worked. I decided to move the background image and then tested the game. I now found out that the counter isn't behind everything, it doesn't show up at all... The counter still shows up on the frame editor though. I made sure that number of objects is high enough anyone have any ideas?