It is currently April 30th, 2024, 10:18 am

Dynamic text question.

Get help with creating, editing & fixing problems with skins
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Dynamic text question.

Post by kyriakos876 »

Hello,

I'm working on this skin below, and I was wondering,
when you mouseover and the animation is completed, after one more Update circle (in this case 1000ms or 1sec) the text of the skin shifts 3-4 pixels to the left. What could be the cause of that?

-Thanks in advance.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Dynamic text question.

Post by jsmorley »

Given that the meters X option is driven by dividing their own size by two, you are getting one last "shift" on the next normal skin update after the FontSize is set the last time by the ActionTimer.

What you want is NOT to allow those meters to update on their own. They should be entirely driven by the ActionTimer on the mouse over and mouse leave.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
MouseScrollDownAction=[!Refresh]

[Variables]
XOffSet=0
HOffSet=0
FSize=1.07
U=[!UpdateMeasureGroup Anim][!UpdateMeterGroup Anim][!Redraw]
;====== MEASURES ======

;[MeasureAnimationStage]
;Measure=Calc
;Formula=1
;IfCondition=(#XOffSet#=100)
;IfTrueAction=[!CommandMeasure MeasureTopToBottom "Execute 1"]
;IfCondition2=(#HOffSet#=0)
;IfTrueAction2=[!CommandMeasure MeasureRightToLeft "Execute 2"]
;DynamicVariables=1


[MeasureAnimation]
Measure=Plugin
Plugin=ActionTimer
Group=Anim
ActionList1=Repeat SlideToTheLeft, 10, 17 | Wait 100 | Repeat SlideToTheBottom, 10, 17
SlideToTheLeft=[!SetVariable XOffSet "(Clamp(#XOffSet#+12,0,200))"]#U#
SlideToTheBottom=[!SetVariable HOffSet "(Clamp(#HOffSet#+12,0,200))"]#U#
ActionList2=Repeat SlideToTheTop, 10, 17 | Wait 50 | Repeat SlideToTheRight, 10, 17
SlideToTheTop=[!SetVariable HOffSet "(Clamp(#HOffSet#-12,0,200))"]#U#
SlideToTheRight=[!SetVariable XOffSet "(Clamp(#XOffSet#-12,0,200))"]#U#
DynamicVariables=1

;[MeasureTopToBottom]
;Measure=Plugin
;Plugin=ActionTimer
;ActionList1=Wait 100 | Repeat SlideToTheBottom, 100, 10
;SlideToTheBottom=[!SetVariable HOffSet "(Clamp(#HOffSet#+10,0,100))"][!Update]
;ActionList2=Repeat SlideToTheTop, 100, 10
;SlideToTheTop=[!SetVariable HOffSet "(Clamp(#HOffSet#-10,0,100))"][!Update]
;DynamicVariables=1

;======= METERS =======

[Background]
Meter=Image
SolidColor=255,0,0,100
W=200
H=250
MouseOverAction=[!CommandMeasure MeasureAnimation "Stop 2"][!CommandMeasure MeasureAnimation "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureAnimation "Stop 1"][!CommandMeasure MeasureAnimation "Execute 2"]
DynamicVariables=1

[MeterDropDown]
Meter=Image
Group=Anim
ImageName=#@#Images\Background.png
W=200
H=#HOffSet#
X=0
Y=[MeterSlideToTheLeft:H]
DynamicVariables=1
UpdateDivider=-1

[MeterSlideToTheLeft]
Meter=Image
Group=Anim
ImageName=#@#Images\TopBar.png
W=#XOffSet#
X=((200-#XOffSet#)/2)
Y=0
DynamicVariables=1
UpdateDivider=-1

[Title]
Meter=String
Group=Anim
Text="Shortcuts"
FontSize=(#HOffSet#*#FSize#-#HOffSet#)
FontColor=255,255,255
X=(100-[Title:W]/2)
Y=5
DynamicVariables=1
AntiAlias=1
UpdateDivider=-1

[Text1]
Meter=String
Group=Anim
Text="Control Panel"
FontSize=(#HOffSet#*#FSize#-#HOffSet#)
FontColor=255,255,255
X=(100-[Text1:W]/2)
Y=40
DynamicVariables=1
AntiAlias=1
UpdateDivider=-1

[Text2]
Meter=String
Group=Anim
Text="Vivaldi"
FontSize=(#HOffSet#*#FSize#-#HOffSet#)
FontSize=12
FontColor=255,255,255
X=(100-[Text2:W]/2)
Y=10R
DynamicVariables=1
AntiAlias=1
UpdateDivider=-1

[Text3]
Meter=String
Group=Anim
Text="Photoshop"
FontSize=(#HOffSet#*#FSize#-#HOffSet#)
FontSize=12
FontColor=255,255,255
X=(100-[Text3:W]/2)
Y=10R
DynamicVariables=1
AntiAlias=1
UpdateDivider=-1

[Text4]
Meter=String
Group=Anim
Text="League Of Legends"
FontSize=(#HOffSet#*#FSize#-#HOffSet#)
FontSize=12
FontColor=255,255,255
X=(100-[Text4:W]/2)
Y=10R
DynamicVariables=1
AntiAlias=1
UpdateDivider=-1
Note that if the X option was not driven by a self-referencing division of their own width, you would STILL want use use UpdateDivider=1 on them and drive them with [!UpdateMeter] and [!Redraw] in the ActionTimer, and NOT with [!Update]. And particularly in this case, there is just no sense to having the meters doing that mathematical division on every skin update when the mouse is not over the trigger and the FontSize is not actively changing. It's just a waste of resources.

Generally speaking with ActionTimer, you never want the normal skin update to be fighting with the updates you do with the action. The best that can happen is a waste of resources aggressively doing nothing, and the worst is some conflict and weirdness. The entire point of ActionTimer, its entire reason for being, is to "act independently of the normal skin update". Never use !Update with ActionTimer. It's a conflict in definition. The point of ActionTimer is NOT to "overload" the normal skin update to force the entire skin to update faster than what is defined, but to operate outside the normal skin update and only use specific resources when needed for the action.

At the end of each "iteration" of the action, update the ActionTimer measure itself, so the variables stay current, and update the specific meters the action is effecting. The normal update of the skin is fine for updating all the measures and meters that are not involved in the action. In this case, there are none, and you could, and really should, set Update=-1 in the [Rainmeter] section of the skin.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Dynamic text question.

Post by kyriakos876 »

jsmorley wrote:
Note that if the X option was not driven by a self-referencing division of their own width, you would STILL want use use UpdateDivider=1 on them and drive them with [!UpdateMeter] and [!Redraw] in the ActionTimer, and NOT with [!Update]. And particularly in this case, there is just no sense to having the meters doing that mathematical division on every skin update when the mouse is not over the trigger and the FontSize is not actively changing. It's just a waste of resources.

Generally speaking with ActionTimer, you never want the normal skin update to be fighting with the updates you do with the action. The best that can happen is a waste of resources aggressively doing nothing, and the worst is some conflict and weirdness. The entire point of ActionTimer, its entire reason for being, is to "act independently of the normal skin update". Never use !Update with ActionTimer. It's a conflict in definition. The point of ActionTimer is NOT to "overload" the normal skin update to force the entire skin to update faster than what is defined, but to operate outside the normal skin update and only use resources when needed for the action.
Ah, that makes so much sense... I don't know why, but I always miss the obvious stuff... (talking about the action timer being an individual updater for the relevant meters). With your changes I felt the skin getting lighter, let alone properly working without shifting stuff that shouldn't be shifted :P
Thanks for the clarifications!!
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Dynamic text question.

Post by jsmorley »

kyriakos876 wrote:Ah, that makes so much sense... I don't know why, but I always miss the obvious stuff... (talking about the action timer being an individual updater for the relevant meters). With your changes I felt the skin getting lighter, let alone properly working without shifting stuff that shouldn't be shifted :P
Thanks for the clarifications!!
Always happy to help.