-
- oraccuglia
- Posts: 1
- Joined:
Layout/size for inline, async-loaded textures
Hi, I'm having trouble getting images to work inline with text when that image has to be loaded asynchronously in Unity. I can reproduce the problem with a text block like this:
...where `Image` binds to a `UnityEngine.Texture` that's not immediately provided.
The result is the two text elements next to each other; the GUI inspector resource adorner shows the image outside the visible area of the text: If the text has a hover style change (e.g. changing `TextBlock.Foreground` to a new brush), the image takes up space, but the overall layout doesn't react to the space taken up (and the suffix text is cut off, in a way it wouldn't be if I put in a much longer message with no images). My overall goal is to support controller input hints in localized text; my implementation is built alongside Noesis' RichText bbcode tags, which is why I'm dealing with images and inline text blocks - and threading constraints mean I need to supply the image asynchronously. Is there something I could do differently to get the size/layout to propagate right?
Code: Select all
<TextBlock>
<Run>Prefix Text</Run>
<InlineUIContainer>
<Image Source="{Binding Image}" />
</InlineUIContainer>
<Run>Suffix Text</Run>
</TextBlock>
The result is the two text elements next to each other; the GUI inspector resource adorner shows the image outside the visible area of the text: If the text has a hover style change (e.g. changing `TextBlock.Foreground` to a new brush), the image takes up space, but the overall layout doesn't react to the space taken up (and the suffix text is cut off, in a way it wouldn't be if I put in a much longer message with no images). My overall goal is to support controller input hints in localized text; my implementation is built alongside Noesis' RichText bbcode tags, which is why I'm dealing with images and inline text blocks - and threading constraints mean I need to supply the image asynchronously. Is there something I could do differently to get the size/layout to propagate right?
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Layout/size for inline, async-loaded textures
Hello, I was able to reproduce your issue, when the image is set the TextBlock is not correctly invalidated and measured again.
Could you please report it in our bugtracker?
Could you please report it in our bugtracker?
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Layout/size for inline, async-loaded textures
We fixed this issue for the next 3.2.7 version.
Who is online
Users browsing this forum: No registered users and 5 guests