View Single Post
  #4  
Old 02-27-2015, 12:50 AM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
Quote:
Originally Posted by xAndrewx View Post
I personally don't think you can use alpha on text. If you convert the text to an image, you could do this. If it works with text, great. I'm sure it won't though...

HTML Code:
//#CLIENTSIDE
function onCreated(){
  this.dontblock();

   //So I set the image at the start - no need to keep re-drawing it.
  this.fimg = findimg(200);
  with(this.fimg) {
    x = screenwidth / 2;
    y = screenheight / 2 - 180;
    image = "block.png";
    alpha = 0;
    layer = 4;
    zoom = 2;
  }
  this.onTimeout();
}

function onPlayerEnters() {
  this.onCreated();
}

function onTimeout(){
  this.onCheckScreen();
  setTimer(0.05);
}

function onCheckScreen() {
  if (player.x in |this.x-10,this.x+10| && player.y in |this.y-5,this.y+5|) {
      //If the image alpha is less than one, increase it gradually.
    if (this.fimg.alpha < 1)
      this.fimg.alpha += 0.05;
  } else {
      //If they're not in the area and the alpha is greater than 0, decrease it gradually.
    if (this.fimg.alpha > 0)
      this.fimg.alpha -= 0.05;
  }
}
Thats the exact script im using for my transitional things, i would use it but i dont know of a way to have it fade out after a while and not being called again

i dont want the alpha to be 1 constantly while in the area, it has to just trigger once and fade out until the entire area is touched again basically


the above method works with this.chat but i havent figured out a way to do it with findimg in combination with alpha
__________________
iEra IGN: *Elk (Darkshire)
iCla. IGN: *Elk (Darkshire)
iZone IGN: *Elk (Darkshire)




Reply With Quote