Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: goopscoop on Wed 18/02/2015 19:11:31

Title: Adjusting character transparency during dialog
Post by: goopscoop on Wed 18/02/2015 19:11:31
I'm attempting to make a character flicker during a dialog sequence. The idea is that the character is disappearing slowly, flickering in and out of existence.

Anyway, when I attempt to adjust the characters transparency during dialog, nothing happens. The game eBlocks for the desired amount of time due to the "Wait" commands in the script, but the transparency doesn't actually change. Any ideas of why this is happening, or any work arounds? Bear in mind that this is written in the dialog editor, if that makes a difference.

Here are two different scripts I tried.

#1
Code (ags) Select

  int trans = cDude.Transparency;
  while (trans < 40) {
  trans ++;
  cDude.Transparency = trans;
  Wait(1);
  }
  while (trans > 0) {
  trans --;
  cDude.Transparency = trans;
  Wait(1);
  }


#2
Code (ags) Select

  cDude.Transparency = 60;
  Wait(40);
  cDude.Transparency = 20;
  Wait(20);
  cDude.Transparency = 40;
  Wait(20);
  cDude.Transparency = 50;
  Wait(20);
  cDude.Transparency = 80;
  Wait(20);
  cDude.Transparency = 0;
Title: Re: Adjusting character transparency during dialog
Post by: Vincent on Wed 18/02/2015 23:55:14
You can try with the Tween Module (http://www.losmunditos.com/downloads/ags-tween/ags-tween-1.5.1.zip) that probably will work..

Code (ags) Select

player.TweenTransparency(2. , 0, eEaseInTween, eNoBlockTween); // example