Page 5 of 7

Re: How to create crawling text?

Posted: March 16th, 2018, 3:30 pm
by balala
xenium wrote:this solution is good when the width of the text is small but when the width of the text is larger and does not fit in the width of the skin, it does not work
Yep, right. But in this case it is, isn't it?

Re: How to create crawling text?

Posted: March 16th, 2018, 5:17 pm
by xenium
balala wrote:Yep, right. But in this case it is, isn't it?
In the above situation yes, is a solution.
But in my case the text will have the width bigger than the skin, so the solution above can not use it.
It would be good if there was a solution to the situation that I exposed at the beginning

Re: How to create crawling text?

Posted: March 16th, 2018, 6:26 pm
by balala
xenium wrote:But in my case the text will have the width bigger than the skin, so the solution above can not use it.
It would be good if there was a solution to the situation that I exposed at the beginning
In such cases I don't understand how would you like to move the string. If it's wider then the skin, then
xenium wrote:for example if the skin width = 160, the text runs between 140 and 20.
makes not too much sense in my opinion. Could you please post some images with the most extreme (left and right) position of the string? I thought to some very simple images (see the attachements). Probably it's not unachievable, but I can't imagine yet how the string should have to move.

Re: How to create crawling text?

Posted: March 16th, 2018, 7:20 pm
by xenium
balala wrote: Could you please post some images with the most extreme (left and right) position of the string?
In the skin below, I would like the text to run inside the frame, not over
Test crawling.zip

Re: How to create crawling text?

Posted: March 16th, 2018, 7:46 pm
by balala
The simplest solution I think is the following: add a Frame variable to the [Variables] section. This variable represents the thickness of the edge (where the string won't run):

Code: Select all

[Variables]
...
Frame=10
I set it to 10, because in the image used as background, this is the approximate thickness of the yellow frame.
Then modify the Formula option of the [MeasureX] measure, as it follows: Formula=( Clamp (( #Speed# * COUNTER % ( #SkinWidth# + [MeterText:W] )), #Frame#, ( #SkinWidth# + [MeterText:W] - #Frame# ))).
Probably if you're using the posted background (with the thin yellow border), this solution will be good enough. But with this solution, there is a period, in which the string doesn't move on its most right and most left position. The more the thickness of that part is increasing, the more time the string will stay unmoving. That's why I say maybe this isn't the best solution, but please try it out first, then we'll see.

Re: How to create crawling text?

Posted: March 16th, 2018, 8:49 pm
by xenium
balala wrote:The simplest solution I think is the following: add a Frame variable to the [Variables] section. This variable represents the thickness of the edge (where the string won't run):

Code: Select all

[Variables]
...
Frame=10
I set it to 10, because in the image used as background, this is the approximate thickness of the yellow frame.
Then modify the Formula option of the [MeasureX] measure, as it follows: Formula=( Clamp (( #Speed# * COUNTER % ( #SkinWidth# + [MeterText:W] )), #Frame#, ( #SkinWidth# + [MeterText:W] - #Frame# ))).
Probably if you're using the posted background (with the thin yellow border), this solution will be good enough. But with this solution, there is a period, in which the string doesn't move on its most right and most left position. The more the thickness of that part is increasing, the more time the string will stay unmoving. That's why I say maybe this isn't the best solution, but please try it out first, then we'll see.
what I notice, the only difference now is that the text starts running from the inner edge of the frame, but it still runs over the frame.
In my view, the text should appear from the right inner edge of the frame and disappear into the left inner edge of the frame. It does not pass over the frame, neither when it appears nor when it disappears

Re: How to create crawling text?

Posted: March 16th, 2018, 9:28 pm
by balala
xenium wrote:In my view, the text should appear from the right inner edge of the frame and disappear into the left inner edge of the frame. It does not pass over the frame, neither when it appears nor when it disappears
Again there is a simplest solution. Should have to create a .png image which should have the yellow edge and in its center it should have to be transparent. Then you should have to put this image over the skin, AFTER the [MeterText] meter.
See the attached Frame.png. Save it into the config (in the posted example into the Test crawling folder), near the bg.png file.
Then add the following meter, immediately after the [MeterText] String meter:

Code: Select all

[MeterFrame]
Meter=Image
ImageName=Frame.png
X=0
Y=0
This way you're covering the parts of the string that shouldn't have to be visible.

Re: How to create crawling text?

Posted: March 16th, 2018, 9:51 pm
by xenium
balala wrote:Again there is a simplest solution. Should have to create a .png image which should have the yellow edge and in its center it should have to be transparent. Then you should have to put this image over the skin, AFTER the [MeterText] meter.
See the attached Frame.png. Save it into the config (in the posted example into the Test crawling folder), near the bg.png file.
Then add the following meter, immediately after the [MeterText] String meter:

Code: Select all

[MeterFrame]
Meter=Image
ImageName=Frame.png
X=0
Y=0
This way you're covering the parts of the string that shouldn't have to be visible.
:D Simpler than that, it could not!
I did not even think of it!
Thank you very much

Re: How to create crawling text?

Posted: March 16th, 2018, 9:54 pm
by balala
xenium wrote::D Simpler than that, it could not!
I did not even think of it!
Thank you very much
I'm glad if you like it. Limiting the width of the string would be hard enough.

Re: How to create crawling text?

Posted: April 12th, 2018, 6:35 pm
by xenium
Hi,
I have a scrolling text that after adding a sliding panel is no longer fully displayed.
Unlike [MeterPrefix] that has a fixed position, for [MeterName] I do not know how to fix the problem.

this is the code

Code: Select all

[Rainmeter]
Update=100
DynamicWindowSize=1
AccurateText=1
MouseActionCursor=1
SkinWidth=#SkinWidth#

[Variables]
Speed=3
SkinWidth=210
UpdateRateSeconds=6000
FontFace=arial

URL=http://aqicn.org/city/korea/seoul/yongsan-gu/



OffSet1=210
StateA=1
U1=[!UpdateMeasure MeasureSlider][!UpdateMeter "MeterInfo"][!Redraw]


[MeasureName]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<a href='http://aqicn.org/.*' title='.*' class='aqihreftarget' id='aqiwgttitle1' ><b>(.*)</b></a>:
UpdateRate=#UpdateRateSeconds#
StringIndex=1


[MeasureX]
Measure=Calc
Formula=( #Speed# * COUNTER % ( #SkinWidth# + [MeterName:W] ))
DynamicVariables=1


[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideLeft1, 2, 22 | ChangeToState2
SlideLeft1=[!SetVariable OffSet1 "(Clamp(#OffSet1#-10,7,210))"]#U1#
ChangeToState2=[!SetVariable StateA 2]
ActionList2=Repeat SlideRight1, 2, 22 | ChangeToState1
SlideRight1=[!SetVariable OffSet1 "(Clamp(#OffSet1#+10,7,210))"]#U1#
ChangeToState1=[!SetVariable StateA 1]

DynamicVariables=1


[BG1]
Meter=Image
SolidColor=0,0,0,100
X=0
Y=0
W=210
H=300

[MeterPrefix]
Meter=String
X=(#Offset1#-120)
Y=80
W=100
H=50
FontColor=255,255,255,255
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=left
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=10
Prefix="Station"


[MeterName]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=105
FontColor=255,255,255,255
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=left
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=10
DynamicVariables=1
 
[MeterInfo]
Meter=Image
ImageName=#@#Panel.png
X=#OffSet1#
Y=5
DynamicVariables=1

[button]
Meter=IMAGE
ImageName=#@#button.png
X=127
Y=1
AntiAlias=1
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Execute #StateA#"]
SolidColor=0,0,0,1