I´m currently trying to colorize my units the following way:
Taking the original texture/material:
Code: Select all
video::SMaterial text = node->getMaterial(0);
text.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;
text.setFlag(video::EMF_LIGHTING, false);
Code: Select all
video::SMaterial solid;
solid.MaterialType = video::EMT_SOLID;
video::IImage *img = Device->getVideoDriver()->createImage(video::ECF_A8R8G8B8, core::dimension2du(1,1));
img->setPixel(0,0, video::SColor(0, 0, 0, 255));
solid.setTexture(0, Device->getVideoDriver()->addTexture("bla", img));
solid.setFlag(video::EMF_LIGHTING, false);
Code: Select all
node->setMaterialTexture(0, solid.getTexture(0));
node->setMaterialTexture(1, text.getTexture(0));
What am I doing wrong? I further information is required, please give a shout.
Best wishes,
badday