Devrim
Topic Author
Posts: 4
Joined: 09 Oct 2013, 09:25

Unity updating textblock text in RenderToTexture mode

18 Nov 2013, 16:56

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.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Unity updating textblock text in RenderToTexture mode

18 Nov 2013, 17:20

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.
 
Devrim
Topic Author
Posts: 4
Joined: 09 Oct 2013, 09:25

Re: Unity updating textblock text in RenderToTexture mode

18 Nov 2013, 19:35

Hi Fernandez;

Thanks for the quick reply.

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

cheers.

Who is online

Users browsing this forum: No registered users and 0 guests