It is currently July 10th, 2020, 12:37 pm

WindowXY formulas

Help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 411
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

WindowXY formulas

Post by sl23 »

1. I've tried to specify WindowX=50% - 175 to get an exact central position for my skin but to no avail. Is there some way to make a formula that works, or are these two terms incompatible?

2. Also, WindowY doesn't place a skin past the desktop area, yet you can specify that position with this WindowY=(#ScreenAreaY# + (#ScreenAreaHeight# - 40)) Can I use a % value to place a skin over the TaskBar?

3. In addition to the current % / R / B / @ modifiers, could another be added? For example... WindowX=50%C where the C represents the centre of the skin.

Thanks for your help :D
User avatar
Active Colors
Moderator
Posts: 579
Joined: February 16th, 2012, 3:32 am

Re: WindowXY formulas

Post by Active Colors »

sl23 wrote:
June 30th, 2020, 12:01 pm
1. I've tried to specify WindowX=50% - 175 to get an exact central position for my skin but to no avail. Is there some way to make a formula that works, or are these two terms incompatible?

2. Also, WindowY doesn't place a skin past the desktop area, yet you can specify that position with this WindowY=(#ScreenAreaY# + (#ScreenAreaHeight# - 40)) Can I use a % value to place a skin over the TaskBar?

3. In addition to the current % / R / B / @ modifiers, could another be added? For example... WindowX=50%C where the C represents the centre of the skin.

Thanks for your help :D
You need to use AnchorX. WindowX specifies the starting left point, and then with Anchor X you tell how it should be aligned. Thus, putting AnchorX=50% will do the desired effect.

Code: Select all

WindowX=50%
AnchorX=50%
Last week there were new skin position bangs added https://forum.rainmeter.net/viewtopic.php?f=129&t=35565.
Check the messages there to get more info, specifcially Yincognito's message that described Anchor feature well as I didn't know myself about it before.
User avatar
jsmorley
Developer
Posts: 21009
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WindowXY formulas

Post by jsmorley »

And this WindowX=50% - 175 can't work.

Formulas in WindowX/WindowY/AnchorX/AnchorY work like this WindowX=(25 * 2)%

Where the formula must be inside of (parentheses), and any modifier(s) must be outside the parentheses. So Rainmeter will evaluate the formula inside the parentheses, and then take that number and use it with the modifier.
User avatar
sl23
Posts: 411
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: WindowXY formulas

Post by sl23 »

Thanks, I wasn't too sure how the anchor worked. I checked the manual, but thought there may be some easier way to specify a central position just like the StringAlign mentioned. A 50%C would be easier, but maybe it's not easy to program RM for such a simple feature when it can be done by using the Anchor.

Do you know if question 2 in my OP is possible? Thanks again for your help AC :thumbup:

Just saw your post as I was about to post this Jeff. I did find that out but wasn't sure if I did it wrong or it wasn't possible to do it the way I wanted. No problem tho I appreciate being put right ;-)
User avatar
Active Colors
Moderator
Posts: 579
Joined: February 16th, 2012, 3:32 am

Re: WindowXY formulas

Post by Active Colors »

sl23 wrote:
June 30th, 2020, 1:30 pm
Thanks, I wasn't too sure how the anchor worked. I checked the manual, but thought there may be some easier way to specify a central position just like the StringAlign mentioned. A 50%C would be easier, but maybe it's not easy to program RM for such a simple feature when it can be done by using the Anchor.

Do you know if question 2 in my OP is possible? Thanks again for your help AC :thumbup:

Just saw your post as I was about to post this Jeff. I did find that out but wasn't sure if I did it wrong or it wasn't possible to do it the way I wanted. No problem tho I appreciate being put right ;-)
I forgot to write about your second point. I personally haven't tried this feature much but during my experiments I noticed that my skin was not going past the screen. It was caused due to the default skin setting to keep the skin on screen. Try to uncheck it through — right mouse click on the skin > "Settings" > remove check mark from "Keep on screen".

In my opinion I think it is quite straightforward and scalable method to set the central position for a skin. I am not sure what you consider by easier way. You can use Default Settings and have the position already set in your skin file instead of accessing global Rainmeter.ini
User avatar
jsmorley
Developer
Posts: 21009
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WindowXY formulas

Post by jsmorley »

Yes, if you want a skin to "start" centered on the screen, with snap-to-edges turned off, with stay-on-screen turned off, and with the Z-position set to "on desktop", you might use this in the skin .ini file:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
DefaultWindowX=50%
DefaultWindowY=50%
DefaultAnchorX=50%
DefaultAnchorY=50%
DefaultAlwaysOnTop=-2
DefaultKeepOnScreen=0
DefaultSnapEdges=0
Now keep in mind that these "default" settings only impact the skin when it is loaded for the first time. If you move it, or change the other settings after loading it the first time, those changes are "permanent", unless and until you clear the [ConfigName] out of Rainmeter.ini entirely.

This why, at the end of the day, Layouts are your friend. Use them. I probably load my standard Layout 4 or 5 times a day, as I work on other folks' skins, and test and try things that I do to answer questions here on the forums. I simply don't allow my Rainmeter.ini to get "dirty" at all. When I'm done messing with a new skin, my next act is to load my nice clean Layout.
User avatar
sl23
Posts: 411
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: WindowXY formulas

Post by sl23 »

Thanks for your help :thumbup: