anthony.liot2 Posted March 16, 2015 Posted March 16, 2015 Hi, I have a WidgetCanvas drawing a white polygon, I want to use this canvas like a mask from another widget (WidgetSpriteViewport). What is the best way to do that ? I try to grab a mask picture from a WidgetCanvas but it's seems not possible. May be I am going in the wrong way. Any suggestion ? Thanks Tony
unclebob Posted March 17, 2015 Posted March 17, 2015 Hi Anthony, It's better to reverse things: first render an Image from WidgetSpriteViewport and then draw polygon in WidgetCanvas with proper texcoords using that image you've rendered before.
anthony.liot2 Posted March 17, 2015 Author Posted March 17, 2015 Hi Andrey, The texcoords is working well thank you. Now I want to export the result into an Image, but the Widget Canvas is not expand to the size of the window, just a quarter, not sure if I must use video_grab or if there is another way to do that. Tony
anthony.liot2 Posted March 18, 2015 Author Posted March 18, 2015 Hi Andrey, I will try to do that asap ... But I can try to simplify the trouble : two widget printed on the window, one is a WidgetSpriteViewport the second a WidgetCanvas. The WidgetCanvas is drawing a rectangle using the texcoord from the renderImage of the WSV. Now I want save the result of the WidgetCanvas int an Image. I want something similar to : http://img35.imageshack.us/img35/6779/jumelles2.jpg Thanks
unclebob Posted March 21, 2015 Posted March 21, 2015 Anthony, You can just draw one fullscreen sprite (via WidgetSprite) with transparent texture and proper blend mode, no need to use render textures and masks in that case.
Recommended Posts