It is currently April 27th, 2024, 5:52 am

Add text left to an Image

Get help with creating, editing & fixing problems with skins
Bugmenot
Posts: 25
Joined: October 7th, 2016, 9:38 am

Add text left to an Image

Post by Bugmenot »

Hi,

Iam trying to place some text on the left side of an image but can't get it to work its always cut. I tried several things but no luck.
The Skin is placed on the right side of the screen via Rainmeter.ini. This is the code:

Code: Select all

[Icon2]
Meter=Image
SolidColor=255,0,255,1
W=(#ScreenAreaHeight#/15)
H=(#ScreenAreaHeight#/15)
Y=(#ScreenAreaHeight#/11)r
AntiAlias=1
ImageName=#CURRENTPATH#images\share.png
MouseOverAction=[!SetOption Icon2 ImageTint 0,191,255]
MouseLeaveAction=[!SetOption Icon2 ImageTint 255,255,255]

[App2Text]
Meter=String
FontFace=Arial
FontColor=111,110,110
FontSize=45
Text=Application_with_a_name
w=111
x=-50
Y=(#ScreenAreaHeight#/0)r
Text=Valami
StringAlignt=Right
DynamicVariables=1
ClipString=2
Thanks in advance
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Add text left to an Image

Post by Yincognito »

Bugmenot wrote: September 21st, 2023, 2:55 pm Hi,

Iam trying to place some text on the left side of an image but can't get it to work its always cut. I tried several things but no luck.
The Skin is placed on the right side of the screen via Rainmeter.ini. This is the code:

Code: Select all

[Icon2]
Meter=Image
SolidColor=255,0,255,1
W=(#ScreenAreaHeight#/15)
H=(#ScreenAreaHeight#/15)
Y=(#ScreenAreaHeight#/11)r
AntiAlias=1
ImageName=#CURRENTPATH#images\share.png
MouseOverAction=[!SetOption Icon2 ImageTint 0,191,255]
MouseLeaveAction=[!SetOption Icon2 ImageTint 255,255,255]

[App2Text]
Meter=String
FontFace=Arial
FontColor=111,110,110
FontSize=45
Text=Application_with_a_name
w=111
x=-50
Y=(#ScreenAreaHeight#/0)r
Text=Valami
StringAlignt=Right
DynamicVariables=1
ClipString=2
Thanks in advance
A Rainmeter skin will not expand to its top or left side when using negative X or Y coordinates for your meters, hence they are truncated. This is normal to happen. What you probably want to do is to place the image meter towards the right as necessary (by increasing its X), so that the string meter can fit in at the left (say, by setting its X to 0). Another possibility would be to place your string meter before your image in the code, set the former's X to 0 or something positive, then use relative positioning for the latter's X (e.g. 5R or similar).

By the way, you have a typo in the StringAlignt line. Once it's valid (which is not right now because of the typo), string alignment in a String meter also influences the position of the text, since for the right alignment, the X represents the right edge of the meter (and not the left one, like for typical left alignment).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Add text left to an Image

Post by CodeCode »

Yincognito wrote: September 21st, 2023, 5:52 pm A Rainmeter skin will not expand to its top or left side when using negative X or Y coordinates for your meters, hence they are truncated. This is normal to happen. What you probably want to do is to place the image meter towards the right as necessary (by increasing its X), so that the string meter can fit in at the left (say, by setting its X to 0). Another possibility would be to place your string meter before your image in the code, set the former's X to 0 or something positive, then use relative positioning for the latter's X (e.g. 5R or similar).

By the way, you have a typo in the StringAlignt line. Once it's valid (which is not right now because of the typo), string alignment in a String meter also influences the position of the text, since for the right alignment, the X represents the right edge of the meter (and not the left one, like for typical left alignment).
There is a bit more that might help you get your desired result/s.

If you make room for your string to show, by moving the X value greater than zero - by the length of your string (50?), everything in the skin will also have to be moved to that much further than the default start points. Otherwise it will come out all messed up.

Break out your calculator and simply add (50) to every X value. The same will apply if you want to put something at the top. In that case add your value to every Y value. Hopefully with some trial and error you ccan get it looking like you intend - with no random things out of order.

You might make a copy of your skin before editing since notepad has only 1 step of undo available in it.
So perhaps finding one of many test editors that are free - like notepad++ or sublimetext3. Those editors are very versatile and have a lot of undo (ctrl+z) available by default.

Feel free to give it a go, then come back if anything gets too complex for you. :thumbup:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
Bugmenot
Posts: 25
Joined: October 7th, 2016, 9:38 am

Re: Add text left to an Image

Post by Bugmenot »

Simply adding some X was the solution :D
Increasing the X Value in the Rainmeter.ini and setting an X for the Icon and now it looks exactly as I want :)
Thanks alot to both of you :bow:
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Add text left to an Image

Post by balala »

Bugmenot wrote: September 22nd, 2023, 3:25 pm Increasing the X Value in the Rainmeter.ini
Nowhere in the Rainmeter.ini (this is the file storing global Rainmeter settings) a X value exists. There is a WindowX for each config stored there, but not an X. WindowX is the horizontal position of the skin in whose section you have this option. Increasing it, you move the whole skin to right.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Add text left to an Image

Post by CodeCode »

Bugmenot wrote: September 22nd, 2023, 3:25 pm Simply adding some X was the solution :D
Increasing the X Value in the Rainmeter.ini and setting an X for the Icon and now it looks exactly as I want :)
Thanks alot to both of you :bow:
I think he is confusing the main ini with 'rainmeter ini'. Otherwise nothing would have happened.

Glad you got it working!
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.