Making a text box stay the same size & displaying text on a gui without text box

Started by jamesreg, Wed 14/10/2009 15:09:19

Previous topic - Next topic

jamesreg

I have two questions

1) is it possibly to create a text box which does not change size according to the text but always stays the same size?


2) how do you display text overlay onto a normal gui without using a text box and without making the gui transparent?

Dualnames

Quote from: jamesreg on Wed 14/10/2009 15:09:19
I have two questions

1) is it possibly to create a text box which does not change size according to the text but always stays the same size?


2) how do you display text overlay onto a normal gui without using a text box and without making the gui transparent?


1)If the text box is quite big to contain any text yes.

2)By a label I'd guess. Not really 100% what you mean there.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

jamesreg

Ok I figured out if I put a text label on a gui then I could then tell it in the script to display text on that label which will appear on the gui thats what I wanted to happen.

Now I am trying to figure out how to tell the script to wait till there has been a press of the enter key , space key or mouse click and if so to remove that text and put another text in the text label.


Dualnames

Quote from: jamesreg on Wed 14/10/2009 15:18:24
Ok I figured out if I put a text label on a gui then I could then tell it in the script to display text on that label which will appear on the gui thats what I wanted to happen.

Now I am trying to figure out how to tell the script to wait till there has been a press of the enter key , space key or mouse click and if so to remove that text and put another text in the text label.



When you display the label have a global variable, set initially to false and boolean, for example:
bool textonscreen=false;, to turn to true.

Then put this:
Code: ags

function on_key_press(int keycode) {
if (textonscreen==true) {
if ((keycode==eKeySpace) ||(keycode==eKeyReturn)) Label1.Text="";
return;
}
}


Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk