Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: shaun9991 on Wed 13/05/2015 22:24:05

Title: [SOLVED] Character name in text label question
Post by: shaun9991 on Wed 13/05/2015 22:24:05
Hi guys,

Another question, any help much appreciated. I've created a custom gui system for displaying speech text at the top of the screen. This has been done by creating a gui with two labels, one for the name of the character, and one for the actual speech.

Code (ags) Select
void Saying(this Character*, String message) {
  lSaying.Text = message;
  gSaying.Visible = true;
  //// lNameofSpeaker = ???
  lSaying.TextColor = 65535;
  this.Say(message);
  gSaying.Visible = false;
}


My question is, can I insert some code here which will dynamically change the label text of 'lNameofSpeaker' to the Name of the character who is talking at the time?

Any help much appreciated,

Thanks,
Shaun
Title: Re: Character name in text label question
Post by: Snarky on Wed 13/05/2015 23:17:33
lNameofSpeaker.Text = this.Name; should do the trick.
Title: Re: Character name in text label question
Post by: shaun9991 on Thu 14/05/2015 10:40:08
Thanks Snarky! Worked a treat :D