Page 1 of 1

Unity updating textblock text in RenderToTexture mode

Posted: 18 Nov 2013, 16:56
by Devrim
Hi;

I can not update a textblock's text that is rendered on a plane with a rendertarget assigned to it.
When setting a new value, the previous text is not cleared.

Probably it is a clearing issue of the target buffer but could not figure out how to clear it. I have set my GUI camera's clear flag to DepthOnly and set the target textures depthbuffer to 16bit, but no luck.

What is the correct way to achieve this.

Thanks.

Re: Unity updating textblock text in RenderToTexture mode

Posted: 18 Nov 2013, 17:20
by sfernandez
Try to set the Background of xaml root element to Transparent. For example:
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Background="Transparent">
    <TextBlock x:Name="txt" Text="Some text"/>
</Grid>
Setting the background on the root element is the way we let the user decide if surface must be cleared or not. This only occurs if root element fills the entire screen.

Re: Unity updating textblock text in RenderToTexture mode

Posted: 18 Nov 2013, 19:35
by Devrim
Hi Fernandez;

Thanks for the quick reply.

That did the trick. I can now update by textblocks.

cheers.