Custom Display Text per Character | Text GUI selection during the game [SOLVED]

Started by Nahuel, Wed 07/09/2022 09:37:36

Previous topic - Next topic

Nahuel

Hi everyone, I hope you all are doing well.

I'm facing an issue that the Display function can only point to the particular configuration under general settings > custom text window.
My goal is to create a different text color based on the character that is playing, this should be only 3, instead of showing the same text window i would like to customise the colour of the text displayed but I cannot access the font-color property anywhere.

Any ideas of how to achieve this?

Thanks for your time.

Nahuel
Life isn't a game. Let's develop a life-like-game.

Khris

Assuming you have created a custom TextWindowGUI named  gTextGui  you can call
Code: ags
  gTextGui.TextColor = some_new_color;


The manual entry even has a custom ready-to-use extender function as example code:
Code: ags
function MySay(this Character*, const string message) {
  gTextGui.AsTextWindow.TextColor = this.SpeechColor;
  this.Say(message);
}


Set the character's .SpeechColor, then use  cEgo.MySay("Hello World!");

Nahuel

Thanks Khris,

I noticed that the accesor AsTextWindow did he trick, I changed it to
Code: ags

function MySay(this Character*, const string message) {
  gTextGui.AsTextWindow.TextColor = this.SpeechColor;
  Display(message);
}


And the general configuration is not pointing to the new gTextGui and also customised the message to add the Char name.

Unfortunately gTextGui.TextColor = some_new_color; this is returning an error but of course fixed with AsTextWindow

Thanks again
Life isn't a game. Let's develop a life-like-game.

eri0o

You should reaaaally use a character Say function instead of using the Display function. Display pauses the entire game and is only there for backwards compatibility - later if you want to have some animation going on or do a function at the same time, it won't be possible.

Nahuel

Quote from: eri0o on Wed 07/09/2022 13:47:06
You should reaaaally use a character Say function instead of using the Display function. Display pauses the entire game and is only there for backwards compatibility - later if you want to have some animation going on or do a function at the same time, it won't be possible.

I understand perfectly  :smiley: eri0o thanks  :=, the issue here is that I'm creating a P&C for my niece (6 years old) so mainly I'm bypassing stuff in order to help my niece to read more (and even pause the game). It's only for this game and I wouldn't use it in any other game. But understood complely.
Life isn't a game. Let's develop a life-like-game.

Snarky

If your concern is that Character.Say() auto-advances before your niece can finish reading the text, there is a game setting you can use to ensure that it stays up until the player clicks.

Nahuel

Quote from: Snarky on Wed 07/09/2022 14:10:51
If your concern is that Character.Say() auto-advances before your niece can finish reading the text, there is a game setting you can use to ensure that it stays up until the player clicks.

Thanks Snarky, will check that now.
Life isn't a game. Let's develop a life-like-game.

SMF spam blocked by CleanTalk