Making a function to make a GUI shows the "Display" or "Say" text usually

Started by Alarconte, Wed 14/09/2011 05:02:21

Previous topic - Next topic

Alarconte

Hi! I really try to do all the things by myself, but the functions and some retroactive-permanent things not-clumsy, I don't really get it. xD

Well, I'm doing a sort of text adventure, and the next step is simply to put all the in-game messages in the aproppiate zone of the game.

I realised that the Best choice, is to make a function that everytime I use Display [c](better Display than Say, cause I want the dialogs with other characters in a complete different way, kind WholeScreen conversations...)[/c] it automatically shows the message in XY coordinates with X-X wide and lenght. I know there are commands to do this, but I don't really know how to override the normal use, and to make it automatic.... Or well, put the message in a label in a GUI (I normally do it manually, but is too much work for doing the game this way.. I think is better with a function.

I want an specific font and color, so the label is right to me, I think the colors on display messages aren't customisables... or I'm wrong? :S

Moreover, I also need that the Displayed message stays unerased until a next text is invoked. Maybe in the future I will use a "acumulative log" in the way of conversational adventures, If I find the way to do it, but for starts, this will be in handy.


so... I don't to be this a post Do-the-work-for-me, but I'm really lost, If you don't mind to helpme a bit orientating me the way to make it... I will be very gratefull, thank you!
"Tiny pixelated boobies are the heart and soul of Castlevania"

Galactic Battlefare Capital Choice Part 1 , finished, releasing soon
GBF CC Part 2, WIP

Snarky

You can modify the appearance of Display() commands quite easily. Look up "Customized text windows" in the manual.

However, when you say "I also need that the Displayed message stays unerased until a next text is invoked", do you mean that you want the text to stay up while you continue playing and interacting with the game? Display() commands can't do that. What you want to do for that is to create your own GUI with a text label on it (giving it whatever look you want), and instead of calling Display() just use label.Text = "your text here"; (with the name of your text label instead of "label".)

Alarconte

Customized text windows isn't usefull, as I think I explained in the first post.

I will work with the label.Text, if I can work only with it withouth using a function, thanks!
"Tiny pixelated boobies are the heart and soul of Castlevania"

Galactic Battlefare Capital Choice Part 1 , finished, releasing soon
GBF CC Part 2, WIP

Alarconte

Thankyou!

Leet's see. I have a difficulty cause I has a script that worked well in Display but not in label, is the next:


Quote
L1.Text("Please use another word for '%s'.", Parser.SaidUnknownWord()); }// %s will be replaced with the unknown word and printed on screen

the error is that in the label it writes "%s", not the work in question. Anyidea? If not, I could simply ignore this and don't use the %s..


"Tiny pixelated boobies are the heart and soul of Castlevania"

Galactic Battlefare Capital Choice Part 1 , finished, releasing soon
GBF CC Part 2, WIP

pcj

Label.Text is a property, not a function.  Also you'll need to use String.Format to parse in Strings/integers/shorts/etc.
Space Quest: Vohaul Strikes Back is now available to download!

Alarconte

Never said that label.text were a function... I'm saying that I'm gonna work with that Without creating a function to work with it xD

But this I tottally don't get it.
QuoteAlso you'll need to use String.Format to parse in Strings/integers/shorts/etc

I have been soo much time away from AGS... but if you're talking about wrinting "L1.Text = "xxx";" rather than L1.Text(""); , yes, I already know, I don't know why I copied te thing in this way.

the thing I was saying, is that in the model
Quote
DisplayMessage("Please use another word for '%s'.", Parser.SaidUnknownWord()); }// %s will be replaced with the unknown word and printed on screen
this work, but this not:
Quote
L1.Text = "Please use another word for '%s'."; Parser.SaidUnknownWord(); }// %s will be replaced with the unknown word and printed on screen
That is the thing I need to get working

anyway, for the moment, I created the user interface that I need (clumsy but working)
"Tiny pixelated boobies are the heart and soul of Castlevania"

Galactic Battlefare Capital Choice Part 1 , finished, releasing soon
GBF CC Part 2, WIP

pcj

You'll need to do it like:

Code: ags
L1.Text = String.Format("Please use another word for '%s'.", Parser.SaidUnknownWord());
Space Quest: Vohaul Strikes Back is now available to download!

Alarconte

Thank you, after some problems with this command and the rest of the code, I finally give it and use Display for only this kind of message, 'cause isn't related at all with the history, is related with the correct user interface, so I keept it separate from the labels that explain interactions.

Lots of thanks to all of you!
"Tiny pixelated boobies are the heart and soul of Castlevania"

Galactic Battlefare Capital Choice Part 1 , finished, releasing soon
GBF CC Part 2, WIP

SMF spam blocked by CleanTalk