Some questions about Display, text labels and showing a pic when someone speaks.

Started by Flint0, Fri 09/07/2021 10:41:45

Previous topic - Next topic

Flint0

I have a lot of questions and I hope you can help me at least with some of them, thank you.
The first one is if I can set a minimum width for the Display function, it gets longer or smaller depending on the lenght of the text but I don't want that I want it to have always the same size even if the text is not that big.
2.Can you change the font used with the "Say" or "Display" function and the color individually for each text? So the question is, can I indicate in the code the font and the colour that I want to use for an specific message? Can you also in some way change the gui that you use for display in the same way (For having differents characters talking with different guis using display, for example)?
3.Can you animate the display box? Can you do something like make it fade in and out or move from the left to the center of the screen or something like that when it appears?
4.Sometimes I would like to make characters talk using the textlabel, for this I would use:
Code: ags
textlabel.Text = ("Hello");
the problem is that the text only stays for a moment and instantly shows the character name that I am clicking on instead of the text (hello), so can I make the game stop when the message shows like with the display to avoid this?
5.I would like to display a pic of the character that is talking while he is talking like in some videogames ?(Golden Sun for example (https://lparchive.org/Golden-Sun/Update%2046/56-donewiththisfuckinggame-1339.png)) can I do that? I don't have any idea on how to do it.

Thank you for the help. :embarrassed:

fernewelten

Quote from: Flint0 on Fri 09/07/2021 10:41:45
2.Can you change the font used with the "Say" or "Display" function …

That's Game.SpeechFont and Game.NormalFont.

Code: ags

Game.NormalFont = eFontGothic;
Display("This is displayed with font eFontGothic");


For this to work properly, you need to have a suitable font loaded with that name.

The speech colour is set in cYourCharacter.SpeechColor.
Code: ags

player.SpeechColor = Game.GetColorFromRGB(213, 11, 77); 
player.Say("Look! I'm talking in a foreign colour!");


AFAIK, the colour for Display texts is somewhat complicated to set: Set up a "text GUI" (not a normal GUI) and enter its ID in General Settings / Text output / Custom text-window GUI.Give the GUI a name, let's say it's called gDisplayGUI.

If you already have a custom Display() text GUI, you're all set and can use that. Otherwise, you'll need to configure the text gui so that its edges are invisible:  In the Properties pane of the text GUI, select each TextWindowEdge in turn and set Image to 0.

You can then do:
Code: ags

gDisplayGUI.TextColor = Game.GetColorFromRGB(213, 11, 77); 
Display("This text is in foreign colour!");


(I don't usually use Display() at all in my own games so I might not be up to date with this. If someone knows an easier way to do that, I'd like to know about it. )


newwaveburritos

For Question #3 it sounds like you might want to look into the Tween module.

Matti

Regarding question 5:

It's possible to do that. You have to set the Speechstyle in the general settings from LucasArts to Sierra, but I don't know how it's set up properly. I'm not using the Display function either, so I can't help you with the other questions.

fernewelten

Concerning tweening: I'm no expert for this module, but they will probably only work with normal GUIs, not text GUIs. This is probably going to need advanced programming, so if you don't have much experience with AGS, especially if you haven't coded a game before, I'd suggest experimenting with other features first.

Flint0

I'll check those things, the animation is not 100% necessary so is ok,thx.

SMF spam blocked by CleanTalk