It is currently April 20th, 2024, 5:04 am

New Container option

General topics related to Rainmeter.
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Test of new Container option

Post by raiguard »

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh]
OnRefreshAction=[!CommandMeasure MeasureActionTimer "Execute 1"][!CommandMeasure MeasureActionTimer "Execute 2"][!CommandMeasure MeasureActionTimer "Execute 3"]
AccurateText=1

[Variables]
; Text settings
text1=This is a long text testy
text2=This is an even loooooooooonger text testy
text3=Too short testy!
; Marquee settings
animationSpeed=32
marqueeBeginWait=1500
marqueeEndWait=1500
; Dynamic variables - do not change
marquee1=0
marquee2=0
marquee3=0

[StyleText]
FontFace=Calibri
FontColor=230,230,230
FontSize=15
FontWeight=600
X=0
Y=1R
Antialias=1
Container=MeterTextContainer
DynamicVariables=1

[MeasureMarquee1Offset]
Measure=Calc
Formula=max(0,([MeterText1:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureMarquee2Offset]
Measure=Calc
Formula=max(0,([MeterText2:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureMarquee3Offset]
Measure=Calc
Formula=max(0,([MeterText3:W] - [MeterTextContainer:W]))
DynamicVariables=1

[MeasureActionTimer]
Measure=Plugin
Plugin=ActionTimer
; Marquee 1
ActionList1=Repeat Move1,#animationSpeed#,[MeasureMarquee1Offset:] | Wait #marqueeEndWait# | Reset1 | Wait #marqueeBeginWait# | DoOver1
Reset1=[!SetVariable marquee1 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText1][!Redraw]
Move1=[!SetVariable marquee1 "(#marquee1# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText1][!Redraw]
DoOver1=[!CommandMeasure MeasureActionTimer "Execute 1"]
; Marquee 2
ActionList2=Repeat Move2,#animationSpeed#,[MeasureMarquee2Offset:] | Wait #marqueeEndWait# | Reset2 | Wait #marqueeBeginWait# | DoOver2
Reset2=[!SetVariable marquee2 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText2][!Redraw]
Move2=[!SetVariable marquee2 "(#marquee2# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText2][!Redraw]
DoOver2=[!CommandMeasure MeasureActionTimer "Execute 2"]
; Marquee 3
ActionList3=Repeat Move3,#animationSpeed#,[MeasureMarquee3Offset:] | Wait #marqueeEndWait# | Reset3 | Wait #marqueeBeginWait# | DoOver3
Reset3=[!SetVariable marquee3 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText3][!Redraw]
Move3=[!SetVariable marquee3 "(#marquee3# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterText3][!Redraw]
DoOver3=[!CommandMeasure MeasureActionTimer "Execute 3"]
DynamicVariables=1

[MeterBackground]
Meter=Shape
Shape=Rectangle 1,1,180,106,6 | StrokeWidth 2 | Stroke Color 50,50,50 | Fill Color 15,15,15

[MeterTextContainer]
Meter=Image
SolidColor=255,255,255,255
X=16
Y=16
W=150
H=76

[MeterText1]
Meter=String
MeterStyle=StyleText
X=#marquee1#
Y=1
Text=#text1#

[MeterText2]
Meter=String
MeterStyle=StyleText
X=#marquee2#
Text=#text2#

[MeterText3]
Meter=String
MeterStyle=StyleText
X=#marquee3#
Text=#text3#
simplemarquee.gif
A simple, dynamic text marquee method. It will automatically marquee any length of text, with adjustable animation rate, start and end wait intervals, and text contents. It will automatically not marquee if the text is narrower than the container it is placed in.

The next version will act like a more proper marquee, duplicating the text to create a seamless transition to the next marquee.

EDIT: Updated code to fix dumb mistake...
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: New Container option

Post by Krainz »

There is still no way to nest containers?

I'm using a shape meter to limit the draw area of some image meters but I don't want them to show up beyond the skin's intended limits

Will try a workaround with both SkinAreaWidth/SkinAreaHeight and Containers
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Container option

Post by jsmorley »

No, you can't nest containers.
User avatar
Yincognito
Rainmeter Sage
Posts: 7128
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Test of new Container option

Post by Yincognito »

raiguard wrote: December 3rd, 2018, 3:51 amHowever, I can't do it your way in my suite, because that would involve basically rewriting every skin from scratch (and some of the skins are several thousand lines long!), and that method doesn't work at all with string meters. The reason I went with TransformationMatrix was because I could, for the most part, just add the TransformationMatrix option to the styles in the stylesheet, and they just worked.
So, do you still have a problem with scaling, raiguard? Cause if you do, I might have a solution for you that doesn't involve rewriting every skin from scratch. I had this solution at the time when you posted as well, but I spent less time in this area of the forum and didn't see your posts until now. And yes, it can do string meters as well - actually any type of meter.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth