It is currently May 13th, 2024, 9:58 am

screenareawidth symmetrical text query

Get help with creating, editing & fixing problems with skins
dv-ent
Posts: 62
Joined: November 13th, 2011, 11:43 am

screenareawidth symmetrical text query

Post by dv-ent »

so im making a bar using the nowplaying plugin using the full #screenareawidth# and ideally i would like the text of the artist and songtitle the same length apart symettrically either side of the middle icon.

obviously the text changes length for each song title and artist so how would i go about this ?

ie. not like the attached image !

many thanks in advance
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: screenareawidth symmetrical text query

Post by jsmorley »

There is no reliable way to measure the "length" of a string in Rainmeter or even Lua, so I think your best bet is to left justify (StringAlign) the artist, center the icon, and right justify the song title.
dv-ent
Posts: 62
Joined: November 13th, 2011, 11:43 am

Re: screenareawidth symmetrical text query

Post by dv-ent »

thx - i guessed you were going to say that !

could i postfix the artist meter from the song title meter and get rid of the icon - then at least it would all be centered ?
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: screenareawidth symmetrical text query

Post by Seahorse »

What about centering text/icon/text on 3 points, using 1/4 of screenarea, 1/2 & 3/4s or there abouts, at least the text would orginate in the same spot every time?
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: screenareawidth symmetrical text query

Post by jsmorley »

dv-ent wrote:thx - i guessed you were going to say that !

could i postfix the artist meter from the song title meter and get rid of the icon - then at least it would all be centered ?
Sure, you don't need to literally use postfix or prefix either.

[MeterSong]
Meter=String
X=(#SCREENAREAWIDTH# / 2)
Y=20
MeasureName=MeasureArtist
MeasureName2=MeasureTitle
StringAlign=Center

Something like that would work.
dv-ent
Posts: 62
Joined: November 13th, 2011, 11:43 am

Re: screenareawidth symmetrical text query

Post by dv-ent »

bingo !

you sir, are a legend :bow2:
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: screenareawidth symmetrical text query

Post by jsmorley »

dv-ent wrote:bingo !

you sir, are a legend :bow2:
In my own mind... ;-)

Probably want to use Text= on the meter, so you can so some formatting like:

Text=%1 - %2
dv-ent
Posts: 62
Joined: November 13th, 2011, 11:43 am

Re: screenareawidth symmetrical text query

Post by dv-ent »

yup that better..

..and theres no way to put an image in the middle of Text=%1 - %2 ??
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: screenareawidth symmetrical text query

Post by jsmorley »

dv-ent wrote:yup that better..

..and theres no way to put an image in the middle of Text=%1 - %2 ??
No way to "embed" it in the text, but you could center the icon behind the string meter, with an alpha set low enough that it is "faded" behind the string, or above or below the string meter with full alpha. Since the size of the icon is a "known" thing. You can easily center it as well.
dv-ent
Posts: 62
Joined: November 13th, 2011, 11:43 am

Re: screenareawidth symmetrical text query

Post by dv-ent »

thats ok - it wouldnt look right anyway.

but thanks again !!

...my quest for symmetry is surely a sign of OCD ;)