It is currently April 26th, 2024, 8:05 pm

button and matrix

Get help with creating, editing & fixing problems with skins
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

button and matrix

Post by Judian81 »

hey hello,

there i am again.

i try to use matrix to scale the button image.

Code: Select all

[Variables]
formScale=1

[mStateButton]
Measure=Plugin
Plugin=NowPlaying
PlayerName=[Wplayer]
PlayerType=STATE
Substitute="0":"Play.png","1":"Pause.png","2":"Play.png"

[Previous]
Meter=Button
ButtonImage=Previous.png
TransformationMatrix=(#formScale#);0;0;(#formScale#);(#paddingLeft#+(60*#formScale#));(#paddingTop#+(160*#formScale#))
this go to the right spot on the screen. there are only not clikable anyhow.

i can click in left corner, there are hidden spots where you can click. but it is acting strange.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: button and matrix

Post by Judian81 »

never mind. i had fixed it with some code.

Code: Select all

Y=(#paddingLeft#+(160*#formScale#))
X=(#paddingTop#+(55*#formScale#))
W=100
H=40
TransformationMatrix=(#formScale#);0;0;(#formScale#);-120;-329
thanks anyway
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: button and matrix

Post by Judian81 »

hmm no i can not figuer it out.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: button and matrix

Post by jsmorley »

Judian81 wrote: August 15th, 2021, 10:55 pm hmm no i can not figuer it out.
I would just not use TransformationMatrix with a Button meter. The trouble is that the points on the button image that the mouse reacts to is always based on the original size of the button image frame(s). When you scale up the meter with TransformationMatrix, that is ok for the appearence of the button, but causes a lot of really unfixable problems with the mouse.

I would not use a Button meter with anything but a 3-frame button image that is a set actual size. I would never do anything that scales the image.

I would use one image meter toggling three images, and just use various mouse actions on the meter to simulate the effect of a button. This image meter can be any size, and won't have any problem if you just scale it with W and H. I would not use TransformationMatrix though, as this will have the same problem with the mouse if you do.

Something like this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeterBack]
Meter=Image
W=100
H=100
SolidColor=47,47,47,255

[MeterImage]
Meter=Image
X=25
Y=25
ImageName=Off.png
ImagePath=#@#Images\
MouseOverAction=[!SetOption MeterImage ImageName Over.png][!UpdateMeter MeterImage][!Redraw]
MouseLeaveAction=[!SetOption MeterImage ImageName Off.png][!UpdateMeter MeterImage][!Redraw]
LeftMouseDownAction=[!SetOption MeterImage ImageName Down.png][!UpdateMeter MeterImage][!Redraw]
LeftMouseUpAction=["Notepad.exe"][!SetOption MeterImage ImageName Over.png][!UpdateMeter MeterImage][!Redraw]

Animation.gif
You do not have the required permissions to view the files attached to this post.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: button and matrix

Post by Judian81 »

oke thanks. your are my seviour.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: button and matrix

Post by jsmorley »

Judian81 wrote: August 16th, 2021, 12:22 am oke thanks. your are my seviour.
Glad to help.

Truth be told, I just wouldn't use a Button meter, period. There is no huge advantage to them over the Image meter approach I described above, and this saves you the hassle of creating a 3-frame button bitmap image, and is really the only way to have a button that can be scaled in size.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: button and matrix

Post by jsmorley »

The only issue with the Image meter approach, and it's not a trivial problem, is that the areas of the image that react the mouse are based on the entire size of the "meter". If you are using an image as a button that has areas of transparency, the mouse will be triggered any time the mouse is over any "solid" pixel in the image meter. However, if you have anything "behind" the image being used as a button, a solid skin background or some background image meter, that will cause the mouse to be detected everywhere on your image meter. This is a function of how the mouse is detected on most meter types. The exceptions are two... 1) An actual Button meter, which is designed to only react to the mouse on solid pixels of the button "image", not the "meter". 2) A Shape meter, which is designed in a similar way.

So at the end of the day you either have to live with this mouse behavior with an Image meter, use a Button meter but don't scale it, or use a Shape meter to "draw" your button.
Judian81
Posts: 180
Joined: May 6th, 2021, 2:57 pm

Re: button and matrix

Post by Judian81 »

hmm yeah. a shape is good i think. there not so hard anyway. and there good to look at. all i need is just some arrows and a some bars and a square.

but in this case a image meter is fine enoug. i do not realy care so much that it is possible to click on when there are transparrent.

maybe if the images are not so good looking then i will start with shaps
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: button and matrix

Post by jsmorley »

Judian81 wrote: August 16th, 2021, 12:55 am hmm yeah. a shape is good i think. there not so hard anyway. and there good to look at. all i need is just some arrows and a some bars and a square.

but in this case a image meter is fine enoug. i do not realy care so much that it is possible to click on when there are transparrent.

maybe if the images are not so good looking then i will start with shaps
Fair enough... Images certainly don't "scale" as nicely as vector Shapes do.