View Single Post
  #1  
Old 01-31-2010, 01:10 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Image alpha, waitfor, and loops

Hello, I wanted to start off by explaining what I am trying to accomplish.

I wanted to make a similar effect to the xbox360/ps3 notification system. For those of you who use "ubuntu" you may notice it too, uses a similar effect called "NotifyOSD".

What I am doing here is drawing a polygon, and replacing it with an image. However, I wanted to use GUI's but had several problems. I could not make a semi-transparent black window appear. I was using GuiWindowCtrl, GuiControl, and GuiShowImgCtrl. No sucess, so I turned to polygons.

The problem I am having is that I need the polygon (or gui if anyone can help with that) to fade in/out. I am stumped why this code would not work seeing as it looks correct to me at first glance. Maybe anyone else might have an idea what I am doing wrong.


PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findimg(4002) ) {
    
this.xy2 = {screenwidth-275,25};
    
this.xy = {temp.poly[0]+50temp.poly[1]+25};
    
polygon = {this.xy2[0],this.xy2[1],this.xy2[0]+250,this.xy2[1],this.xy2[0]+250,this.xy2[1]+75,this.xy2[0],this.xy2[1]+75};
    
layer 4;
    
red=green=blue=25;
  }
  
changeimgcolors(4002,0,0,0,.5);
  
with (findimg(4003)) {
    
this.xy2 = {screenwidth-215,35};
    
x=this.xy2[0];
    
y=this.xy2[1];
    
layer 5;
    
text "scriptless has logged on";
    
zoom .7;
  }
  
with (findimg(4004)) {
    
this.xy2 = {screenwidth-260,45};
    
x=this.xy2[0];
    
y=this.xy2[1];
    
layer 5;
    
image "head1212.png";
    
zoom 1.5;
  }
  
changeimgpart40040643232 );
  
  for ( 
i=0i<1i+= .01 ) {
    for ( 
j=4002j<4005j++ ) {
      
with (findimg(4002)) { alpha i/100; }
    }
    
waitfor("""noevent"0.5);
  }


** Edit ***
I was unable to figure out how to change the polygons colors to black so i had to use a black image, stretch it and then change alpha. I know there must be an easier way but it just refused to work for me.
** end edit ***

Thank you in advanced,
scriptless

For solution click here.

Last edited by scriptless; 01-31-2010 at 02:06 AM..
Reply With Quote