It is currently March 28th, 2024, 10:34 pm

Meter X and Y positions don't respond to keywords r and R

Get help with creating, editing & fixing problems with skins
UndergarmentPhisogue
Posts: 9
Joined: June 16th, 2020, 3:46 pm

Meter X and Y positions don't respond to keywords r and R

Post by UndergarmentPhisogue »

I've got one skin, comprised of two Meters, both the same Image, but one bigger than the other (to create a portrait-like effect, the bigger one is like a zoomed in version);
clicking onto one makes it invisible and makes the other one visible, and viceversa.
Since they're both aligned on their upper-left corners, it makes it so that they can only be positioned in the upper-left corner of the desktop, but I'd like to position them either on the bottom-right corner, or the bottom-left one, so I tried modifying the zoomed in Meter's values to make it like I wanted.
Hilarity ensues.

The following is the Vanilla code, with nothing added still:

Code: Select all

[Rainmeter]
Update=1000
DisableDragging=1

[Variables]
VarSize = (#WORKAREAWIDTH# / 12)

[MeterMiniature]
Meter=Image
ImageName=#@#preciousboy.png
Group=Frame
W = #VarSize#
PreserveAspectRatio=1
LeftMouseUpAction=[!HideMeter #CURRENTSECTION#] [!ShowMeter MeterZoomed]

[MeterZoomed]
Meter=Image
ImageName=#@#preciousboy.png
Group=Frame
Hidden=1
PreserveAspectRatio=1
W = (#VarSize# * 3)
LeftMouseUpAction=[!HideMeter #CURRENTSECTION#] [!ShowMeter MeterMiniature]
The results are:
Image
Image

Adding to [MeterZoomed]:
  • Code: Select all

    X=100R
    and

    Code: Select all

    Y=100R
    or

    Code: Select all

    X=100r
    and

    Code: Select all

    Y=100r
    give me this:
    Image
    Image

    Trying something more complex, like

    Code: Select all

    X=([MeterMiniature:X]-([MeterMiniature:W]*2))
    and

    Code: Select all

    Y=([MeterMiniature:Y]-([MeterMiniature:W]*2))
    gives me this:
    Image
    Image

    Using padding for MeterZoomed only pushes one side leaving the others still, adding a stretched effect:

    Code: Select all

    Padding = 100, 0, 0, 0
    Image
    Image

    I'm a beginner so I'm probably missing everything, can someone give me a hint?
UndergarmentPhisogue
Posts: 9
Joined: June 16th, 2020, 3:46 pm

Re: Meter X and Y positions don't respond to keywords r and R

Post by UndergarmentPhisogue »

Pardon for the images, the link in order are:
(With nothing added)
https://imgur.com/Hswz3XF
https://imgur.com/zFZJkt4

(With

Code: Select all

X=100r
and

Code: Select all

Y=100r
https://imgur.com/toSijLe
https://imgur.com/kyKjGkt

(With the more complex formula)
https://imgur.com/p0SdL3p
https://imgur.com/WRSd4QD

(With the padding)
https://imgur.com/46OkUvS
https://imgur.com/2ueznI3
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Meter X and Y positions don't respond to keywords r and R

Post by mak_kawa »

Hi UndergarmentPhisoque

I am not fully sure about your issue(s), but you mean the overlapping (or non-alignment) of the two images as shown by a red ellipse?
result.png
If so, as you have specified PreserveAspectRatio=1 for the images, the height of the [MeterMiniature] meter seems to be not 100 because the image is not square as far as I see.
Following code seems to work rightly for me:

Code: Select all

[Rainmeter]
Update=1000
DisableDragging=1

[Variables]
VarSize = (1200 / 12)
; assuming your #WORKAREAWIDTH# as 1200

[MeterMiniature]
Meter=Image
ImageName=preciousboy.png
Group=Frame
W = #VarSize#
PreserveAspectRatio=1
LeftMouseUpAction=[!HideMeter #CURRENTSECTION#] [!ShowMeter MeterZoomed]

[MeterZoomed]
Meter=Image
ImageName=preciousboy.png
Group=Frame
Hidden=1
PreserveAspectRatio=1
X=#VarSize#r
;X=[MeterMiniature:W]r
Y=[MeterMiniature:H]r
W = (#VarSize# * 3)
LeftMouseUpAction=[!HideMeter #CURRENTSECTION#] [!ShowMeter MeterMiniature]
Possibly I am misunderstanding at all... If so, sorry.

Ps.: DisableDragging=1 in the [Rainmeter] section does not work. It is only for the setting file, Rainmeter.ini as global setting, I think.
You do not have the required permissions to view the files attached to this post.
UndergarmentPhisogue
Posts: 9
Joined: June 16th, 2020, 3:46 pm

Re: Meter X and Y positions don't respond to keywords r and R

Post by UndergarmentPhisogue »

It wasn't directly what I was looking for, but it was a great hint at what I could do to make it work:

what I wanted was for the small picture to be in a corner of the desktop, and for the bigger picture to not clip outside the monitor when being shown (for example, with my Vanilla code, if I clicked on the small picture while it was in the e.g. upper right corner, the bigger picture would have been 2/3 out of the work area and I would've had to drag it back).

How I implemented the result that I wanted into it was simple:

I saw your
X=#VarSize#r
and noted that, if taking off the
Y=[MeterMiniature:H]
(it was putting the bigger picture out of bounds and I couldn't see it), and putting the value of the X in the smaller picture, the smaller picture was changing its default position inside the bigger picture.

The smaller picture is 1/3 of the bigger one, if by default it was (b=bigger, s=the smaller in the area of the bigger)
s b b
b b b
b b b

after doing the
X=#VarSize#r
in the smaller, it became
b s b
b b b
b b b

so I just did
X=((#VarSize#)*2)r
in the smaller picture (which is [MeterMiniature]) and now I can put the whole thing in the upper right corner, making it
b b s
b b b
b b b
like I wanted it.

Anyway, losing myself in the small things, now I can finally start to worry about more important things, like giving it a border and a nice frame.
Thank you man, you were a godsend