It is currently March 28th, 2024, 5:29 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

HudTweaker13 wrote:I have a shape in my hud which describes a frame around the outside. I've been trying without success to put a stroke around the inside of the frame, but not the outside. Does anyone have any ideas on how I can do this?
I'd try another approach. As jsmorley wrote, the stroke can be placed only around the shape. But then let's create a second shape, which would fill the transparent part of the original shape and put the stroke around this one:

Code: Select all

[Variables]
SecondModifiers=Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 0,255,0

[MeterFrame]
Meter=Shape
x=0
y=2
Shape=Rectangle 0,0,#ScreenAreaWidth#,#ScreenAreaHeight# | Fill Color 0,0,0,0
Shape2=Rectangle 0,0,#ScreenAreaWidth#,#ScreenAreaHeight# | Extend MyModifiers1
MyModifiers1=#DefaultModifiers#
MyGradient1=#DefaultGradient#
Shape3=Rectangle 140,20,(#ScreenAreaWidth#-280),(#ScreenAreaHeight#-40),40 | Extend MyModifiers2
MyModifiers2=#DefaultModifiers#
MyGradient2=#DefaultGradient#
Shape4=Rectangle ((#ScreenAreaWidth#-400)/2),0,400,40,20 | Extend MyModifiers3
MyModifiers3=#DefaultModifiers#
MyGradient3=#DefaultGradient#
Shape5=Rectangle ((#ScreenAreaWidth#-400)/2),(#ScreenAreaHeight#-40),400,40,20 | Extend MyModifiers4
MyModifiers4=#DefaultModifiers#
MyGradient4=#DefaultGradient#
Shape6=Rectangle 0,0,#ScreenAreaWidth#,#ScreenAreaHeight# | Extend MyMod
Shape7=Rectangle 140,20,(#ScreenAreaWidth#-280),(#ScreenAreaHeight#-40),40 | Extend MyMod
Shape8=Rectangle ((#ScreenAreaWidth#-400)/2),0,400,40,20 | Extend MyMod
Shape9=Rectangle ((#ScreenAreaWidth#-400)/2),(#ScreenAreaHeight#-40),400,40,20 | Extend MyMod
MyMod=#SecondModifiers#
Shape10=Combine Shape2 | Exclude Shape3 | Union Shape4 | Union Shape5
Shape11=Combine Shape6 | Exclude Shape7 | Union Shape8 | Union Shape9
Shape12=Rectangle 5,((#ScreenAreaHeight#/2)-225),130,443,20 | StrokeWidth 0 | Fill Color 0,0,0,255
Shape13=Rectangle (#ScreenAreaWidth#-135),((#ScreenAreaHeight#/2)-225),130,443,20 | StrokeWidth 0 | Fill Color 0,0,0,255
I added here a few new shapes: from Shape6 to Shape9, then Shape11 and renumbered the old Shape7 and Shape8 as Shape12 and shape13.
As variable I defined one which sets the color and width of the stroke. Also took care to keep transparent the new combined shape.
Does this helps you?
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

Here says that "One half of the stroke will be "inside" the shape, and one half will be "outside" the shape.", I don't have high hopes as I'm pretty sure it's not in the Rainmeter's abilities, but it's worth asking, can this be changed to draw only outside of the shape?
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Thread for help with the new Shape meter

Post by Brian »

jsmorley already touched on this early on in this thread: https://forum.rainmeter.net/viewtopic.php?p=129032#p129032

I do not believe this will be possible natively...meaning, I don't think there is an option in D2D to make the stroke draw this way. While it may be possible to manipulate the stroke of the shape internally, the desired output might be difficult to get right since strokes can overlap each other.

I wouldn't hold my breath on this...

-Brian
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

Brian wrote:jsmorley already touched on this early on in this thread: https://forum.rainmeter.net/viewtopic.php?p=129032#p129032

I do not believe this will be possible natively...meaning, I don't think there is an option in D2D to make the stroke draw this way. While it may be possible to manipulate the stroke of the shape internally, the desired output might be difficult to get right since strokes can overlap each other.

I wouldn't hold my breath on this...

-Brian
I read that too, but I wasn't sure he answered my question indirectly, or if he only answered the question about odd-numbered strokes. Now, what do you mean by
Brian wrote:...While it may be possible to manipulate the stroke of the shape internally...
are you talking about something you can do with Rainmeter (if so, how), or something you can do (change the source code in C++) to make Rainmeter do it?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

kyriakos876 wrote:I read that too, but I wasn't sure he answered my question indirectly, or if he only answered the question about odd-numbered strokes. Now, what do you mean by are you talking about something you can do with Rainmeter (if so, how), or something you can do (change the source code in C++) to make Rainmeter do it?
I believe he is suggesting that changing the C++ source to manipulate the stroke might be possible, but to be honest I would oppose it. The stroke is just NOT a "border" around the shape, and any attempt to make it so only complicates and confuses things. Vector drawing has certain fundamental concepts that we should not mess with. It makes converting .svg files much harder, as that obeys the "rules", and will only be confusing to those who already understand vector graphics in Illustrator or Inkscape and such.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

jsmorley wrote:.
.
.
Vector drawing has certain fundamental concepts that we should not mess with. It makes converting .svg files much harder, as that obeys the "rules", and will only be confusing to those who already understand vector graphics in Illustrator or Inkscape and such.
I was afraid you'd something like that. Anyway, thanks.... I'll figure another way to do stuff :D
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

I will repeat the analogy I have used before.

How wide is the boundary between the US and Mexico? The answer is zero. The two countries abut. Now if you want to draw the countries on a map, you want to draw a line between them, so you know who to arrest. No matter how sharp a pencil you use to draw this line, it has some width, the size of the point of the pencil. Do you draw this line "around" the US, so you reduce the size of Mexico by that amount? No. Do you draw the line "around" Mexico, so you reduce the size of the US? No. You draw the line by putting the pencil exactly on the boundary between them. One half of the width will be in Mexico, and one half will be in the US.

You simply must come to terms with the fact that the stroke is not a "border around" the shape, but that the "center" of the stroke is what defines the shape.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

jsmorley wrote:I will repeat the analogy I have used before.

How wide is the border between the US and Mexico? The answer is zero. The two countries abut. Now if you want to draw the countries on a map, you want to draw a line between them, so you know who to arrest. No matter how sharp a pencil you use to draw this line, it has some width, the size of the point of the pencil. Do you draw this line "around" the US, so you reduce the size of Mexico by that amount? No. Do you draw the line "around" Mexico, so you reduce the size of the US? No. You draw the line by putting the pencil exactly on the boundary between them. One half of the width will be in Mexico, and one half will be in the US.
I think that creates more questions than it answers... like, do you have the option to draw the line outside but you choose not to because then it's not accurate, or you don't even have the choice? What if you have an option that let's you choose every-time: Do you want to do it the correct way, or your way? I hope that isn't entirely stupid for me to say :???:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

kyriakos876 wrote:I think that creates more questions than it answers... like, do you have the option to draw the line outside but you choose not to because then it's not accurate, or you don't even have the choice? What if you have an option that let's you choose every-time: Do you want to do it the correct way, or your way? I hope that isn't entirely stupid for me to say :???:
It comes down to the definition of a "stroke". Note that it is "stroke" and not "border". The stroke is the line used to define a shape's size, but since it is a stroke and not a border, the center of the stroke's size is what defines the size of the shape. That is just fundamental to vector drawing, and I don't think we should mess with it.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

jsmorley wrote:It comes down to the definition of a "stroke". Note that it is "stroke" and not "border". The stroke is the line used to define a shape's size, but since it is a stroke and not a border, the center of the stroke's size is what defines the size of the shape. That is just fundamental to vector drawing, and I don't think we should mess with it.
Oh yea.... now that you said it that way I got it... I mean... I had it before but now I got it... If that makes sense. I wonder how photoshop and such handle this... Like, do they draw the stroke in the middle and then move it another-half of the stroke? then would that change the shape of the shape? wooosh weird stuff. Anyway that D2D I guess... Again, thanks.
Post Reply