It is currently March 29th, 2024, 5:53 am

Is it possible to limit the coordinates of a meter?

Get help with creating, editing & fixing problems with skins
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Is it possible to limit the coordinates of a meter?

Post by kyriakos876 »

Hello, I am currently working on the skin below. If you install the skin and mouse over the black line you will see some icons popping out, I wish to make the meters stay on screen. The icons will pop out depending on the mouse's position when it mouses-over the black line, if the mouse if on of the screen tho, the top icons will go out of the screen and respectively if you mouse-over on the bottom of the black line.

My question is if I can somehow limit the X and the Y on the meter below:

Code: Select all

[Option1]
Group=Options
Meter=Image
ImageName=#@#Images\Facebook.png
ImageAlpha=#Alpha#
W=50
H=50
X=(#Radius#*cos(290*PI/180))
Y=([MeasureMouseY]+#Radius#*sin((290*PI)/180)-[#CURRENTSECTION#:W]/2)
DynamicVariables=1
Hidden=1
For example, X will be able to get a min value of 100 and a max value of 800 and so will the Y.

I hope you understand what I mean. If not, ask away and I will try to elaborate even further.

-Thanks in advance.
Last edited by kyriakos876 on August 28th, 2017, 8:53 pm, edited 1 time in total.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Is it possible to limit the coordinates of a meter?

Post by FreeRaider »

What you want?
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Is it possible to limit the coordinates of a meter?

Post by kyriakos876 »

FreeRaider wrote:What you want?
I want the icons to limit on the top and the bottom of the screen, regardless of the mouse's position.

see this gif and you should understand:

https://media.giphy.com/media/3ohhwfWRacSRTVpiPS/giphy.gif
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Is it possible to limit the coordinates of a meter?

Post by FreeRaider »

In my opinion, that is not possible, because the radius must also be considered.

Anyway you can use a conditional operation, in this format X= <condition> ? <expr. if true.> : <expr. if false.>.

Have a look at https://docs.rainmeter.net/manual-beta/formulas/ (at the end of that page)



Another solution is to divide the vertical black bar into 3 bars and set the mouseaction only to the middle one.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Is it possible to limit the coordinates of a meter?

Post by kyriakos876 »

FreeRaider wrote:In my opinion, that is not possible, because the radius must also be considered.

Anyway you can use a conditional operation, in this format X= <condition> ? <expr. if true.> : <expr. if false.>.

Have a look at https://docs.rainmeter.net/manual-beta/formulas/ (at the end of that page)



Another solution is to divide the vertical black bar into 3 bars and set the mouseaction only to the middle one.
I found a solution using conditions as you proposed and adding this:

Code: Select all

Y=((([MeasureMouseY]<=280)*280)+(([MeasureMouseY]>280) && ([MeasureMouseY]<=(#SCREENAREAHEIGHT#-280)))*[MeasureMouseY]+([MeasureMouseY]>(#SCREENAREAHEIGHT#-280))*(#SCREENAREAHEIGHT#-280)+#Radius#*sin((290*PI)/180)-[#CURRENTSECTION#:W]/2)
to every meter respectively, fixed it for the top of the screen, should find another condition now for the bottom which is just changing the 280 to something else. Thanks for the idea :)
Last edited by kyriakos876 on August 28th, 2017, 8:45 pm, edited 1 time in total.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Is it possible to limit the coordinates of a meter?

Post by FreeRaider »

Ah ok.

Glad to help.