It is currently April 19th, 2024, 6:01 am

Sliding a Skin with ActionTimer

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
DanielPodo
Posts: 77
Joined: March 30th, 2016, 1:50 pm

Re: Sliding a Skin with ActionTimer

Post by DanielPodo »

Right...any guesses as to why I can't change the Height of this bar dynamically using all the above code (specific code for this meter in particular shown below)?

I've made it so that Width and Height can both expand but the Height isn't changing...whereas the Width is...what gives? All the math checks out...I've got a small skin showing me all the variable values changing in real-time to help me debug issues...is this some limitation in Rainmeter?

Image

Code: Select all

[Variables]
Z=[!UpdateMeasure ExtendClose][!Update][!Redraw]
N=0
State=1
Ext=0

[Bar]
meter=Image
X=20
Y=700
W=(20+#Ext#)
H=(20+#Ext#)
SolidColor=255,156,32
LeftMouseUpAction=[!CommandMeasure "ExtendClose" "Execute #State#"][!SetVariable "State" "(3-#State#)"]
DynamicVariables=1

[ExtendClose]
measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Extend, 10, 20
ActionList2=Repeat Close, 10, 20
Extend=[!SetVariable N "(Clamp((#N#+1),0,20))"][!SetVariable Ext "(trunc(300*(1-1/(128**(0.05*#N#)))))"]#Z#
Close=[!SetVariable N "(Clamp((#N#-1),0,20))"][!SetVariable Ext "(trunc(#Ext#*(1-1/(128**(0.05*#N#)))))"]#Z#
DynamicVariables=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Sliding a Skin with ActionTimer

Post by eclectic-tech »

Adding DynamicWindowSize=1 to [Rainmeter] section... works here!
User avatar
DanielPodo
Posts: 77
Joined: March 30th, 2016, 1:50 pm

Re: Sliding a Skin with ActionTimer

Post by DanielPodo »

eclectic-tech wrote:Adding DynamicWindowSize=1 to [Rainmeter] section... works here!
Yep, adding that makes it work for me too. But why do I need to add that?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Sliding a Skin with ActionTimer

Post by eclectic-tech »

DanielPodo wrote:Yep, adding that makes it work for me too. But why do I need to add that?
Without that in the [Rainmeter] section, the window size for meters is set on load/refresh, but not adjusted on updates.

With that added, the skin adjusts to any changes in meter sizes on every skin update. Manual Reference
scottiescotsman
Posts: 54
Joined: June 10th, 2013, 2:22 am

Re: Sliding a Skin with ActionTimer

Post by scottiescotsman »

Hi guys I have not been here in awhile sorry :(...
Just getting into the sliders ... and got them to work good on my new skin ... but on the sort of label tab can I use a png or does it just have to be text?

sorry I know you can use .pngs .. just found out sorry

but my png has curved edges and the background colour shows through :( ... can it be fixed ?

Thanks in advance
Steven
scottiescotsman
Posts: 54
Joined: June 10th, 2013, 2:22 am

Re: Sliding a Skin with ActionTimer

Post by scottiescotsman »

Thanks for your reply dvo :)
I got the sliders working great apart from the meters are outside the slider grr :(
here is the code

Code: Select all

-----------------------------------------------------------------------------
[Rainmeter]
-----------------------------------------------------------------------------
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=250
SkinHeight=290
-----------------------------------------------------------------------------
[includes]
-----------------------------------------------------------------------------
@include1=#@#inc\METADATA.inc
@include2=#@#inc\STYLES.inc
@include3=#@#inc\VARIABLES.inc
-----------------------------------------------------------------------------
[variables]
-----------------------------------------------------------------------------
bx=100
bw=150
OffSet=-258
State=1
U=[!UpdateMeasure MeasureSlider][!UpdateMeter *][!Redraw]
-----------------------------------------------------------------------------
[MeasureCPU1]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=0
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU2]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=1
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU3]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=2
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU4]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=3
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU5]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=4
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU6]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=5
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU7]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=6
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCPU8]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=Plugins\PerfMon.dll
PerfMonObject="Processor"
PerfMonInstance=7
PerfMonCounter="% Processor Time"
PerfMonDfference=1
InvertMeasure=1
-----------------------------------------------------------------------------
[MeasureCoreUsage1]
-----------------------------------------------------------------------------
Measure=CPU
Processor=1
-----------------------------------------------------------------------------
[MeasureCoreUsage2]
-----------------------------------------------------------------------------
Measure=CPU
Processor=2
-----------------------------------------------------------------------------
[MeasureCoreUsage3]
-----------------------------------------------------------------------------
Measure=CPU
Processor=3
-----------------------------------------------------------------------------
[MeasureCoreUsage4]
-----------------------------------------------------------------------------
Measure=CPU
Processor=4
-----------------------------------------------------------------------------
[MeasureCoreUsage5]
-----------------------------------------------------------------------------
Measure=CPU
Processor=5
-----------------------------------------------------------------------------
[MeasureCoreUsage6]
-----------------------------------------------------------------------------
Measure=CPU
Processor=6
-----------------------------------------------------------------------------
[MeasureCoreUsage7]
-----------------------------------------------------------------------------
Measure=CPU
Processor=7
-----------------------------------------------------------------------------
[MeasureCoreUsage8]
-----------------------------------------------------------------------------
Measure=CPU
Processor=8
-----------------------------------------------------------------------------
[MeasureSlider]
-----------------------------------------------------------------------------
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideDown, 2, 33
SlideDown=[!SetVariable State "2"][!SetVariable OffSet "(Clamp(#OffSet#+9,-258,0))"]#U#
ActionList2=Repeat SlideUp, 2, 33
SlideUp=[!SetVariable State "1"][!SetVariable OffSet "(Clamp(#OffSet#-9,-258,0))"]#U#
DynamicVariables=1
-----------------------------------------------------------------------------
[MeterBack]
-----------------------------------------------------------------------------
Meter=Image
ImageName=#@#Images\cpu\cpuBG.png
X=0
Y=#OffSet#
W=250
H=290
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Execute #State#"]
-----------------------------------------------------------------------------
[meterLabelCPU1]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=7
Text="CORE I"
-----------------------------------------------------------------------------
[meterBarCPU1]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage1 
MeterStyle=BarHorizontalStyle
x=#bx#
y=10
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU2]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=27
Text="CORE II"
-----------------------------------------------------------------------------
[meterBarCPU2]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage2
MeterStyle=BarHorizontalStyle
x=#bx#
y=30
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU3]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=47
Text="CORE III"
-----------------------------------------------------------------------------
[meterBarCPU3]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage3
MeterStyle=BarHorizontalStyle
x=#bx#
y=50
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU4]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=67
Text="CORE IV"
-----------------------------------------------------------------------------
[meterBarCPU4]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage4
MeterStyle=BarHorizontalStyle
x=#bx#
y=70
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU5]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=87
Text="CORE V"
-----------------------------------------------------------------------------
[meterBarCPU5]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage5 
MeterStyle=BarHorizontalStyle
x=#bx#
y=90
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU6]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=107
Text="CORE VI"
-----------------------------------------------------------------------------
[meterBarCPU6]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage6
MeterStyle=BarHorizontalStyle
x=#bx#
y=110
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU7]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=127
Text="CORE VII"
-----------------------------------------------------------------------------
[meterBarCPU7]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage7
MeterStyle=BarHorizontalStyle
x=#bx#
y=130
h=20
w=#bw#
-----------------------------------------------------------------------------
[meterLabelCPU8]
-----------------------------------------------------------------------------
Meter=STRING
MeterStyle=LeftStyle
FontColor=#fc2#
FontSize=#ts1#
X=30
Y=147
Text="CORE VIII"
-----------------------------------------------------------------------------
[meterBarCPU8]
-----------------------------------------------------------------------------
meter=bar
MeasureName=MeasureCoreUsage8
MeterStyle=BarHorizontalStyle
x=#bx#
y=150
h=20
w=#bw#
-----------------------------------------------------------------------------
Thanks in advance
Steven
scottiescotsman
Posts: 54
Joined: June 10th, 2013, 2:22 am

Re: Sliding a Skin with ActionTimer

Post by scottiescotsman »

hope I did this correctly :)
And the DynamicVariables=1 was in the background meter but not on the others & yes I added DynamicVariables=1 to all the meters and still didn't work :(
You do not have the required permissions to view the files attached to this post.
scottiescotsman
Posts: 54
Joined: June 10th, 2013, 2:22 am

Re: Sliding a Skin with ActionTimer

Post by scottiescotsman »

The 3 include files :)
Hope that helps

Thanks
Steven
You do not have the required permissions to view the files attached to this post.
Honimoura
Posts: 94
Joined: April 3rd, 2018, 11:15 am

Re: Sliding a Skin with ActionTimer

Post by Honimoura »

Hello, I just discovered this option. I use it a little differently. I use it to click on one of the skin, it "unwinds" icons to create a menu. However I am looking for how to make a slide of the skins on a arc path.

In order to be as clear as possible. The base skin is a circle, so I want to scroll the "icons" around this circle in sliding.

(Sorry, i'm french, google trad power)
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Sliding a Skin with ActionTimer

Post by ikarus1969 »

Honimoura wrote: June 25th, 2019, 6:19 pm Hello, I just discovered this option. I use it a little differently. I use it to click on one of the skin, it "unwinds" icons to create a menu. However I am looking for how to make a slide of the skins on a arc path.

In order to be as clear as possible. The base skin is a circle, so I want to scroll the "icons" around this circle in sliding.

(Sorry, i'm french, google trad power)
As a starting point you can use the following demonstrating skin where blue circles rotate on a circle when hovering over the red base rectangle (and back when leaving the red base rectangle):

A little math:
the x-position of an object on a circle is calculated by.
[x-coordinate of the middle of the circle] + [radius of the circle] * COSINUS(angle)
the y-position of an object on a circle is calculated by.
[y-coordinate of the middle of the circle] + [radius of the circle] * SINUS(angle)

(see polar-coordinates on wikipedia (french): https://fr.wikipedia.org/wiki/Coordonn%C3%A9es_polaires)

sliding is done by increasing (or decreasing) the angle with an action-timer measure
Screenshot skin.jpg

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
OnWakeAction=[!Refresh]
DynamicWindowSize=1
; BackgroundMode=2
; SolidColor=4080C040

[Variables]
CIRCLE.X=130
CIRCLE.Y=130
CIRCLE.R=100

; starting angles in degrees, starting on the right (=east)
; angle for the red base
ANGLE.Base=180

; angles for the blue circles which will rotate upon mouse move over (and out) of the red base
ANGLE.Icon.1=220
ANGLE.Icon.2=265
ANGLE.Icon.3=337


Base.W=40
Base.H=#Base.W#

Icon.R=20


; for ActionTimer
AT_Angle=0
UAT_Angle=[!UpdateMeasure "Measure_AT_Angle"][!UpdateMeterGroup "G_ICON"][!Redraw]


; --------------------------------------------------------------------------------
; Measures
; --------------------------------------------------------------------------------

[Measure_AT_Angle]
Measure=PLUGIN
Plugin=ActionTimer
ActionList1=Repeat ROTATE_RIGHT, 7, 80 | Wait 7 | ROTATE_RIGHT_FINAL
ActionList2=Repeat ROTATE_LEFT,  7, 80 | Wait 7 | ROTATE_LEFT_FINAL
ROTATE_RIGHT=      [!SetVariable "AT_Angle" "(MIN(80, #AT_Angle# + 1))"]#UAT_Angle#
ROTATE_RIGHT_FINAL=[!SetVariable "AT_Angle" "80"]#UAT_Angle#
ROTATE_LEFT=       [!SetVariable "AT_Angle" "(MAX(0, #AT_Angle# - 1))"]#UAT_Angle#
ROTATE_LEFT_FINAL= [!SetVariable "AT_Angle" "0"]#UAT_Angle#
DynamicVariables=1
UpdateDivider=-1
IgnoreWarnings=1


; --------------------------------------------------------------------------------
; Meters
; --------------------------------------------------------------------------------
[Meter_Circle]
Meter=SHAPE
Shape= Ellipse #CIRCLE.X#, #CIRCLE.Y#, #CIRCLE.R#, #CIRCLE.R# | Extend Format_Circle
Format_Circle=StrokeWidth 2 | Stroke Color 800000FF | Fill Color FFFFFFFF
AntiAlias=1
DynamicVariables=1

[Meter_Base]
Meter=SHAPE
Shape=Rectangle (#CIRCLE.X# + (#CIRCLE.R# + 0.5 * #Base.W#) * COS(RAD(#ANGLE.Base#))), (#CIRCLE.Y# + (#CIRCLE.R# + 0.5 * #Base.W#) * SIN(RAD(#ANGLE.Base#))), #Base.W#, #Base.W# | Extend Format_Base
Format_Base=StrokeWidth 2 | Stroke Color 800000FF | Fill Color FF0000FF
MouseOverAction= [!CommandMeasure "Measure_AT_Angle" "Stop 1"][!CommandMeasure "Measure_AT_Angle" "Stop 2"][!CommandMeasure "Measure_AT_Angle" "Execute 1"]
MouseLeaveAction=[!CommandMeasure "Measure_AT_Angle" "Stop 1"][!CommandMeasure "Measure_AT_Angle" "Stop 2"][!CommandMeasure "Measure_AT_Angle" "Execute 2"]
AntiAlias=1
DynamicVariables=1

[Meter_Icon_1]
Meter=SHAPE
Shape= Ellipse (#CIRCLE.X# + #CIRCLE.R# * COS(RAD(#ANGLE.Icon.1# + #AT_Angle#))), (#CIRCLE.Y# + #CIRCLE.R# * SIN(RAD(#ANGLE.Icon.1# + #AT_Angle#))), #Icon.R#, #Icon.R# | Extend Format_Icon
Format_Icon=StrokeWidth 2 | Stroke Color 004080FF | Fill Color 80BFFFFF
AntiAlias=1
DynamicVariables=1
Group=G_ICON

[Meter_Icon_2]
Meter=SHAPE
Shape= Ellipse (#CIRCLE.X# + #CIRCLE.R# * COS(RAD(#ANGLE.Icon.2# + #AT_Angle#))), (#CIRCLE.Y# + #CIRCLE.R# * SIN(RAD(#ANGLE.Icon.2# + #AT_Angle#))), #Icon.R#, #Icon.R# | Extend Format_Icon
Format_Icon=StrokeWidth 2 | Stroke Color 004080FF | Fill Color 80BFFFFF
AntiAlias=1
DynamicVariables=1
Group=G_ICON

[Meter_Icon_3]
Meter=SHAPE
Shape= Ellipse (#CIRCLE.X# + #CIRCLE.R# * COS(RAD(#ANGLE.Icon.3# + #AT_Angle#))), (#CIRCLE.Y# + #CIRCLE.R# * SIN(RAD(#ANGLE.Icon.3# + #AT_Angle#))), #Icon.R#, #Icon.R# | Extend Format_Icon
Format_Icon=StrokeWidth 2 | Stroke Color 004080FF | Fill Color 80BFFFFF
AntiAlias=1
DynamicVariables=1
Group=G_ICON
You do not have the required permissions to view the files attached to this post.