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

Specialised moving text.

Get help with creating, editing & fixing problems with skins
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Specialised moving text.

Post by SilverDarkBlade »

I'm editing monster-cat visualizer to have my own custom version and am currently working on moving text when you put your mouse on it.

Here is the code. The other files used aren't necessary for what I'm trying to do.

Code: Select all

[Rainmeter]
Group=SongInfo
Update=20
SkinWidth=#Width#

; = IMPORTANT =
; = For configuring the rainmeter skin, right-click the visualizer and click on "Open variables".
; = You can also open the variables.ini file located in:
; = "My Documents\Rainmeter\Skins\Monstercat Visualizer\@Resources"

; Small context menu when you right-click the skin
ContextTitle=" Open settings"
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "general.ini"]

[Metadata]
Name=Monstercat Visualizer for Rainmeter
Author=marcopixel
License=MIT License
Information=An realtime audio visualizer for Rainmeter similar to the ones used in the Monstercat videos.

[Variables]
; Width and speed used for calculations of scrolling text
Speed=2
Width=875
; Includes the variables/styles used for the skin.
@include=#@#variables.ini
; Include MeasureGenre and Chameleon for dynamic colors.
@include2=#@#include\Measure#MPMode#.inc
@include3=#@#include\MeasureStyling.inc

; Meter - artist and track

[MeterArtist]
Meter=String
MeasureName=MeasureArtist
X=(#BarGap#*#ScaleVisualizer#)
Y=(30*#ScaleSongInformation#)
H=(100*#ScaleSongInformation#)
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#
FontFace=#Font1#
FontSize=(#FontSize1#*#ScaleSongInformation#)
StringCase=Upper
AntiAlias=1
ClipString=2
Text="%1"
Group=SongMeta
Hidden=0

[MeterTrack]
Meter=String
MeasureName=MeasureTrack
X=(8*#ScaleSongInformation#)r
Y=104
H=(100*#ScaleSongInformation#)
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#-(8*#ScaleSongInformation#)
FontFace=#Font2#
FontSize=(#FontSize2#*#ScaleSongInformation#)
StringCase=Upper
AntiAlias=1
ClipString=2
Text="%1"
Group=SongMeta
Hidden=0

; ------------------- This line seperates my testing of moving text from the rest of the monstercat stuff --------------------------
; ------------------- Track Text ---------------------------------------------------------------------------------------------------
[HoverTrack]
Meter=Image
SolidColor=0, 0, 0, 1
X=6
Y=112
W=860
H=32
MouseOverAction=[!ShowMeter MeterText][!HideMeter MeterTrack][!Update]
MouseLeaveAction=[!HideMeter MeterText][!ShowMeter MeterTrack][!Update]

[MeterText]
Meter=String
MeterStyle=TextStyle
X=[MeasureX]
Y=104
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#-(8*#ScaleSongInformation#)
H=(100*#ScaleSongInformation#)
FontColor=255,255,255
DynamicVariables=1
Hidden=1

[TextStyle]
MeasureName=MeasureTrack
FontSize=(#FontSize2#*#ScaleSongInformation#)
FontFace=#Font2#
StringCase=Upper
AntiAlias=1
Text="%1"

[MeasureTextWidth]
Meter=String
MeterStyle=TextStyle
X=0
Y=0
FontColor=0,0,0,0
SolidColor=0,0,0,1
FontEffectColor=255,255,255,0

[MeasureTimer]
Measure=Calc
Formula=(( MeasureTimer + #Speed# ) % ( #Width# + [MeasureTextWidth:W] ))
DynamicVariables=1

[MeasureX]
Measure=Calc
Formula=( MeasureTimer - [MeasureTextWidth:W] )
DynamicVariables=1

;  ------------------- Artist Text --------------------------------------------------------------------------------------------------
[HoverArtist]
Meter=Image
SolidColor=0, 0, 0, 1
X=6
Y=39
W=869
H=57
MouseOverAction=[!ShowMeter MeterText2][!HideMeter MeterArtist][!Update]
MouseLeaveAction=[!HideMeter MeterText2][!ShowMeter MeterArtist][!Update]

[MeterText2]
Meter=String
MeterStyle=TextStyle2
X=[MeasureX2]
Y=24
H=(100*#ScaleSongInformation#)
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#
FontColor=255,255,255
DynamicVariables=1
Hidden=1

[TextStyle2]
MeasureName=MeasureArtist
FontSize=(#FontSize1#*#ScaleSongInformation#)
FontFace=#Font1#
StringCase=Upper
AntiAlias=1
Text="%1"

[MeasureTextWidth2]
Meter=String
MeterStyle=TextStyle2
X=0
Y=0
FontColor=0,0,0,0
SolidColor=0,0,0,1
FontEffectColor=255,255,255,0

[MeasureTimer2]
Measure=Calc
Formula=(( MeasureTimer2 + #Speed# ) % ( #Width# + [MeasureTextWidth2:W] ))
DynamicVariables=1

[MeasureX2]
Measure=Calc
Formula=( MeasureTimer2 - [MeasureTextWidth2:W] )
DynamicVariables=1
so currently this makes the text move from the left side of the screen to the right side of the screen when moused over. It detects if it is moused over by an image that is invisible right above the text in question.

The things I'm trying to change are:

1. Currently it is always running in the background on a loop so i can never expect where the text will start when moused over, i would like it to start in the same place every time it is moused over.

2. When it loops all of the text has to go off screen before it starts coming back on the other side, i would like it to have a small space (like 5 letters) at the end between the start and end but have each letter go off screen and come back on the other side individually.

3. After it finishes its loop once i would like it to pause for 3 seconds before continuing.

4. Currently it goes from left to right, i would like it to go right to left. I can make this part happen by changing
[MeasureX]
Measure=Calc
Formula=( MeasureTimer - [MeasureTextWidth:W] )
DynamicVariables=1

to
[MeasureX]
Measure=Calc
Formula=( [MeasureTextWidth:W] - MeasureTimer )
DynamicVariables=1


however it has some odd offsets in the distance its supposed to move before it loops.

If you need me to go into more detail about anything, see anything that is redundant or useless and could be removed, See anything that could be changed to be better, or have some input on any of my issues (how to fix problems or make something I'm working on happen) it would be greatly appreciated.

Everything i have learned has been from looking at and changing other people's code so this is quite a mess.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

1. Go to [HoverTrack] replace the current MouseOver/MouseLeave with:

Code: Select all

MouseOverAction=[!ShowMeter MeterText][!EnableMeasure MeasureTimer][!HideMeter MeterTrack][!Update]
MouseLeaveAction=[!HideMeter MeterText][!DisableMeasure MeasureTimer][!ShowMeter MeterTrack][!Update]
then go to [MeasureTimer] and add Disabled=1 .

Now go to [HoverArtist] and replace the current MouseOver/MouseLeave with:

Code: Select all

MouseOverAction=[!ShowMeter MeterText2][!HideMeter MeterArtist][!EnableMeasure MeasureTimer2][!Update]
MouseLeaveAction=[!HideMeter MeterText2][!ShowMeter MeterArtist][!DisableMeasure MeasureTimer2][!Update]
and again, go to [MeasureTimer2] and add Disabled=1 .

2. and 3. of your post either contradict each other, or I got 2 wrong... (Even if you want 2 alone, I think it's not possible to be done)

you might want to explain a little bit more what you want to do in 2. :D

4. You might wanna to this :

Code: Select all

[MeasureTimer2]
Measure=Calc
Formula=(( MeasureTimer2 + #Speed# ) % ( #Width# + [MeasureTextWidth2:W]*2 ))
DynamicVariables=1
Disabled=1

[MeasureX2]
Measure=Calc
Formula=( [MeasureTextWidth2:W] - MeasureTimer2 )
DynamicVariables=1
and the same for the other one.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote:I'm editing monster-cat visualizer to have my own custom version and am currently working on moving text when you put your mouse on it.
Okay, so I wrote this as an example and I think it does all the things you wanted (except for the 2. which I'm not sure what you mean yet). This also doesn't require having an Update rate as low as 20:

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=300
XValue=0
Repeat=0

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#/2+[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,(-[MeterText1:W]),#Width#))"][!Update]
Action2=[!SetVariable XValue "(#Width#+[MeterText1:W])"][!Update]
DynamicVariables=1

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

;==== METERS ====

[MeterText1]
Meter=String
Text=Something
FontSize=50
X=#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
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

kyriakos876 wrote:Okay, so I wrote this as an example and I think it does all the things you wanted (except for the 2. which I'm not sure what you mean yet). This also doesn't require having an Update rate as low as 20:

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=300
XValue=0
Repeat=0

;=== MEASURES ===

[MeasureRepeat]
Measure=Calc
Formula=(#Width#/2+[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,(-[MeterText1:W]),#Width#))"][!Update]
Action2=[!SetVariable XValue "(#Width#+[MeterText1:W])"][!Update]
DynamicVariables=1

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

;==== METERS ====

[MeterText1]
Meter=String
Text=Something
FontSize=50
X=#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
thank you ^^you have been by far the most helpful person i have talked to on this forum yet. Il try these out and see if they need tweaks and i will explain 2 and 3 more thoroughly

so what im wanting is for there to always be the text visible on screen when looping. but after it makes one full loop. stop for a second at the stationary text before moving again. 3 is a lot less important than 2. sorry i have a hard time explaining my thoughts sometimes

Edit: i found an example of what I'm looking for in a different coding language. http://www.jqueryscript.net/demo/Text-Scrolling-Plugin-for-jQuery-Marquee/

see how on the third example the end of start text goes back onscreen before the last of the text goes offscreen?

so this only i want it to pause when the l hits the left side of the skin then let it continue.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote: Edit: i found an example of what I'm looking for in a different coding language. http://www.jqueryscript.net/demo/Text-Scrolling-Plugin-for-jQuery-Marquee/
I think this is what you want:

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=500
XValue=0
Repeat=0

;=== 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 3000 | 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=Something
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=Something
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
Let me know if that's what you need! :D
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

kyriakos876 wrote:I think this is what you want:

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=500
XValue=0
Repeat=0

;=== 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 3000 | 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=Something
FontSize=50
X=#XValue#
Y=0
AntiAlias=1
DynamicVariables=1

[MeterText1Mirror]
Meter=String
Text=Something
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
Let me know if that's what you need! :D
That is exactly what i wanted :D. is there an easy way to change the speed/how long it stops for? otherwise its perfect.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote:That is exactly what i wanted :D. is there an easy way to change the speed/how long it stops for? otherwise its perfect.
On the [MeasureX1] you will see ActionList2 there you will find the waiting time. In my example you can see it's 3000 mili seconds which is 3 seconds. Change that to whatever you want and you are done.(The time is always in mili seconds so if you want, for example, 1 second set it to | Wait 1000 |.....)
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

kyriakos876 wrote:On the [MeasureX1] you will see ActionList2 there you will find the waiting time. In my example you can see it's 3000 mili seconds which is 3 seconds. Change that to whatever you want and you are done.(The time is always in mili seconds so if you want, for example, 1 second set it to | Wait 1000 |.....)
i also wanted to know how to change how fast the text moves in general. but thank you very much.

been trying to get these things working for a very long time and you fixed all of them in about a day
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Specialised moving text.

Post by kyriakos876 »

SilverDarkBlade wrote:i also wanted to know how to change how fast the text moves in general. but thank you very much.
There are 2 ways to change this. It's up to what you want.
1st way:
on the [MeasureX1] you will see this:
ActionList1=Repeat Action1 , 25 , #Repeat#
25 is the time it waits to repeat the Action1. If you want it to go faster set this to something lower than 25. If you change this make sure that you set the same value on the ActionList2=..... (Note that this will drain your CPU as it asks it to do something many time and really fast.)

2nd way:
on the [MeasureX1] again, there is this:
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
If you change the -2 (this means that on every frame the text will move2pixels, or as many as you set it) to something lower it will go faster. For example if you set it to #XValue#-5 it will go faster. (Note that lowering this too much will make the animation look laggy and not so smooth, but will not drain your CPU as much as the first option.)


To sum up, what you probably want is a mix of those two. A faster one could be the combination of 20 and -3 without making it too laggy or too heavy-(ier) for the CPU.
SilverDarkBlade wrote: been trying to get these things working for a very long time and you fixed all of them in about a day
No problem, I'm always glad to help! :D
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Specialised moving text.

Post by SilverDarkBlade »

kyriakos876 wrote:There are 2 ways to change this. It's up to what you want.
1st way:
on the [MeasureX1] you will see this:
ActionList1=Repeat Action1 , 25 , #Repeat#
25 is the time it waits to repeat the Action1. If you want it to go faster set this to something lower than 25. If you change this make sure that you set the same value on the ActionList2=..... (Note that this will drain your CPU as it asks it to do something many time and really fast.)

2nd way:
on the [MeasureX1] again, there is this:
Action1=[!SetVariable XValue "(Clamp(#XValue#-2,(-#Width#),#Width#))"][!Update]
If you change the -2 (this means that on every frame the text will move2pixels, or as many as you set it) to something lower it will go faster. For example if you set it to #XValue#-5 it will go faster. (Note that lowering this too much will make the animation look laggy and not so smooth, but will not drain your CPU as much as the first option.)


To sum up, what you probably want is a mix of those two. A faster one could be the combination of 20 and -3 without making it too laggy or too heavy-(ier) for the CPU.

No problem, I'm always glad to help! :D
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
Untitled.png
Post Reply