It is currently March 28th, 2024, 8:26 pm

Increasing Size on Mouse Over?

Get 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: 16110
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: 16110
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: 16110
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:
demonslayer404
Posts: 1
Joined: August 23rd, 2020, 4:02 pm

Re: Increasing Size on Mouse Over?

Post by demonslayer404 »

Hey can you help me with the button image.

Code: Select all

[Rainmeter]
Update=1000
Author=http://Lybrica.deviantart.com/
@include=#@#Variables.inc

[Image]
Meter=Button
ButtonImage=1
X=0
Y=0
LeftMouseUpAction=#GoogleDrive#
Last edited by balala on August 23rd, 2020, 4:39 pm, edited 1 time in total.
Reason: Please use <code> tags when you're posting code snippets. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Increasing Size on Mouse Over?

Post by balala »

demonslayer404 wrote: August 23rd, 2020, 4:04 pm Hey can you help me with the button image.

Code: Select all

[Rainmeter]
Update=1000
Author=http://Lybrica.deviantart.com/
@include=#@#Variables.inc

[Image]
Meter=Button
ButtonImage=1
X=0
Y=0
LeftMouseUpAction=#GoogleDrive#
Here is a very good description on how to work with the images of Button meters: https://docs.rainmeter.net/tips/button-images/