It is currently March 29th, 2024, 9:43 am

Another slider animation for launchers and the like

Tips and Tricks from the Rainmeter Community
User avatar
Mordasius
Posts: 1167
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Another slider animation for launchers and the like

Post by Mordasius »

Here is yet another slider animation that can be used to launch applications or skins. The code may not be very efficient/pretty, but it is light on the CPU and might be of some help to those trying to make an animated launcher. Left click on the button to open the slider and left click to close the slider. I've also added an auto-close thingee so that if you just wait for X seconds (set by #TimeOpen#), the slider will auto-close.

Code: Select all

[Rainmeter]
Author=Mordasius
MiddleMouseUpAction=!Refresh
Update=33
Group=STALKER|Sideline

[Metadata]
Name=Slider_left
Description=Animated slider to launch five skins / applications for the STALKER suite.
Version=22042012
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0

[Variables]
@Include=#CURRENTPATH#\SliderSettings.inc

;- change TimeOpen to set the number of seconds before the slider closes automaticaly
TimeOpen=10

PopOut=1
UpdateModifier=33
Xpos=9
Ypos=12
ImageTintNormal=a49b87
ImageTintDark=6e6b64
ImageNoTint=FFFFFF
AlphaDull=200
AlphaBright=240

;--- [ launcher style ]

[sLauncher]
X=28r
Y=r
W=16
H=16
GreyScale=1
ImageTint=#ImageTintNormal#
ImageAlpha=#AlphaDull#
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint #ImageTintDark#] [!SetOption #CURRENTSECTION# ImageAlpha ""] [!SetOption #CURRENTSECTION# GreyScale 1] [!HideMeter MtMouseOver] [!Update]
Group=PopDetails
UpdateDivider=5
Hidden=1

;--- [ meters ]

[MtButton]
Meter=IMAGE
ImageName=#CURRENTPATH#SliderImages\sb(1).png
X=148
LeftMouseUpAction=[!HideMeterGroup PopDetails] [!SetVariable PopOut (#PopOut#=0)] [!EnableMeasure cStepCounter] [!HideMeter MtFullSlider] [!ShowMeter MtAnimateSlider]
DynamicVariables=1
UpdateDivider=#UpdateModifier#

;--- [ animation ]

[cStepCounter]
Measure=Calc
Formula= (#PopOut# ? (cStepCounter-(cStepCounter>0)) : (cStepCounter+(cStepCounter<6)))
IfBelowValue=1
IfBelowAction=[!HideMeterGroup PopDetails] [!DisableMeasure cStepCounter] [!HideMeter MtAnimateSlider] [!DisableMeasure cOpenCounter] [!ToggleMeterGroup Arrows] 
IfAboveValue=5
IfAboveAction=[!HideMeter MtAnimateSlider] [!ShowMeter MtFullSlider] [!EnableMeasure cOpenCounter] [!ToggleMeterGroup PopDetails] [!ToggleMeterGroup Arrows]  
DynamicVariables=1
Disabled=1

[cOpenCounter]
Measure=Calc
Formula=[cOpenCounter] + 1
IfEqualValue=#TimeOpen#
IfEqualAction=[!ToggleMeterGroup PopDetails] [!SetVariable PopOut (#PopOut#=0)] [!EnableMeasure cStepCounter]  [!HideMeter MtFullSlider] [!ShowMeter MtAnimateSlider]
Disabled=1
DynamicVariables=1
UpdateDivider=#UpdateModifier#

[MtAnimateSlider]
Meter=IMAGE
MeasureName=cStepCounter
Path=#CURRENTPATH#SliderImages\
AntiAlias=0
Hidden=1

[MtFullSlider]
Meter=IMAGE
ImageName=#CURRENTPATH#SliderImages\6.png
AntiAlias=1
UpdateDivider=-1
Hidden=1

[MtIconOpen]
Meter=IMAGE
ImageName=#CURRENTPATH#SliderImages\Open.png
X=(#Xpos#+151)
Y=#Ypos#
ToolTipText="Open"
UpdateDivider=#UpdateModifier#
Group=Arrows

[MtIconClose]
Meter=IMAGE
ImageName=#CURRENTPATH#SliderImages\Close.png
X=(#Xpos#+153)
Y=#Ypos#
ToolTipText="Close"
UpdateDivider=#UpdateModifier#
Group=Arrows
Hidden=1

;--- [ launcher icons ]

[MtMouseOver]
Meter=IMAGE
ImageName=#CURRENTPATH#SliderImages\overlay.png
UpdateDivider=#UpdateModifier#
Hidden=1

[MtLauncher1]
Meter=IMAGE
MeterStyle=sLauncher
ImageName=#ItemIcon-1#
Y=#Ypos#
X=14
LeftMouseUpAction=#ItemAction-1#
MouseOverAction=[!SetOption "#CURRENTSECTION#" GreyScale 0] [!SetOption #CURRENTSECTION# ImageTint #ImageNoTint#] [!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#] [!ShowMeter MtMouseOver] [!MoveMeter 11 10 MtMouseOver] [!Update]
ToolTipText=#ItemText-1#

[MtLauncher2]
Meter=IMAGE
MeterStyle=sLauncher
ImageName=#ItemIcon-2#
LeftMouseUpAction=#ItemAction-2#
MouseOverAction=[!SetOption "#CURRENTSECTION#" GreyScale 0] [!SetOption #CURRENTSECTION# ImageTint #ImageNoTint#] [!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#] [!ShowMeter MtMouseOver] [!MoveMeter 39 10 MtMouseOver] [!Update]
ToolTipText=#ItemText-2#

[MtLauncher3]
Meter=IMAGE
MeterStyle=sLauncher
ImageName=#ItemIcon-3#
LeftMouseUpAction=#ItemAction-3#
MouseOverAction=[!SetOption "#CURRENTSECTION#" GreyScale 0] [!SetOption #CURRENTSECTION# ImageTint #ImageNoTint#] [!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#] [!ShowMeter MtMouseOver] [!MoveMeter 67 10 MtMouseOver] [!Update]
ToolTipText=#ItemText-3#

[MtLauncher4]
Meter=IMAGE
MeterStyle=sLauncher
ImageName=#ItemIcon-4#
LeftMouseUpAction=#ItemAction-4#
MouseOverAction=[!SetOption "#CURRENTSECTION#" GreyScale 0] [!SetOption #CURRENTSECTION# ImageTint #ImageNoTint#] [!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#] [!ShowMeter MtMouseOver][!MoveMeter 95 10 MtMouseOver] [!Update]
ToolTipText=#ItemText-4#

[MtLauncher5]
Meter=IMAGE
MeterStyle=sLauncher
ImageName=#ItemIcon-5#
LeftMouseUpAction=#ItemAction-5#
MouseOverAction=[!SetOption "#CURRENTSECTION#" GreyScale 0] [!SetOption #CURRENTSECTION# ImageTint #ImageNoTint#] [!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#] [!ShowMeter MtMouseOver][!MoveMeter 123 10 MtMouseOver] [!Update]
ToolTipText=#ItemText-5#
One little problem is that the tool tip text seems to be a bit sticky every now and again and doesn't always switch off when you leave the button.

Image files and an example of settings.inc are in the attached .rmskin file (comments enabled and no virus - promise :) )

P.S I started by using image crop on a single image for each part of the animation but suspect that this could use a few more CPU cycles. If this is not the case then I'd definately go for that approach as it means less image editing.
You do not have the required permissions to view the files attached to this post.