Hi
Please stop making excuses for yourself. I have read many threads in this forum before this post and know how helpful you are. Your first solution simply shows the problem and I cannot use it due to X changes, and your 2nd solution does not work for my situation since it makes the title disappear completely when I up the letter count to 15 and only use 7 for instance. I had it (as you suggested) in its own meter that I placed there, and ran into as many problems with that, but I somehow got it to work. I even had a version that inserted the paths into the meter as needed with bangs, but there I discovered a bug that crashes rainmeter completely.
You must remember that this solution is also animated, and the title can change at any point. I am not just dismissing your solutions. I also have not got the original config on me right now.
Kind Regards
Jayson
It is currently May 25th, 2024, 1:44 pm
Shape Meter - Scaling not centered/offset correctly for combined shapes.
-
- Posts: 10
- Joined: June 24th, 2021, 8:58 am
-
- Rainmeter Sage
- Posts: 7330
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
Well, who's "aggressive" now, erm?
Yeah, maybe that's part of the problem, Jayson - I have no idea what you want to do in your code, and which things can be considered acceptable and which not. In such a case - and this is the reality, not some excuse - most solutions will be rated as workarounds or simply not feasible due to your specific requirements.JHB101101 wrote: ↑June 26th, 2021, 6:11 amYour first solution simply shows the problem and I cannot use it due to X changes, and your 2nd solution does not work for my situation since it makes the title disappear completely when I up the letter count to 15 and only use 7 for instance. I had it (as you suggested) in its own meter that I placed there, and ran into as many problems with that, but I somehow got it to work. I even had a version that inserted the paths into the meter as needed with bangs, but there I discovered a bug that crashes rainmeter completely.
You must remember that this solution is also animated, and the title can change at any point. I am not just dismissing your solutions. I also have not got the original config on me right now.
If you have read many threads in this forum before this post, you probably know that I'm not one to always require the packed skin when helping out (though it's a sane thing to do, in general) - but can't you make a list or something, maybe some simple photoshopped images as well, describing as precisely as possible what you actually do in the skin when it comes to these shapes? For example:
- variable number of letters?
- variable alignment of "text"?
- variable letter size?
- variable text position?
- full screen skin / background?
By the way, how do you test if a solution works or not, if you don't have the original config ATM? You just copy paste the ShapeN lines of the "A" glyph?
-
- Developer
- Posts: 22634
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
I don't think anyone is being particularly "aggressive" in this. One should always be careful to take into consideration the complexity of English and the fact that many, many folks on these forums have English as a second language, and live in a different cultural setting. I like to give the benefit of the doubt when a response is ambiguous or might sound odd to my "ears".
I think that this:
Please stop making excuses for yourself. I have read many threads in this forum before this post and know how helpful you are.
Might be better interpreted as:
Please stop apologizing for yourself. I have read many threads in this forum before this post and know how helpful you are.
The term "making excuses" an easily be interpreted as having negative connotations. I'm pretty sure that isn't what was intended.
I think that this:
Please stop making excuses for yourself. I have read many threads in this forum before this post and know how helpful you are.
Might be better interpreted as:
Please stop apologizing for yourself. I have read many threads in this forum before this post and know how helpful you are.
The term "making excuses" an easily be interpreted as having negative connotations. I'm pretty sure that isn't what was intended.
-
- Posts: 10
- Joined: June 24th, 2021, 8:58 am
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
Hi
@jsmorley is absolutely correct. I did not think it would go over like that so I apologize for the misunderstanding.
I am making a menu system that will cover the entire screen. It has a top title and that is in the top right corner of the screen surrounded by a band that runs across the screen. Since we have started talking I have made the title its own thing so it is left to right text and then aligned right to left. This is not my computer, so I just have that. It draws correctly when I change the title text (using a button), but has problems drawing the first time. Not that it is wrong, but that it does not leave the 5 pixel border on both sides. That I can troubleshoot, but it is certainly a concern because this is how I will add my button text also (hence the scaling). I would like this to work in all directions without a lot of work-arounds. The fact that it does not draw correctly the first time reminds me that I had to update it twice and then redraw for some odd reason. When I draw it directly into the shape that goes away, but then the problems we have seen here starts.
Kind Regards
Jayson
@jsmorley is absolutely correct. I did not think it would go over like that so I apologize for the misunderstanding.
I am making a menu system that will cover the entire screen. It has a top title and that is in the top right corner of the screen surrounded by a band that runs across the screen. Since we have started talking I have made the title its own thing so it is left to right text and then aligned right to left. This is not my computer, so I just have that. It draws correctly when I change the title text (using a button), but has problems drawing the first time. Not that it is wrong, but that it does not leave the 5 pixel border on both sides. That I can troubleshoot, but it is certainly a concern because this is how I will add my button text also (hence the scaling). I would like this to work in all directions without a lot of work-arounds. The fact that it does not draw correctly the first time reminds me that I had to update it twice and then redraw for some odd reason. When I draw it directly into the shape that goes away, but then the problems we have seen here starts.
Kind Regards
Jayson
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
Hi Jayson,
I was not really a part of this conversation all along. But You haven't provided a rmskin or zip or a screenshot for us to help you. As you can see Yincognito tried but couldn't provide a satisfying solution since your question doesn't consist a solid description as to what you want exactly.
This thing is rather complex. So I would like to have a full working copy of the example skin(code, zip or rmskin) before I can have a say in the matter. And there are others who might lend a hand if they can see what is actually going on.
Regards,
death.crafter
from the Realm of Death
-
- Rainmeter Sage
- Posts: 7330
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
You're right. I kind of got that, thus the "LOL" after, meaning it was a joke about him being "aggressive" and all. By the way, the "good luck in finding a way around it that you like" in my earlier post shouldn't be interpreted as having a negative meaning either. I genuinely tried to wish the OP luck in his search for a solution, didn't imply that he won't find any.
Again, you're spot on with the "English as a second language" issue and wise enough to give the benefit of the doubt in most cases. It's one of the reasons I like this forum environment. Jumping to (erronate) conclusions is very rare, and folks understand each other nicely.
-
- Rainmeter Sage
- Posts: 7330
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
No problem, I was kind of undecided on the meaning and simulated anger in a light-hearted way.JHB101101 wrote: ↑June 26th, 2021, 12:26 pm Hi
@jsmorley is absolutely correct. I did not think it would go over like that so I apologize for the misunderstanding.
I am making a menu system that will cover the entire screen. It has a top title and that is in the top right corner of the screen surrounded by a band that runs across the screen. Since we have started talking I have made the title its own thing so it is left to right text and then aligned right to left. This is not my computer, so I just have that. It draws correctly when I change the title text (using a button), but has problems drawing the first time. Not that it is wrong, but that it does not leave the 5 pixel border on both sides. That I can troubleshoot, but it is certainly a concern because this is how I will add my button text also (hence the scaling). I would like this to work in all directions without a lot of work-arounds. The fact that it does not draw correctly the first time reminds me that I had to update it twice and then redraw for some odd reason. When I draw it directly into the shape that goes away, but then the problems we have seen here starts.
Kind Regards
Jayson
Now, on the border thing: I'm not sure what border is that (i.e. the border of the button, or the border of the letter / letter text?) but if it's the latter, as far as I could see in your code, you only leave a 5 px border on the right of each letter, aka the (47 - 42) difference. Each letter starts at 0 to the left, so there is no 5 px left border for a letter - maybe that's the issue?
It should draw correctly the first time too. So, let me see if I understood correctly: you have the button (or the band, it doesn't matter) that is drawn independently of the shape letters. You want to put your shape letter "text" on top of your button / band using scaling, so that the text fits the button (or the desired part of the band) while leaving a certain border (5 px here) to each margin of the button or band "placeholder". Is that correct?
One thing I don't understand is how this has anything to do with not wanting to modify certain parameters (e.g. X, or combined scale offset) because of the full screen requirement. I mean, all I'm saying is that it shouldn't matter at all. You can put things in a full screen scenario using the X / Y / offset / whatever, you don't necessarily have to "instil" those offset values into the letters or the combined letter "string" shape themselves. First, it can lead to issues when you change things, secondly they won't be flexible enough if you want to, say, move them at different coordinates at a later time.
EDIT: I think I understood why you mentioned the last thing: the menus at the top must fit the full screen width too, irrespective of word length, it's not just about each menu "text" fitting its menu placeholder or button. Let me see if I can think of something...
-
- Posts: 10
- Joined: June 24th, 2021, 8:58 am
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
Hi
No. The band at the top is 1920x100px. There is a gap to the right top of the screen. There is 5px gap between the title and the band on either side which is calculated using XY on the meter. There is no 5px gap when I draw the title as a separate meter, since it will simply throw the 5px after the last letter away.
Now when I refresh there is a title (AAA) in there that has both 5px gaps on the right-hand side (Wrong). Then when I click the button to change the title to say AA it comes right. Now the refresh and the button way of changing the title both run through the same measures and meters you have typed up earlier. They should be the same. I am sure you can figure out by now what the 100px is that I subtract from each letter on the X. That is where the band continues to the end. It will always only be this title in that bar.
PS: The scaling is for other buttons that I do not have on me.
Kind Regards
Jayson
No. The band at the top is 1920x100px. There is a gap to the right top of the screen. There is 5px gap between the title and the band on either side which is calculated using XY on the meter. There is no 5px gap when I draw the title as a separate meter, since it will simply throw the 5px after the last letter away.
Now when I refresh there is a title (AAA) in there that has both 5px gaps on the right-hand side (Wrong). Then when I click the button to change the title to say AA it comes right. Now the refresh and the button way of changing the title both run through the same measures and meters you have typed up earlier. They should be the same. I am sure you can figure out by now what the 100px is that I subtract from each letter on the X. That is where the band continues to the end. It will always only be this title in that bar.
PS: The scaling is for other buttons that I do not have on me.
Kind Regards
Jayson
-
- Rainmeter Sage
- Posts: 7330
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
Well, I just tried the scaling thing for my initial "HELP string" and it worked no problems (no meter X change, no combined scale offset, right aligned, etc.):
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!ToggleMeter Help_OriginalSize][!UpdateMeter *][!Redraw]
---Meters---
[Help_OriginalSize]
Meter=Shape
X=0
Y=0
W=[#WORKAREAWIDTH]
H=[#WORKAREAHEIGHT]
Shape=Path HPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*4),10
HPath=0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,55 | LineTo 40,55 | LineTo 40,100 | LineTo 50,100 | LineTo 50,0 | LineTo 40,0 | LineTo 40,45 | LineTo 10,45 | LineTo 10,0 | ClosePath 1
Shape2=Path EPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*3),10
EPath=0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,55 | LineTo 50,55 | LineTo 50,45 | LineTo 10,45 | LineTo 10,10 | LineTo 50,10 | LineTo 50,0 | ClosePath 1
Shape3=Path LPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*2),10
LPath=0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,0 | ClosePath 1
Shape4=Path PPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*1),10
PPath=0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,10 | LineTo 23,10 | ArcTo 23,45,*,*,*,*,* | LineTo 10,45 | LineTo 10,55 | LineTo 23,55 | ArcTo 23,0,*,*,*,1,* | ClosePath 1
SharedModifiers=StrokeWidth 1 | Stroke Color 255,0,0,128 | Fill Color 255,255,255,128
Shape5=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4
DynamicVariables=1
[Help_Scaled]
Meter=Shape
X=0
Y=0
W=[#WORKAREAWIDTH]
H=[#WORKAREAHEIGHT]
Shape=Path HPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*4),10
HPath=0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,55 | LineTo 40,55 | LineTo 40,100 | LineTo 50,100 | LineTo 50,0 | LineTo 40,0 | LineTo 40,45 | LineTo 10,45 | LineTo 10,0 | ClosePath 1
Shape2=Path EPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*3),10
EPath=0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,55 | LineTo 50,55 | LineTo 50,45 | LineTo 10,45 | LineTo 10,10 | LineTo 50,10 | LineTo 50,0 | ClosePath 1
Shape3=Path LPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*2),10
LPath=0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,0 | ClosePath 1
Shape4=Path PPath | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-60*1),10
PPath=0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,10 | LineTo 23,10 | ArcTo 23,45,*,*,*,*,* | LineTo 10,45 | LineTo 10,55 | LineTo 23,55 | ArcTo 23,0,*,*,*,1,* | ClosePath 1
SharedModifiers=StrokeWidth 1 | Stroke Color 255,0,0,128 | Fill Color 255,255,255,255
Shape5=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Scale 0.2,0.2
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 7330
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Shape Meter - Scaling not centered/offset correctly for combined shapes.
And ... it works:Yincognito wrote: ↑June 26th, 2021, 3:07 pm Well, I just tried the scaling thing for my initial "HELP string" and it worked no problems (no meter X change, no combined scale offset, right aligned, etc). I'll try to integrate your nested variables into it and see if it works the same and will post the result.
Code: Select all
[Variables]
Topmenu_Title_Text="HELP"
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!ToggleMeter Help_OriginalSize][!UpdateMeter *][!Redraw]
---Measures Glyphs---
[Font.H.Glyph]
Measure=String
String="0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,55 | LineTo 40,55 | LineTo 40,100 | LineTo 50,100 | LineTo 50,0 | LineTo 40,0 | LineTo 40,45 | LineTo 10,45 | LineTo 10,0 | ClosePath 1"
UpdateDivider=-1
[Font.H.Advance]
Measure=String
String=60
UpdateDivider=-1
[Font.E.Glyph]
Measure=String
String="0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,55 | LineTo 50,55 | LineTo 50,45 | LineTo 10,45 | LineTo 10,10 | LineTo 50,10 | LineTo 50,0 | ClosePath 1"
UpdateDivider=-1
[Font.E.Advance]
Measure=String
String=60
UpdateDivider=-1
[Font.L.Glyph]
Measure=String
String="0,0 | LineTo 0,100 | LineTo 50,100 | LineTo 50,90 | LineTo 10,90 | LineTo 10,0 | ClosePath 1"
UpdateDivider=-1
[Font.L.Advance]
Measure=String
String=60
UpdateDivider=-1
[Font.P.Glyph]
Measure=String
String="0,0 | LineTo 0,100 | LineTo 10,100 | LineTo 10,10 | LineTo 23,10 | ArcTo 23,45,*,*,*,*,* | LineTo 10,45 | LineTo 10,55 | LineTo 23,55 | ArcTo 23,0,*,*,*,1,* | ClosePath 1"
UpdateDivider=-1
[Font.P.Advance]
Measure=String
String=60
UpdateDivider=-1
---Measures Characters---
[Title.Characters]
Group=CharactersGroup
Measure=String
String=[#Topmenu_Title_Text]
UpdateDivider=-1
;OnUpdateAction=[!UpdateMeasure Title.Character1][!UpdateMeasure Title.Character2][!UpdateMeasure Title.Character3][!UpdateMeter TopmenuFrame][!Redraw]
RegExpSubstitute=1
Substitute="[^ a-zA-Z0-9]":""
DynamicVariables=1
[Title.Character1]
Group=CharactersGroup
Measure=String
String=[&Title.Characters]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^(.).*$":"\1"," ":"Space","":"None"
DynamicVariables=1
[Title.Character2]
Group=CharactersGroup
Measure=String
String=[&Title.Characters]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.{1}(.).*$":"\1","[&Title.Characters]":""," ":"Space","":"None"
DynamicVariables=1
[Title.Character3]
Group=CharactersGroup
Measure=String
String=[&Title.Characters]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.{2}(.).*$":"\1","[&Title.Characters]":""," ":"Space","":"None"
DynamicVariables=1
[Title.Character4]
Group=CharactersGroup
Measure=String
String=[&Title.Characters]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^.{3}(.).*$":"\1","[&Title.Characters]":""," ":"Space","":"None"
DynamicVariables=1
---Meters---
[Help_OriginalSize]
Meter=Shape
X=0
Y=0
W=[#WORKAREAWIDTH]
H=[#WORKAREAHEIGHT]
Shape=Path Font.[&Title.Character1].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character1].Advance]+[&Font.[&Title.Character2].Advance]+[&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.H.Glyph=[&Font.H.Glyph]
Shape2=Path Font.[&Title.Character2].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character2].Advance]+[&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.E.Glyph=[&Font.E.Glyph]
Shape3=Path Font.[&Title.Character3].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.L.Glyph=[&Font.L.Glyph]
Shape4=Path Font.[&Title.Character4].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character4].Advance])),10
Font.P.Glyph=[&Font.P.Glyph]
SharedModifiers=StrokeWidth 1 | Stroke Color 255,0,0,128 | Fill Color 255,255,255,128
Shape5=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4
UpdateDivider=-1
DynamicVariables=1
[Help_Scaled]
Meter=Shape
X=0
Y=0
W=[#WORKAREAWIDTH]
H=[#WORKAREAHEIGHT]
Shape=Path Font.[&Title.Character1].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character1].Advance]+[&Font.[&Title.Character2].Advance]+[&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.H.Glyph=[&Font.H.Glyph]
Shape2=Path Font.[&Title.Character2].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character2].Advance]+[&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.E.Glyph=[&Font.E.Glyph]
Shape3=Path Font.[&Title.Character3].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character3].Advance]+[&Font.[&Title.Character4].Advance])),10
Font.L.Glyph=[&Font.L.Glyph]
Shape4=Path Font.[&Title.Character4].Glyph | Extend SharedModifiers | Offset ([&[#CURRENTSECTION]:W]-100-([&Font.[&Title.Character4].Advance])),10
Font.P.Glyph=[&Font.P.Glyph]
SharedModifiers=StrokeWidth 1 | Stroke Color 255,0,0,128 | Fill Color 255,255,255,255
Shape5=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Scale 0.2,0.2
UpdateDivider=-1
DynamicVariables=1