This site is optimised for Firefox 2.0 or Internet Explorer 7.

Papervision 2 - setting alpha?

bpops has no avatar
bpops
 
Post Count: 2
Joined: Thu May 15, 2008 3:57 am

Papervision 2 - setting alpha?

Postby bpops on Thu May 15, 2008 4:03 am

Hi,

My first post on this forum.

I'm slowly learning and becoming better with Papervision 2. However, one problem I'm having is that I can not figure out how to set the alpha of a particular object. In this case, I'm trying to create a plane with text on it (which all works just fine), and then I'd like the text to fade away.

I won't post all my code as there's no real problem with the code itself, but here's an outline of what I'm doing

- Create a text field, add the text and format it
- Add the text to a movie clip
- Add the movieclip to a new material
- make a new plane with this material

Things I've tried are
- setting the alpha of the text
- setting the alpha of the movie clip (this and the one above work per se, that they do change the alpha when I trace() it, but since the material has already been created I think they have no effect)
- setting the alpha of the material ( found this post here, but the solution does not work: viewtopic.php?f=29&t=15087 )
- setting the alpha of the plane (obviously doesnt work)

I appreciate any help anyone can offer!

bpops has no avatar
bpops
 
Post Count: 2
Joined: Thu May 15, 2008 3:57 am

Re: Papervision 2 - setting alpha?

Postby bpops on Thu May 15, 2008 8:16 pm

No ideas yet?

I figure if there's just a way to reload the material onto the plane, then I could set alpha on the movie clip, remake a material, and then reload it on the plane.

The only other option is to completely remake the plane every frame. Anyone know how to reload a material or have any ideas at all about how to solve this problem?

mightySprite has no avatar
mightySprite
 
Post Count: 1
Joined: Thu May 29, 2008 1:59 pm
Flash Version: Adobe Flash CS3

Re: Papervision 2 - setting alpha?

Postby mightySprite on Thu May 29, 2008 2:11 pm

When you set up your material, be sure to make it animated. For example:

Code: Select all
// Animated is the third parameter
var mat:MovieMaterial = new MovieMaterial(textMovieClip, true, true);


or after instantiating your MovieMaterial:

Code: Select all
mat.animated = true;


To change the alpha of your plane:
Code: Select all
MovieMaterial(plane.material).movie.alpha = 0.5;


Hope this helps, and works! ;)


Return to Actionscript 3.0

Who is online

Users browsing this forum: Kirone and 5 guests