SOLVED: Overlay text display for score

Started by barefoot, Tue 01/02/2011 16:53:21

Previous topic - Next topic

barefoot

Hi

I have been looking into Overlaying to keep text on the screen at all times.

Even using this code it does disappear. I'de like it to keep on screen until turned off.

Code: ags


Overlay* myOverlay = Overlay.CreateTextual(520,40,120, Game.SpeechFont, 15,""Total: $%d");


Is there a way to tweek this or another option?

Do gui's block it?

UPDATE: Just seen there is wait function for it.. which is no good.!!

cheers

barefoot


I May Not Be Perfect but I Have A Big Heart ..

Gudforby

I'm not into overlays, but making the text a label on a GUI should at least do the trick.
Then you can manually feed and format the label text from the script, and turn it on and off as you do with any other GUI.

barefoot

#2
Hi

i've got a button on a gui that display total results..

I was hoping to have it as text display..

UPDATE
I have created a textlabel with @SCORE@ which works with game.score=***

How can I have it so i can 'add' to the score individually???

cheers

barefoot
I May Not Be Perfect but I Have A Big Heart ..

Akatosh

The GiveScore global function should be useful there. Note that the display will update automatically.

barefoot

#4
Hi  Akatosh

just did this and it seems to work ok:

Code: ags

           GiveScore (400);
            SetGlobalInt (1, 100);


Beginning GUI shot:


is this along the lines you mean Akatosh?

It's just that i think seeing a score is better then having to click a button..

cheers

barefoot

I May Not Be Perfect but I Have A Big Heart ..

Akatosh

Quote from: barefoot on Tue 01/02/2011 18:09:25
is this along the lines you mean Akatosh?

It's pretty much exactly what I was hinting at. Good job.  :)

Quote from: barefoot on Tue 01/02/2011 18:09:25
It's just that i think seeing a score is better then having to click a button..

Not sure what you mean by that, though. If you create a label with the text of @SCORE@, the display should always show your current score, without you having to click a button. How are you doing things right now?


barefoot

#6
Hi

i have both at the moment but using Givescore is the main one.. I just need a function to  then give conditions if its over a certain score..

Once its adopted throughout the game i will dispense with the button version..

cheers

barefoot
I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk