It is currently May 6th, 2024, 7:53 pm

[Solved] Multiple colors in line...

Get help with creating, editing & fixing problems with skins
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

[Solved] Multiple colors in line...

Post by Bgdrls »

Hi guys,

Is any way to add two different colors i one meter line, but both to be StringAlign=CENTER

For exaple, random quote text:
This part is stable: This text area is for changeable random quotes!
So if green text changed, to expand both together with StringAlign=CENTER?

TIA
Last edited by Bgdrls on June 22nd, 2011, 10:09 am, edited 1 time in total.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Multiple colors in line...

Post by Seahorse »

Might be possible using the technique in this post.
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: Multiple colors in line...

Post by Bgdrls »

@Seahorse sry mate i add wrong example, so first post edited.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Multiple colors in line...

Post by jsmorley »

You would always need two string meters to get two colors. Period.

So now the problem becomes centering them together, and since there is no way to know the length of a string meter in pixels in Rainmeter, I don't think there is going to be any reliable way to do that, even with Lua. Fonts are pretty variable in how they are constructed and there is no certain way to use the name and size of a font and get exactly how many pixels a given text string is going to use. You are going to want to left or right justify this pair of strings, which is then trivial to get two colors with two meters.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Multiple colors in line...

Post by smurfier »

Try using a Monospace font. Each character, including spaces, takes up the same amount of space.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
Bgdrls
Posts: 66
Joined: April 29th, 2011, 1:03 am

Re: Multiple colors in line...

Post by Bgdrls »

Tnx a lot for the explanations guys :)