Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 02-26-2015, 03:52 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
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;
  }
}
__________________
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.