Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorchien
    • CommentTimeFeb 15th 2009
     
    I am having a bit of a problem getting the renderer to render transparent backgrounds with anything other than black in the transparency area.. This despite whether I use PNGs 24 or 32 bit. The areas having no transparency render correctly.

    I am using createPixelParticlesFromBitmapData() which I see uses getpixel32(). A as particle type I see the pixel is particle2D. At that point I start to get lost as I do not understand how the alpha channel is included in the color information.

    Any suggestions?

    Thanks

    chien
    • CommentAuthorRichard
    • CommentTimeFeb 16th 2009
     
    The particle's color property is a 32 bit ARGB color value. Thus, the top 8 bits are the alpha channel. so 0xFFFFFFFF is fully opaque white and 0x80FFFFFF is semi-transparent white (08 = 50% transparency).
    • CommentAuthorchien
    • CommentTimeFeb 17th 2009
     
    I found the enemy and it was me. I was using a fade action(the problem) along with some other actions that caused the 0 alphas to become 1s.

    I was under the mistaken impression that the starting parameter of 1 was as initial alpha was the particles current alpha .

    Of course this does lead me to a question of: Is there an action by which you can fade from the current level of an alpha to an ending alpha?

    Thanks,

    chien
    • CommentAuthorRichard
    • CommentTimeFeb 17th 2009
     
    No, but you could make one. You'll need to store each particle's initial alpha in its dictionary so you can use it for the action.
    • CommentAuthorchien
    • CommentTimeFeb 18th 2009
     
    Thanks for the reply Richard.

    I accomplished the same thing by creating a custom class modifying your Fade action with about three lines so I maintain similar functionality if the alpha is > 0;

    But while doing it I saw some really interesting possibilities for modifying energy levels etc for some potential sp eff. When I get time I think I will explore some of those potential effects.

    I really like this system.

    chien