It is currently October 17th, 2021, 3:45 pm

[Help] creating a new rectangle with every for loop

Help with creating, editing & fixing problems with skins
User avatar
death.crafter
Posts: 1040
Joined: April 24th, 2021, 8:13 pm

Re: [Help] creating a new rectangle with every for loop

Post by death.crafter »

balala wrote: October 3rd, 2021, 5:46 pm You quoted two sentences. Which one are you asking about if I am sure?
Both?
from the Realm of Death
My Current Desktop
User avatar
balala
Rainmeter Sage
Posts: 13319
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Help] creating a new rectangle with every for loop

Post by balala »

death.crafter wrote: October 3rd, 2021, 7:27 pmBoth?
balala wrote: October 3rd, 2021, 3:23 pm Unfortunately this is very hard (or practically impossible) to be done in Rainmeter.
My reply was related strictly to what have I quote there:
Kea wrote: October 2nd, 2021, 1:53 pm I thought I could call a "Meter" like a function multiple times with diffrent values to create multiple rectangles
And I still sustain what have I said. Still don't see a way to do what has been expected, because Rainmeter is not a procedural programming language (which lua for instance is).
balala wrote: October 3rd, 2021, 3:23 pm I don't think it does worth to work with lua in this case, however it is possible.
I definitely might have been misunderstanding something (I often do), I'm not sure about the intentions of OP, so created a code and waiting for a reply to confirm or deny my thought. no such reply so far...
Kea
Posts: 7
Joined: October 1st, 2021, 9:10 pm

Re: [Help] creating a new rectangle with every for loop

Post by Kea »

balala wrote: October 3rd, 2021, 3:23 pm Unfortunately this is very hard (or practically impossible) to be done in Rainmeter.

I don't think it does worth to work with lua in this case, however it is possible.
First, beside CodeCode's example, take a look at the following sample:

Code: Select all

[Rainmeter]
DynamicWindowSize=1
Update=1000
BackgroundMode=2
SolidColor=250,250,250,1

[RectangleStyle]
X=2
Shape=Rectangle 0,0,100,50,10 | Extend MyModifiers1
MyModifiers1=Fill Color 94,75,125 | StrokeWidth 0 | Stroke Color 0,0,0,0
DynamicVariables=1

[MeasureShow]
Measure=Calc
Formula=( COUNTER % 10 )

[MeterRectangle1]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<0)

[MeterRectangle2]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<1)

[MeterRectangle3]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<2)

[MeterRectangle4]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<3)

[MeterRectangle5]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<4)

[MeterRectangle6]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<5)

[MeterRectangle7]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<6)

[MeterRectangle8]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<7)

[MeterRectangle9]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<8)

[MeterRectangle10]
Meter=Shape
MeterStyle=RectangleStyle
Y=5R
Hidden=([MeasureShow]<9)
Here are ten rectangles and the skin shows them up one by one. Is this looking as what do you expect?
Sorry for the late reply, this is what I wanted to achieve, thanks for your help! now the only problem is parsing it from my NodeJS script to rainmeter and then displaying the values... but I'll address that in a separate thread.
User avatar
balala
Rainmeter Sage
Posts: 13319
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Help] creating a new rectangle with every for loop

Post by balala »

Kea wrote: October 5th, 2021, 3:40 pm Sorry for the late reply, this is what I wanted to achieve, thanks for your help!
Great!
Kea wrote: October 5th, 2021, 3:40 pm now the only problem is parsing it from my NodeJS script to rainmeter and then displaying the values... but I'll address that in a separate thread.
Posted a sample back in the topic.