How to align an image size according to the text size inside it?
#1
Hi!
I have an idea to show the wallpapers names inside a image frame (.png).
But I want this frame modify his size according to text size.
This is possible? If yes, how I do that?

Thanks!
Supercalifragilisticexpialidocious! (inscribed in large friendly letters)
My hardware is a Raspberry Pi 3b (with LibreELEC)
Reply
#2
Use a button control. Button controls support textures and auto width based on the textsize.

Code:

<control type="button">
<width>auto</width>
<height>150</height>
<textoffsetx>10</textoffsetx>
<label>bla bla bla</label>
<texturenofocus border="5">myframe.png</texturenofocus>
<texturefocus border="5">myframe.png</texturefocus>
<onclick>noop</onclick>
</control>

See Button_control (wiki)

Edit:
I use this method for the mpaa ratings.

Image
Embuary | Skin | Helper | Info | Repo | GitHub
Reply
#3
Thanks, @sualfred!
I may have used a wrong word when I said "frame".
In this case is this specifically image https://github.com/bartolomesoriano/skin...ePanel.png
I don't get a good result, look
Image
The background image don't look like the original.

The code I used
<control type="button">
<width>auto</width>
<height>40</height>
<font>FanartTitleFont</font>
<textoffsetx>10</textoffsetx>
<label>bla bla bla</label>
<texture flipx="true" flipy="true">common/TimePanel.png</texture>
<onclick>noop</onclick>
</control>

What I'm doing wrong?
Supercalifragilisticexpialidocious! (inscribed in large friendly letters)
My hardware is a Raspberry Pi 3b (with LibreELEC)
Reply
#4
You mean stretched texture etc? You have to play with the border attribute like.
Code:
<texture border="20,20,20,20" colordiffuse="$VAR[AccentColor]">items/focus.png</texture>

the digits define the pixels from each side that should not be streched. Keep your texture as small as possible, otherwise it will not work in small sizes.
Embuary | Skin | Helper | Info | Repo | GitHub
Reply
#5
Thanks again, @sualfred!
But unfortunately I think I don't have knowledge to do what I want.
I found this thread, and if it still updated I think this is impossible.
Supercalifragilisticexpialidocious! (inscribed in large friendly letters)
My hardware is a Raspberry Pi 3b (with LibreELEC)
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
How to align an image size according to the text size inside it?00