Game Development Community

Export Material Flags to Console

by James Lupiani · 08/12/2005 (3:23 pm) · 0 comments

Download Code File

As noted in the TSE demo's commonMaterialData.cs, the material animation flag enums (among others) can't be bitwise-or'd in script. This quick workaround exports the enums to the console as integers, allowing you to avoid defining them somewhere odd in your scripts and coupling it with the C++ values. So, you can define materials like this:

new Material(SphereKnobGlow)
{
   mapTo = sphere_rubber;
   baseTex[0] = "~/data/shapes/test/glowGrad";
   emissive[0] = true;
   glow[0] = true;

   animFlags[0] = [b]$AnimType::Scroll[/b];
   scrollDir[0] = "0.0 -1.0";
   scrollSpeed[0] = 0.2;
};

About the author

Programmer for Sickhead Games