It is currently March 28th, 2024, 2:04 pm

animating an image sequence on mouse over meter

Get help with creating, editing & fixing problems with skins
Post Reply
zarpex
Posts: 2
Joined: June 9th, 2011, 12:04 am

animating an image sequence on mouse over meter

Post by zarpex »

I haven't done much in rainmeter, but I'm not very experienced so I'm hoping someone can help me out here.

I have a sequence of 60 images (example0001.png - example0060.png) that I'm trying to play back (and loop) at 24fps when I mouse over the image meter that displays the image. I just can't figure out how to set up the measure to change from 0001 to 0002 and once it gets to 0060 switch back to 0001.

Thanks in advance for any advice.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: animating an image sequence on mouse over meter

Post by smurfier »

Code: Select all

[Rainmeter]
;24fps is actually 41.666 but we can't use decimals.
Update=41

[cTimer]
Measure=Calc
Formula=(cTimer+1)%60
Disabled=1

;The image that will be displayed when the animation is not playing. If you don't want it, let me know and I will change the method to allow.
[mStaticImage]
Meter=Image
ImageName=Whatever.png
Group=Image
MouseOverAction=!Execute [!RainmeterToggleMeterGroup Image][!RainmeterToggleMeasure cTimer][!RainmeterRefresh]

;Here's where the animation occurs.
[mImage]
Meter=Image
MeasureName=cTimer
ImageName=%1.png
Group=Image
MouseLeaveAction=!Execute [!RainmeterToggleMeterGroup Image][!RainmeterToggleMeasure cTimer][!RainmeterRefresh]
One caveat...
You need to rename your images from 0 thru 60, without the zeros on front. (ie 0.png, 1.png, 2.png, etc.)
zarpex
Posts: 2
Joined: June 9th, 2011, 12:04 am

Re: animating an image sequence on mouse over meter

Post by zarpex »

That looks like it should work.. I will test it when I get back from school. Thanks!
CybOrSpasm
Posts: 146
Joined: January 8th, 2011, 7:12 pm
Location: Tennessee
Contact:

Re: animating an image sequence on mouse over meter

Post by CybOrSpasm »

I have done some anims with mouseovers as well, you can look at the code to see if it helps...
http://cyborspasm.deviantart.com/#/d3cyw8v
http://cyborspasm.deviantart.com/#/d3cuaml
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: animating an image sequence on mouse over meter

Post by smurfier »

Here's another slightly different method that simply pauses the animation when the mouse leaves the image.

Code: Select all

[Variables]
Act=0

[cTimer]
Measure=Calc
Formula=(cTimer+#Act#)%60
DynamicVariables=1

[mImage]
Meter=Image
MeasureName=cTimer
ImageName=Frame%1.png
MouseOverAction=!Execute [!RainmeterSetVariable Act 1][!RainmeterUpdate]
MouseLeaveAction=!Execute [!RainmeterSetVariable Act 0][!RainmeterUpdate]
User avatar
The1StraightShooter
Posts: 3
Joined: September 6th, 2014, 11:36 am

Re: animating an image sequence on mouse over meter

Post by The1StraightShooter »

:welcome: I have made animated start orb ,i wanted the animation to start ,when i do Mouse Over Action , i already read the article and i have tried couple of things but i can't figure out ,how to achieve it :confused:


Link to my start button: http://the1straightshooter.deviantart.com/art/Rainmeter-Sharingan-animated-start-orb-5-Actions-480385200


The code i wrote:

Code: Select all

[Rainmeter]
Update=100

[Button]

[Metadata]
Name=Rainmeter Sharingan animated start orb 5 Actions
Author=The1StraightShooter
Information=Sharingan animated button Actions:1 One Left click open=Strat Menu,2 One
Right click open=Task List,3 One Middle Mouse click open=Tray Popup,4 One Mouse Scroll
Up Shows Desktop,*Second Mouse Scroll Up hide Desktop,5 One Mouse Scroll Down Shows
Window Switcher,/push the arrows for navigation/,*Second Mouse Scroll Down close Window
Switcher.Displays a "Bitmap" sharingan_bitmap.png animation
Version=1


[MeasureAnimation]
Measure=CALC
Formula=Counter %4

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=#@#ImagesBitmap\sharingan_bitmap.png
BitmapFrames=4
BitmapExtend=1


LeftMouseUpAction=!Execute ["#CURRENTPATH#\Start.exe"]
RightMouseUpAction=!Execute ["#CURRENTPATH#\Tasklist.exe"]
MiddleMouseUpAction=!Execute ["#CURRENTPATH#\TrayPopup.exe"]
MouseScrollUpAction=!Execute ["#CURRENTPATH#\ShowsDesktop.lnk"]
MouseScrollDownAction=!Execute ["#CURRENTPATH#\WindowSwitcher.lnk"]
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: animating an image sequence on mouse over meter

Post by jsmorley »

Code: Select all

[Rainmeter]
Update=100

[Metadata]
Name=Rainmeter Sharingan animated start orb 5 Actions
Author=The1StraightShooter
Information=Sharingan animated button Actions:1 One Left click open=Strat Menu,2 One Right click open=Task List,3 One Middle Mouse click open=Tray Popup,4 One Mouse Scroll Up Shows Desktop,*Second Mouse Scroll Up hide Desktop,5 One Mouse Scroll Down Shows Window Switcher,/push the arrows for navigation/,*Second Mouse Scroll Down close Window Switcher.Displays a "Bitmap" sharingan_bitmap.png animation 
Version=1

[MeasureAnimation]
Measure=CALC
Formula=Counter %4
Disabled=1

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=#@#ImagesBitmap\sharingan_bitmap.png
BitmapFrames=4
BitmapExtend=1
LeftMouseUpAction=!Execute ["#CURRENTPATH#\Start.exe"]
RightMouseUpAction=!Execute ["#CURRENTPATH#\Tasklist.exe"]
MiddleMouseUpAction=!Execute ["#CURRENTPATH#\TrayPopup.exe"]
MouseScrollUpAction=!Execute ["#CURRENTPATH#\ShowsDesktop.lnk"]
MouseScrollDownAction=!Execute ["#CURRENTPATH#\WindowSwitcher.lnk"]
MouseOverAction=[!EnableMeasure MeasureAnimation]
MouseLeaveAction=[!DisableMeasure MeasureAnimation]
test.gif
P.S. Please, please don't use spaces in the folder names or skin names. That is only going to come back to bite you in the end.
2014-09-06_083403.png
Also, don't use !Execute with bangs. That has long ago been Deprecated, and should not be used in new skins.
User avatar
The1StraightShooter
Posts: 3
Joined: September 6th, 2014, 11:36 am

Re: animating an image sequence on mouse over meter

Post by The1StraightShooter »

Thank you very much , sorry for the delay the whole neighborhood was down of electricity :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: animating an image sequence on mouse over meter

Post by jsmorley »

Glad to help.
Post Reply