net8floz
Topic Author
Posts: 27
Joined: 16 Dec 2025, 02:34

Rich text alignment and image options

06 Jan 2026, 20:50

I am trying to create a input prompt "Press (button.png) to do thing!" using Rich Text. There seems to be no way to make it so that the image and the text are aligned vertically. whichever one is smaller will be shoved down to the baseline. Is there any way to make them vertically aligned or to give one of the pieces a margin at the bottom?

Additionally I cannot figure out how to tell the images bitmap scaling mode to be nearest neighbor. Is this possible?
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: Rich text alignment and image options

08 Jan 2026, 16:31

We don't currently have a way to specify different alignments or margins in the bbcodes, but the source code of RichText extension is public and available in the NativeSDK for users to change it as they want. So for example you could add an attribute to the [ img ] tag to specify a margin.

Another option is to use implicit styles in the TextBlock to modify the properties of the Image, see below:
<TextBlock noesis:RichText.Text="Hello [img height=40]avatar.jpg[/img] World" FontSize="32">
  <TextBlock.Resources>
    <Style TargetType="Image">
      <Setter Property="Margin" Value="0,0,0,-10"/>
    </Style>
  </TextBlock.Resources>
</TextBlock>
Could something like that work for you?

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest