Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: barefoot on Tue 01/02/2011 16:53:21

Title: SOLVED: Overlay text display for score
Post by: barefoot on Tue 01/02/2011 16:53:21
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.



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


Title: Re: Overlay text display
Post by: Gudforby on Tue 01/02/2011 17:12:45
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.
Title: Re: Overlay text display
Post by: barefoot on Tue 01/02/2011 17:16:52
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
Title: Re: Overlay text display
Post by: Akatosh on Tue 01/02/2011 18:03:18
The GiveScore global function (http://www.adventuregamestudio.co.uk/manual/GiveScore.htm) should be useful there. Note that the display will update automatically.
Title: Re: Overlay text display
Post by: barefoot on Tue 01/02/2011 18:09:25
Hi  Akatosh

just did this and it seems to work ok:


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


Beginning GUI shot:
(http://www.brooklandscarco.co.uk/hood-score.png)

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

Title: Re: Overlay text display
Post by: Akatosh on Tue 01/02/2011 22:47:48
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?

Title: Re: SOLVED: Overlay text display for score
Post by: barefoot on Wed 02/02/2011 05:31:04
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