It is currently May 3rd, 2024, 6:46 pm

[SOLVED][NEEDS IMPROVEMENT] Auto-resize based on text?

Get help with creating, editing & fixing problems with skins
nawmtaronyu
Posts: 64
Joined: July 21st, 2010, 3:30 am

[SOLVED][NEEDS IMPROVEMENT] Auto-resize based on text?

Post by nawmtaronyu »

2 things the first, is there a way I can make a skin with 3 images, a Left, a center (Tiled repeat) and a right, Is there a way to Tile an image say the left one is rounded in half (same with right) and the center is a 1 by 5 pixel block, I want that block to repeat within a certain area, (as a background/highlight for text)

second, is there a way I can whats above but make the size of the background adjust based on size of text area?

Kind of like the image below
You do not have the required permissions to view the files attached to this post.
Last edited by nawmtaronyu on May 16th, 2012, 7:53 am, edited 1 time in total.
Image
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Auto-resize based on text?

Post by jsmorley »

Not by having the interior background an actual image, no. Rainmeter does not know or care how long any given text is in pixels. What you could do is have those end bits be images, then use

[MeterLeft]
Meter=Image
ImageName=Left.png
X=0
Y=0

[MeterText]
Meter=String
X=R
Y=0
FontColor=255,255,255,255
FontSize=12
SolidColor=0,0,0,255
Text=Hello World

[MeterRight]
Meter=Image
ImageName=Right.png
X=R
Y=0

What you would have to do is use a FontSize, or change the size of the end images, so the box drawn behind the text (SolidColor) is the same height as the end images, when you can't specify the H= on the string meter, as to do so you also have to specify the W=, which you don't know.
nawmtaronyu
Posts: 64
Joined: July 21st, 2010, 3:30 am

Re: Auto-resize based on text?

Post by nawmtaronyu »

I have come up with a way, not as simple as I'd like but it works as simple as possible, rather than just using a title, you also need a fewmore variables, then the math does the work

title, Number of letters in that title Minus "l"s "i"s "I"s and 2 adjustments that need to look over the chart

I included the skin Take a look! it works pretty damn good.

Tell me what you think and what can be improved, is it too difficult to understand?

Oh and jsmorley your input is most helpful. you've helped me out a lot in the past! thank you!

[EDIT] it works between 3-9 number of letters, it seems to not work well even when adapted for 10 or more letters. needs more tweeking.

Ive cleaned up the math, it now works with only one variable the number of letters.

Use "Side Icon V2.zip"
You do not have the required permissions to view the files attached to this post.
Image