mesh colorTransform

Software: Away3D 4.x

movieclip, Newbie
Posted: 13 April 2015 07:53 AM   Total Posts: 10

Hi!
I have playing cards. 52 meshes with same material (image atlas + change mesh UV).
How can I apply colorTransform for some of this cards?

for example: mesh.material.alpha changing alpha for all cards.

((card.getChildAt(0) as Mesh).material as TextureMaterial).alpha = 0.5

Thanks!

   

Avatar
Fabrice Closier, Administrator
Posted: 13 April 2015 11:14 AM   Total Posts: 1265   [ # 1 ]

you could do 52 materials sharing same texture but likely a better option would be to have 2 materials, the current that you already apply and a selected version of it (with alpha, coloring, whatever you like) that you toggle.

so instead of doing card.material.alpha = 0.5, you would do card.material = _selectionMaterial; and when you now reset alpha to 1, you would simply set the main material back.

   

movieclip, Newbie
Posted: 13 April 2015 04:12 PM   Total Posts: 10   [ # 2 ]

Ow, it works good! Thanks so much!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X