How to add mask effect to a image

zzzgundum2003

11-10-2013 07:15:08

I used setMaskPick but there is nothing happen in my image, so how should I do if I want to add mask in the image?

mask
[attachment=2]1.jpg[/attachment]

image
[attachment=1]2.jpg[/attachment]


MyGUI::StaticImagePtr flagImage = myGUI->createWidget<MyGUI::StaticImage>("StaticImage", MyGUI::IntCoord(), MyGUI::Align::Default, "Main");
flagImage->setSize(64, 64);
flagImage->setPosition(winWidth * 0.5 - 32, 10);
string flagName = player->tag + ".png";
flagImage->setImageTexture(flagName);
flagImage->setMaskPick("flag_screen_mask.png");


but the result.....
[attachment=0]3.jpg[/attachment]

Altren

11-10-2013 11:55:02

setMaskPick is used for creating widgets with non-rectangle input form, it doesn't affect visuals of a widget.
MyGUI gives no way to do any modifications to images. You should use some Ogre's functionality to merge images and render into texture, or something like that.

zzzgundum2003

11-10-2013 12:42:09

setMaskPick is used for creating widgets with non-rectangle input form, it doesn't affect visuals of a widget.
MyGUI gives no way to do any modifications to images. You should use some Ogre's functionality to merge images and render into texture, or something like that.

Thanks for answering~
Ouch.................So There is no way to make the UI like this in OGRE+MyGUI?
[attachment=0]4.jpg[/attachment]

Altren

12-10-2013 12:44:12

Simply use png images with alpha where necessary. Or prerender mixed images + mask in runtime and use those.