Jump to content

[SOLVED] image scale in tag text


photo

Recommended Posts

Posted

Hi all,

my question is about how image scale should be defined in rich text tag. I've tried different versions of the same definition in my .ui file but it always fails as unknown image option.

Here is my last code.

<?xml version="1.0" encoding="utf-8"?>
<ui version="1.0">
  <window name="rpci_wnd" export="1" height="539">
    <hbox align="expand" background="1">
      <label align="expand" width="579">
        <text rich="1">
          <image src="gui/gui_white.png" scale=%40 color="#00ff00"/>FS4<right/>This is right aligned text</text>
      </label>
    </hbox>
  </window>
</ui>

Thanks in advance.

Posted

Hi,

I'm afraid, only unscaled images can be defined at the beginning of a text line.
As a workaround you can add your image after some text and specify an image offset along the X axis by using the dx attribute:

<label align="expand" width="579">
    <text rich="1">
        FS4<image src="gui/gui_white.png" scale=%40 color="#00ff00" dx=-57/><right/>This is right aligned text</text>
</label>

We've added this issue to our internal bug tracker.
Sorry for inconvenience.

Posted

Or a little different workaround is to use a whitespace character before image tag:
 

<text rich="1"> <image src="gui/gui_white.png" scale=%55 color="#00ff00"/>FS4</text>

Anyway, this is a bug and it would be fixed :)

How to submit a good bug report
---
FTP server for test scenes and user uploads:

  • 3 weeks later...
×
×
  • Create New...