ivan.cuevas Posted September 25, 2015 Share Posted September 25, 2015 Hi all, I want to know if it is possible ( and how) to do with image masking layers WidgetSprite . I've tried on my own without success.Thanks. Link to comment
koshachy Posted October 6, 2015 Share Posted October 6, 2015 Hi Ivan, Could you provide more information about your case? Give us some specifics about what you're trying to do, and we'll try to figure out all the ways to reach it. Thanks! Link to comment
ivan.cuevas Posted October 6, 2015 Author Share Posted October 6, 2015 Thanks for the answer and apoligies if my post wasn't clear. It's something like this. I want to create level bar filling another shape different from a rectangle. For example a bottle for water, or a heart for a health level. Link to comment
ulf.schroeter Posted October 6, 2015 Share Posted October 6, 2015 Could this be handled by some Unigine script code based on Image class by copying (or combining) mask 1-channel image into A-channel of image RGBA instance ? Link to comment
koshachy Posted October 12, 2015 Share Posted October 12, 2015 Hi Ivan, Unfortunately, you need to write your own shaders to implement this. Fortunately, we wrote a sample for you :) Short description: sprite/textures contains a sprite and a mask for it sprite/material contains a material for the sprite and a mask sprite/shaders contains vertex and fragment shaders for the material In code, we create a new WidgetSpriteShader with the sprite and assign created material. P.S. Don't forget to add binaries and core files to make the sample works! Sorry for inconvenience caused. sprite_mask.zip Link to comment
ivan.cuevas Posted October 14, 2015 Author Share Posted October 14, 2015 Many thanks for the sample. Link to comment
Recommended Posts