It is currently May 27th, 2020, 3:51 am

Increasing Size on Mouse Over?

Help with creating, editing & fixing problems with skins
cptdeadman
Posts: 3
Joined: May 13th, 2020, 9:32 pm

Re: Increasing Size on Mouse Over?

Post by cptdeadman »

balala wrote:
September 2nd, 2018, 5:32 pm
I'm glad. :17good
Hi, I am trying this and the problem is if the icon is not a simple box I mean it's an image, that image animation is not "centered". The problem is here but I can't figure it out:

Code: Select all

X=(10*(10-#Size#))
Y=(5*(10-#Size#))
I have this:

Code: Select all

[Rainmeter]
Update=-1
LeftMouseUpAction=["D:\"]

[Variables]
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "MtBackground"][!Redraw]
Size=0
Wait=15

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Up,#Wait#,10
Up=[!SetVariable Size "(Clamp((#Size#+1),0,10))"]#U#
ActionList2=Repeat Down,#Wait#,10
Down=[!SetVariable Size "(Clamp((#Size#-1),0,10))"]#U#
DynamicVariables=1

[MtBackground]
Meter=IMAGE
imagename= cat_icon.png
X=(10*(10-#Size#))
Y=(2.5*(10-#Size#))
W=(256+20*#Size#)
H=(256+20*#Size#)
MouseOverAction=[!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
DynamicVariables=1
Thanks in advance :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Increasing Size on Mouse Over?

Post by balala »

cptdeadman wrote:
May 13th, 2020, 9:35 pm
Hi, I am trying this and the problem is if the icon is not a simple box I mean it's an image, that image animation is not "centered". The problem is here but I can't figure it out:
Certainly would be much better to have the cat_icon.png image, however I think I can tell even this way what's not going well. Problem is that you have a square image (its width and height are both set initially to 256, then both are increasing with 20 pixels on each change of the Size variable), but when start resizing it, the Y option (so its vertical position) is reduced only with 2.5 pixels per one change of the Size variable. But its height is increasing with 200 pixels (from 256 to 456). So, initially the vertical position of the meter was 25 and its height was 256 and after the animation became 0 and 456, respectively. This certainly leads to a displacement of the increased meter.
The solution is to replace the Y option of the [MtBackground] meter with Y=(10*(10-#Size#)) (this moves the meter a little bit down, from where it initially was placed).
cptdeadman
Posts: 3
Joined: May 13th, 2020, 9:32 pm

Re: Increasing Size on Mouse Over?

Post by cptdeadman »

balala wrote:
May 14th, 2020, 7:30 am
Certainly would be much better to have the cat_icon.png image, however I think I can tell even this way what's not going well. Problem is that you have a square image (its width and height are both set initially to 256, then both are increasing with 20 pixels on each change of the Size variable), but when start resizing it, the Y option (so its vertical position) is reduced only with 2.5 pixels per one change of the Size variable. But its height is increasing with 200 pixels (from 256 to 456). So, initially the vertical position of the meter was 25 and its height was 256 and after the animation became 0 and 456, respectively. This certainly leads to a displacement of the increased meter.
The solution is to replace the Y option of the [MtBackground] meter with Y=(10*(10-#Size#)) (this moves the meter a little bit down, from where it initially was placed).
Yes sorry, this is the image haha Image
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Increasing Size on Mouse Over?

Post by balala »

cptdeadman wrote:
May 14th, 2020, 7:37 am
Yes sorry, this is the image haha
As suspected, the solution I posted above works well with this image as well. Does it for you too?
cptdeadman
Posts: 3
Joined: May 13th, 2020, 9:32 pm

Re: Increasing Size on Mouse Over?

Post by cptdeadman »

balala wrote:
May 14th, 2020, 7:49 am
As suspected, the solution I posted above works well with this image as well. Does it for you too?
Yess, Thank you very much!! :rosegift: :rosegift:
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Increasing Size on Mouse Over?

Post by balala »

cptdeadman wrote:
May 14th, 2020, 8:05 am
Yess, Thank you very much!! :rosegift: :rosegift:
Glad to help. :thumbup: