Jump to content

[SOLVED] WidgetCanvas mask


photo

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

Anthony,

 

Could you please make a sample for us?

Posted

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

Posted

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.

×
×
  • Create New...