It is currently March 28th, 2024, 8:51 am

Specialised moving text.

Get help with creating, editing & fixing problems with skins
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Specialised moving text.

Post by FreeRaider »

Perhaps this one can help you:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=500

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=[MeterText1:W]
XValue=0
Repeat=0
text=This is a very long text for this example skin.

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#+[MeterText1:W])
IfCondition=1
IfTrueAction=[!SetVariable Repeat "[MeasureRepeat]"][!Update]
DynamicVariables=1

[MeasureX1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action1 , 25 , #Repeat#
ActionList2=Wait 25 | Action2 | Repeat Action1 , 25 , #Repeat#
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
Action2=[!SetVariable XValue "0"][!Update]
DynamicVariables=1

[MeasureWait]
Measure=Calc
Formula=-[MeterText1:W]
IfCondition= (#XValue#=-#Width#)
IfTrueAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!CommandMeasure MeasureX1 "Execute 2"]
DynamicVariables=1

;==== METERS ====            

[MeterText1]
Meter=String
Text=#text#
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=#text#
FontSize=50
X=(#XValue#+#Width#)
Y=0
AntiAlias=1
DynamicVariables=1

[MeterBackground1]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureX1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!SetVariable XValue "0"][!Update]
W=#Width#
H=([MeterText1:H])
DynamicVariables=1
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

FreeRaider wrote:Perhaps this one can help you:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=500

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=[MeterText1:W]
XValue=0
Repeat=0
text=This is a very long text for this example skin.

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#+[MeterText1:W])
IfCondition=1
IfTrueAction=[!SetVariable Repeat "[MeasureRepeat]"][!Update]
DynamicVariables=1

[MeasureX1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action1 , 25 , #Repeat#
ActionList2=Wait 25 | Action2 | Repeat Action1 , 25 , #Repeat#
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
Action2=[!SetVariable XValue "0"][!Update]
DynamicVariables=1

[MeasureWait]
Measure=Calc
Formula=-[MeterText1:W]
IfCondition= (#XValue#=-#Width#)
IfTrueAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!CommandMeasure MeasureX1 "Execute 2"]
DynamicVariables=1

;==== METERS ====            

[MeterText1]
Meter=String
Text=#text#
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=#text#
FontSize=50
X=(#XValue#+#Width#)
Y=0
AntiAlias=1
DynamicVariables=1

[MeterBackground1]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureX1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!SetVariable XValue "0"][!Update]
W=#Width#
H=([MeterText1:H])
DynamicVariables=1

this is good but the issue with this is it does not stop like the original once a full cycle has been completed and there is no open area between the end of the text and the beginning of the text
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Specialised moving text.

Post by FreeRaider »

SilverDarkBlade wrote:the issue with this is it does not stop like the original once a full cycle has been completed
You change ActionList2=Wait 25 | Action2 | Repeat Action1 , 25 , #Repeat# with ActionList2=Wait 3000 | Action2 | Repeat Action1 , 25 , #Repeat#


SilverDarkBlade wrote:there is no open area between the end of the text and the beginning of the text
I don't understand this point.
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

FreeRaider wrote:You change ActionList2=Wait 25 | Action2 | Repeat Action1 , 25 , #Repeat# with ActionList2=Wait 3000 | Action2 | Repeat Action1 , 25 , #Repeat#



I don't understand this point.
with shorter text there is always space between the end of the text and the beginning of the next loop of text
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote:Started testing this thoroughly today and it works great except one problem. if a string of text is longer than the skin (happens commonly with the visualizer) the text overlaps itself when moving. any ideas on how to fix this without sacrificing the other features?

Here is an image of your code with the only change being extra G's added onto something
Sorry I was off for a little while :D
Let me know if this code works for you!

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
SkinWidth=#Width#

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=372
XValue=0
Repeat=0

;==============================================
;					MEASURES				
;==============================================

[MeasureRepeat]
Measure=Calc
Formula=((([MeterText1:W]>#Width#)*([MeterText1:W]*2)) + (([MeterText1:W]<#Width#)*((#Width#+[MeterText1:W])+[MeterText1:W])))
;Formula=((#Width#+[MeterText1:W])+([MeterText1:W]>#Width#)*([MeterText1:W]) )
IfCondition=1
IfTrueAction=[!SetVariable Repeat "[MeasureRepeat]"][!Update]
DynamicVariables=1

[MeasureX1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Action1 , 25 , #Repeat#
ActionList2=| Wait 3000 | Action2 | Repeat Action1 , 25 , #Repeat#
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#-([MeterText1:W]>#Width#)*[MeterText1:W] ),#Width#))"][!Update]
Action2=[!SetVariable XValue "0"][!Update]
DynamicVariables=1

[MeasureWait]
Measure=Calc
Formula=-[MeterText1:W]
IfCondition=(((#XValue#=-#Width#) && ([MeterText1:W]<#Width#)) || (([MeterText1:W]>#Width#) && (#XValue#<=[MeasureWait])))
IfTrueAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!CommandMeasure MeasureX1 "Execute 2"]
DynamicVariables=1

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

[MeterText1]
Meter=String
Text=Somethinggggggggggg
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=Somethinggggggggggg
FontSize=50
X=((([MeterText1:W]>#Width#)*(([MeterText1:W]) + (#XValue#)))+(([MeterText1:W]<#Width#)*(#Width#+#XValue#)))
Y=0
AntiAlias=1
DynamicVariables=1

[MeterBackground1]
Meter=Image
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureX1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureX1 "Stop 1"][!CommandMeasure MeasureX1 "Stop 2"][!SetVariable XValue "0"][!Update]
W=#Width#
H=([MeterText1:H])
DynamicVariables=1
Last edited by kyriakos876 on April 18th, 2017, 8:07 pm, edited 2 times in total.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

Also excuse me if I didn't read the above replies of FreeRaider I just went straight to solve it my way :S
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

FreeRaider wrote:Perhaps this one can help you:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
SkinWidth=500

[Metadata]
Name=Bla bla
Author=Bla bla
Information=Bla bla 
Version=Bla bla

[Variables]
Width=[MeterText1:W]
XValue=0
Repeat=0
text=This is a very long text for this example skin.
You set the Width variable as the width for the displayed text. My code uses the Width variable as the width of the skin, not the text. :)
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

kyriakos876 wrote:You set the Width variable as the width for the displayed text. My code uses the Width variable as the width of the skin, not the text. :)
thanks again ^^. final question how do i make the space after the text larger or smaller? otherwise this Works perfectly.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote:thanks again ^^. final question how do i make the space after the text larger or smaller? otherwise this Works perfectly.
Simply go to:

Code: Select all

[MeterText1Mirror]
Meter=String
Text=Something
FontSize=50
X=((([MeterText1:W]>#Width#)*(([MeterText1:W]) + #XValue#))+(([MeterText1:W]<#Width#)*(#Width#+#XValue#)))
Y=0
AntiAlias=1
DynamicVariables=1
Now if you want to make the space larger, add the space you want next to #XValue#.
For example if you want to add 3 pixels the Xoption will become:

X=((([MeterText1:W]>#Width#)*(([MeterText1:W]) + #XValue#+3))+(([MeterText1:W]<#Width#)*(#Width#+#XValue#+3)))

If you want to make the space smaller, you just subtract the number.
For example if you want to make it 3 pixels close the Xoption will become:

X=((([MeterText1:W]>#Width#)*(([MeterText1:W]) + #XValue#-3))+(([MeterText1:W]<#Width#)*(#Width#+#XValue#-3)))
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

Thank you :D

hopefully i wont need any more help
Post Reply