It is currently April 20th, 2024, 1:11 am

Meters behaving oddly (positions)

Get help with creating, editing & fixing problems with skins
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Meters behaving oddly (positions)

Post by Krainz »

First of all, I made a test skin to get the hang of Containers

Code: Select all

[Rainmeter]
Author=Krainz
Update=864000
MiddleMouseDownAction=!DeactivateConfig

[Variables]
UC=[!Update][!Redraw]
GH=[!ToggleConfig "AsperiaSuite\Gamehall\GameScreen1" "GameScreen1-bg.ini"][!ToggleConfig "AsperiaSuite\Gamehall\Tiles" "GameScreen1-Tiles.ini"]
scrollproportion=(Clamp((#screenareawidth#/1366),1,1.1713))
HeightBig=(366*#scrollproportion#)
HeightSmall=(319*#scrollproportion#)
WidthBig=(185*#scrollproportion#)
WidthSmall=(161*#scrollproportion#)

[Icon1]
Meter=Image
SolidColor=30,20,80,255
H=#HeightBig#
W=#WidthBig#
y=r
X=0
RightMouseUpAction=[!SetOption Dropdown1 X $MouseX$][!SetOption Dropdown1 Y $MouseY$][!SetOption Dropdown1C X $MouseX$][!SetOption Dropdown1C Y $MouseY$][!ShowMeterGroup Dropdown1][!Update *]

[RightClick]
Meter=String
MeterStyle=TextStyle
Text="Right Click this meter anywhere"
X=15
Y=(#HeightBig#/2)
DynamicVariables=1
Hidden=0



[Dstyle]
SolidColor=20,20,20,220
Y=0
W=(138*#scrollproportion#)
H=(63*#scrollproportion#)
X=(#WidthBig#)+5R
DynamicVariables=1

[Dropdown1]
Meter=Image
MeterStyle=Dstyle
X=0
DynamicVariables=1
Hidden=1
Group=Dropdown1

[Dropdown1C]
Meter=Image
MeterStyle=Dstyle
Y=r
X=r
DynamicVariables=1

[TextStyle]
SolidColor=0,0,0,1
Text="Test"
FontFace=Calibri
FontSize=(9*#scrollproportion#)
FontColor=230,230,230,255
AntiAlias=1
Padding=0,0,(80*#scrollproportion#),0
W=(138*#scrollproportion#)
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor 255,255,255,255][!SetOption #CURRENTSECTION# SolidColor 0,191,255,255][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor 230,230,230,255][!SetOption #CURRENTSECTION# SolidColor 0,0,0,1][!UpdateMeter #CURRENTSECTION#][!Redraw]
Hidden=1
DynamicVariables=1

[Icon1Text]
Meter=String
MeterStyle=TextStyle
Text="  Icon 1"
X=0
Y=5
DynamicVariables=1
Container=Dropdown1C
Group=Dropdown1
If you run the above skin, you'll see that everything is fine.

However...

When I implement these meters (as well as the RightMouseUpAction) in my larger .ini file, this ends up happening when I right click the first icon:

Image

You can see that the dropdown meter ends up being ~200 pixels off where it's supposed to be (at mouse X and Y).

That's very odd considering that I didn't change a single thing (that I can remember, despite meter names and style names) from the test example.

Skin package
GameScreen1-Tiles.ini update (the one in the package is out of date) (dropbox mirror) (also make sure to delete AsperiaSuite\GameScreen1\GameScreen1-bg.ini)

EDIT: I think I solved the container issue, now what remains is the meter refusing to go properly to $MouseX$ and $MouseY$

EDIT: I think I found the issue. Mouseovering a Container meter seems to mess up $MouseX$ and $MouseY$. The issue was resolved by removing Container=Container from all [Dropdown1] to [Dropdown13] meters, as well as using the following formula:

Code: Select all

RightMouseUpAction=[!SetOption Dropdown1 X ($MouseX$+[ContainerX:X]+11)][!SetOption Dropdown1 Y ($MouseY$+[ContainerX:Y])]
instead of

Code: Select all

RightMouseUpAction=[!SetOption Dropdown1 X ($MouseX$)][!SetOption Dropdown1 Y ($MouseY$)]
Now why that happened is something I don't understand.

(sidenote: [ContainerX] has the same dimensions of [Container] but is used for some mouseover and mouseleave actions)

EDIT2: The above solution only works for Dropdown1. I'm at a complete loss right now.

EDIT3: Found a formula that works for Dropdown2 across several different screen resolutions:

Code: Select all

RightMouseUpAction=[!SetOption Dropdown2 X ($MouseX$+[Index2Icon:X])]
I have no idea at all why it works (or why Dropdown2 just doesn't go straight to MouseX) but it works.
Last edited by Krainz on December 18th, 2019, 5:06 am, edited 2 times in total.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Meters behaving oddly (positions)

Post by Mor3bane »

i just noticed that you have a selection effect - the blue-ish around the game window.

Could the size of that image be affecting your appearance?

I know transparencies sometimes still register at the edges - so perhaps that is your issue? Or simply the location of that effect?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Meters behaving oddly (positions)

Post by Krainz »

I stripped down my code, removing all highlights, overlays, shadows and image masks. The meter still doesn't move properly to $MouseX$ and $MouseY$
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Meters behaving oddly (positions)

Post by Mor3bane »

are you centring or averaging the width?

you may want to explore using centre in the effort to avoid any math issues
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Meters behaving oddly (positions)

Post by Krainz »

I don't understand, why should this impact the behavior of the meter's position?

The test skin is using the same width and height formulas and is behaving as it should. However, when I try to use those meters on the larger skin file, with the same width and height formulas, it goes all wacky.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Meters behaving oddly (positions)

Post by mak_kawa »

Hi Krainz

I am not sure how does your skin work...but your skin code simply loaded to my Rainmeter seems to work fine.
test2.gif
If so, the problem is somewhere other than posted code?
You do not have the required permissions to view the files attached to this post.
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: Meters behaving oddly (positions)

Post by Krainz »

mak_kawa wrote: December 17th, 2019, 12:27 pm Hi Krainz

I am not sure how does your skin work...but your skin code simply loaded to my Rainmeter seems to work fine.
test2.gif
If so, the problem is somewhere other than posted code?
Yes the problem happens in the larger skin posted at the bottom of the post:
Krainz wrote: December 15th, 2019, 10:30 pm Skin package
GameScreen1-Tiles.ini update (the one in the package is out of date) (dropbox mirror)
If you load GameScreen1-Tiles.ini, you might have to choose a folder in the settings skin. A folder with some files (preferably shortcuts) in it, so the FileView plugin can work

EDIT: I think I found the issue. Mouseovering a Container meter seems to mess up $MouseX$ and $MouseY$. The issue was resolved by removing Container=Container from all [Dropdown1] to [Dropdown13] meters, as well as using the following formula:

Code: Select all

RightMouseUpAction=[!SetOption Dropdown1 X ($MouseX$+[ContainerX:X]+11)][!SetOption Dropdown1 Y ($MouseY$+[ContainerX:Y])]
instead of

Code: Select all

RightMouseUpAction=[!SetOption Dropdown1 X ($MouseX$)][!SetOption Dropdown1 Y ($MouseY$)]
Now why that happened is something I don't understand.

(sidenote: [ContainerX] has the same dimensions of [Container] but is used for some mouseover and mouseleave actions)

EDIT2: The above solution only works for Dropdown1. I'm at a complete loss right now.

EDIT3: Found a formula that works for Dropdown2 across several different screen resolutions:

Code: Select all

RightMouseUpAction=[!SetOption Dropdown2 X ($MouseX$+[Index2Icon:X])]
I have no idea at all why it works (or why Dropdown2 just doesn't go straight to MouseX) but it works.