It is currently May 1st, 2024, 6:52 am

continuous scrolling RSS feed bar ticker

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: continuous scrolling RSS feed bar ticker

Post by Yincognito »

AnimaliX wrote: July 10th, 2020, 10:28 am hello, I trying to solve continuous scrolling problem with this skin (modified https://forum.rainmeter.net/viewtopic.php?t=18797):
as you can see it always "twitch" at end...
thanks, any help appreciated
Here is my solution - the one I'm using in my skins as well - which is to let all meters slide "out of view" before sliding them again. This will work irrespective of the width of meters, the only drawback is that at the end you have to wait a bit for the next "slide session" to appear. I've increased the sliding speed to alleviate that (which can be done by decreasing the value of the Step variable, the Update variable, or both):

Code: Select all

[Variables]
Update=25
Step=3
OriginalX=(#SCREENAREAWIDTH#)
TextHeight=24
Gap="     "
Mark="[\9654] "
TotalWidth=0
BackgroundColor=0, 0, 255,100

[Rainmeter]
Update=#Update#
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureRSS]
Measure=WebParser
URL="https://news.google.com/rss"
RegExp="(?siU).*<item.*>.*<title>(.*)</title>.*<title>(.*)</title>.*<title>(.*)</title>.*<title>(.*)</title>.*<title>(.*)</title>.*"
FinishAction=[!DisableMeasure MeasureCounter][!UpdateMeasure MeasureCounter][!UpdateMeasureGroup RSSGroup][!UpdateMeter *][!Redraw][!SetVariable TotalWidth ([MeterRSSItems:W])][!EnableMeasure MeasureCounter]
UpdateRate=(10*60*1000/#Update#)
DynamicVariables=1

[MeasureCounter]
Disabled=1
Measure=Calc
Formula=((MeasureCounter+#Step#)%(#OriginalX#+#TotalWidth#))
OnUpdateAction=[!MoveMeter (#OriginalX#-[MeasureCounter]) 0 MeterRSSItems]
DynamicVariables=1

[MeasureRSSItem1]
Group=RSSGroup
Measure=WebParser
URL=[MeasureRSS]
StringIndex=1
UpdateDivider=-1

[MeasureRSSItem2]
Group=RSSGroup
Measure=WebParser
URL=[MeasureRSS]
StringIndex=2
UpdateDivider=-1

[MeasureRSSItem3]
Group=RSSGroup
Measure=WebParser
URL=[MeasureRSS]
StringIndex=3
UpdateDivider=-1

[MeasureRSSItem4]
Group=RSSGroup
Measure=WebParser
URL=[MeasureRSS]
StringIndex=4
UpdateDivider=-1

[MeasureRSSItem5]
Group=RSSGroup
Measure=WebParser
URL=[MeasureRSS]
StringIndex=5
UpdateDivider=-1

---Styles---

[StyleItem]
FontColor=255, 255, 255,255
FontFace=Arial
FontSize=12
StringEffect=Shadow
FontWeight=700
StringAlign=Left
AntiAlias=1
ClipString=0

---Meters---

[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,#OriginalX#,#TextHeight# | StrokeWidth 0 | Fill Color #BackgroundColor#

[MeterContainer]
Meter=Shape
Shape=Rectangle 0,0,#OriginalX#,#TextHeight# | StrokeWidth 0 | Fill Color 0,0,0,255

[MeterRSSItems]
Container=MeterContainer
Meter=String
MeasureName=MeasureRSSItem1
MeasureName2=MeasureRSSItem2
MeasureName3=MeasureRSSItem3
MeasureName4=MeasureRSSItem4
MeasureName5=MeasureRSSItem5
MeterStyle=StyleItem
X=(#OriginalX#)
Text="#Mark#%1#Gap##Mark#%2#Gap##Mark#%3#Gap##Mark#%4#Gap##Mark#%5"
DynamicVariables=1
This puts all the feed titles in a single meter, for simplicity, uses a Container meter for safety (to avoid MemoryCompression CPU spikes and / or Windows / Rainmeter crashes), and also adapts itself to whatever the screen width is (mine is 1366, not 1920, so this will work on both). I also removed text clipping in the feed titles, since it doesn't really makes sense to have width limits in a sliding text scenario anyway, that's the whole point of sliding some meter, as you can have miles and miles of text there. Of course, you can add back the text clipping if you "break" the meter back into 5, as in your original code (don't forget to add the Container=MeterContainer line to them if you do that).

P.S. By the way, so that we're clear: balala's code is fine as well (the shorter meter width scenario is debatable, but if you're ok with it, all good) ... as long as he puts the sliding meters inside a container meter. In other words, you can use his code as well, it's your choice.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
AnimaliX
Posts: 33
Joined: August 22nd, 2016, 9:22 pm

Re: continuous scrolling RSS feed bar ticker

Post by AnimaliX »

my thanks to @balala and @Yincognito, both variants works flawlessly
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: continuous scrolling RSS feed bar ticker

Post by Yincognito »

AnimaliX wrote: July 11th, 2020, 5:48 am my thanks to @balala and @Yincognito, both variants works flawlessly
You're welcome, have fun using (or building on) whichever variant you like most. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16191
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: continuous scrolling RSS feed bar ticker

Post by balala »

AnimaliX wrote: July 11th, 2020, 5:48 am my thanks to @balala and @Yincognito, both variants works flawlessly
I'm glad. :thumbup: