Textual Overlay question[SOLVED]

Started by DrewCCU, Sun 11/07/2010 06:08:57

Previous topic - Next topic

DrewCCU

I need a textual overlay (or something similar) to appear on TOP of a GUI.  Something like:

Code: ags

int Power = 100;

Overlay* myOverlay = Overlay.CreateTextual(50,80,120, Game.SpeechFont, 15,"Power is at %d%", Power);


Obviously, this would display a textual overlay that says "Power is at 100%"

However, it is important that this overlay appears ABOVE a GUI.  Now, to my knowledge an overlay does not have a zOrder so can not be placed above a GUI.  I can't use a GUI button because you can't use string formatting when editing a button's text.

Also, i don't want to use the Display function obviously because it would pause the script - and that can't happen here.

This may not be possible but if it is at all i would prefer to keep the necessary coding inside the room script ... if possible.  If not - oh well.  But yeah, i need something like this but it needs to be over a GUI.

Any suggestions?
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

GarageGothic

You are correct that overlays can never be on top of GUIs. But use a GUI with a label instead (or button as you say, though labels seem more appropriate). Look up the String.Format function in the manual.

Code: ags
int Power = 100;
lblMyPowerLabel.Text = String.Format("Power is at %d%", Power);


Piece of cake :)

DrewCCU

works like a charm ... i'd never experimented with labels much before - but i'm glad you introduced me to them. thanks.
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

SMF spam blocked by CleanTalk