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

Meters not being drawn on screen after adding to file

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: Meters not being drawn on screen after adding to file

Post by balala »

nosanctuary wrote:However, two lines above, the Wind Direction arrow seems to move around a bit - and I'm not sure how to fix that.
This moving around is caused by the Angle option of the [MeterCurrentWindDirection] meter. Although for simple rotations of a String meter, the Angle option is good enough, for such rotations (when the direction of the wind is continuously changing), it could be difficult to properly manage it.
Instead I'd be tempted to rotate the meter not with the Angle option, but with a properly written TransformationMatrix. It's much more easier to manage it and more accurate rotations can be achieved (but here I have to say I'm a big fan of this extremely powerful option). It's not easy to write a proper TransformationMatrix, but finally neither impossible isn't.
So, I wrote one, please try it and let me know if it is rotating the arrow as it should have to. Remove the Angle option of the [MeterCurrentWindDirection] meter and add the following TransformationMatrix option:

Code: Select all

TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))
The replace a few other options on the same and following meters, as it follows (don't remove or alter any here not posted option):

Code: Select all

[MeterCurrentWindDirection]
...
X=236
Y=-8R
...
StringAlign=CenterCenter
...
TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))

[MeterCurrentWDewPoint]
...
Y=13r
nosanctuary wrote:Also, and it may be related - instead of 12 mph, it should be saying Wind 12 mph. Part of it is being cut off. I did try adding a line for the width, but that didn't seem to help. That's what makes me think it might be due to the arrow, or alignment.
No, it's not due to the arrow, neither to the alignment.
The Wind word is hidden either by the IfTrueAction, either by the IfFalseAction option (which one is executed) of the [CurrentWindSpeedChild] measure. Modify them, to get the Wind word added before the speed:

Code: Select all

[CurrentWindSpeedChild]
...
IfCondition=CurrentWindSpeedChild = 0
IfTrueAction=[!SetOption MeterCurrentWind Text "Wind %1"]
IfFalseAction=[!SetOption MeterCurrentWind Text "Wind %1 [*UnitsSpeedChild*]"]
nosanctuary
Posts: 24
Joined: February 21st, 2018, 4:51 pm

Re: Meters not being drawn on screen after adding to file

Post by nosanctuary »

balala wrote:This moving around is caused by the Angle option of the [MeterCurrentWindDirection] meter. Although for simple rotations of a String meter, the Angle option is good enough, for such rotations (when the direction of the wind is continuously changing), it could be difficult to properly manage it.
Instead I'd be tempted to rotate the meter not with the Angle option, but with a properly written TransformationMatrix. It's much more easier to manage it and more accurate rotations can be achieved (but here I have to say I'm a big fan of this extremely powerful option). It's not easy to write a proper TransformationMatrix, but finally neither impossible isn't.
So, I wrote one, please try it and let me know if it is rotating the arrow as it should have to. Remove the Angle option of the [MeterCurrentWindDirection] meter and add the following TransformationMatrix option:

Code: Select all

TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))
The replace a few other options on the same and following meters, as it follows (don't remove or alter any here not posted option):

Code: Select all

[MeterCurrentWindDirection]
...
X=236
Y=-8R
...
StringAlign=CenterCenter
...
TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild])));(-Sin(Rad([CurrentWindDirectionChild])));(Sin(Rad([CurrentWindDirectionChild])));(Cos(Rad([CurrentWindDirectionChild])));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild])))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]))))

[MeterCurrentWDewPoint]
...
Y=13r
No, it's not due to the arrow, neither to the alignment.
The Wind word is hidden either by the IfTrueAction, either by the IfFalseAction option (which one is executed) of the [CurrentWindSpeedChild] measure. Modify them, to get the Wind word added before the speed:

Code: Select all

[CurrentWindSpeedChild]
...
IfCondition=CurrentWindSpeedChild = 0
IfTrueAction=[!SetOption MeterCurrentWind Text "Wind %1"]
IfFalseAction=[!SetOption MeterCurrentWind Text "Wind %1 [*UnitsSpeedChild*]"]
Thanks balala, you solved it! Now, my only issue is the arrow is pointing NE, but should be pointing NW. Wind is currently coming from the SE. Which part will I need to change in the transformation matrix? That part is still way too confusing to me...as for the Wind string, you were correct, and I can't believe I missed that - I had had to edit it earlier, and already forgot about that being in the measure. :oops:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meters not being drawn on screen after adding to file

Post by balala »

nosanctuary wrote:Thanks balala, you solved it! Now, my only issue is the arrow is pointing NE, but should be pointing NW. Wind is currently coming from the SE. Which part will I need to change in the transformation matrix? That part is still way too confusing to me...as for the Wind string, you were correct, and I can't believe I missed that - I had had to edit it earlier, and already forgot about that being in the measure. :oops:
Try to add everywhere in the TransformationMatrix option a constant value to the [CurrentWindDirectionChild] measure. Eg, add 90:

Code: Select all

TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild]+90)));(-Sin(Rad([CurrentWindDirectionChild]+90)));(Sin(Rad([CurrentWindDirectionChild]+90)));(Cos(Rad([CurrentWindDirectionChild]+90)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild]+90)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]+90))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild]+90)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]+90))))
Probably the 90 degrees is not the best value, you have to make a few tries to get the best value. But I'd say once you get it, you can use it with no problem (I hope).
And yes, the TransformationMatrix can be very confusing, especially when you're starting to use it. But after a while, if you're keep using it, you'll get used to it - it's not so difficult as it seem in the very first moment.
nosanctuary
Posts: 24
Joined: February 21st, 2018, 4:51 pm

Re: Meters not being drawn on screen after adding to file

Post by nosanctuary »

balala wrote:Try to add everywhere in the TransformationMatrix option a constant value to the [CurrentWindDirectionChild] measure. Eg, add 90:

Code: Select all

TransformationMatrix=(Cos(Rad([CurrentWindDirectionChild]+90)));(-Sin(Rad([CurrentWindDirectionChild]+90)));(Sin(Rad([CurrentWindDirectionChild]+90)));(Cos(Rad([CurrentWindDirectionChild]+90)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad([CurrentWindDirectionChild]+90)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad([CurrentWindDirectionChild]+90))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad([CurrentWindDirectionChild]+90)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad([CurrentWindDirectionChild]+90))))
Probably the 90 degrees is not the best value, you have to make a few tries to get the best value. But I'd say once you get it, you can use it with no problem (I hope).
And yes, the TransformationMatrix can be very confusing, especially when you're starting to use it. But after a while, if you're keep using it, you'll get used to it - it's not so difficult as it seem in the very first moment.
Thank you so much! I will do some reading on the transformation matrix and see what I can come up with for a value, but the +90 did point it in the correct direction.

Here is the newest revision:

https://1drv.ms/u/s!AkJkQjo_Cl-FwkcEhYGNTSpsyLGv
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meters not being drawn on screen after adding to file

Post by balala »

nosanctuary wrote:Thank you so much! I will do some reading on the transformation matrix and see what I can come up with for a value, but the +90 did point it in the correct direction.
In the Transformation Matrix Guide, you have a very good description of how this option work. Feel free to ask if something isn't clear enough.
nosanctuary wrote:Here is the newest revision:

https://1drv.ms/u/s!AkJkQjo_Cl-FwkcEhYGNTSpsyLGv
I'm glad if you got it working. However I'd have two more things to add:
  • The SkinHeight=1000 (Rainmeter section) is too much, in my opinion. I'd reduce this value to 280:SkinHeight=280.
  • The background of the skin being transparent, I'd also add the following two options to the same [Rainmeter] section:

    Code: Select all

    [Rainmeter]
    ...
    BackgroundMode=2
    SolidColor=0,0,0,1
    The SolidColor option makes the skin much more easier clickable, because although its background still looks like it'd be transparent, in reality it's not any more, having an opacity of 1 (from 255). This trick makes much more easier to click (or right click) the skin.
nosanctuary
Posts: 24
Joined: February 21st, 2018, 4:51 pm

Re: Meters not being drawn on screen after adding to file

Post by nosanctuary »

balala wrote:In the Transformation Matrix Guide, you have a very good description of how this option work. Feel free to ask if something isn't clear enough.

I'm glad if you got it working. However I'd have two more things to add:
  • The SkinHeight=1000 (Rainmeter section) is too much, in my opinion. I'd reduce this value to 280:SkinHeight=280.
  • The background of the skin being transparent, I'd also add the following two options to the same [Rainmeter] section:

    Code: Select all

    [Rainmeter]
    ...
    BackgroundMode=2
    SolidColor=0,0,0,1
    The SolidColor option makes the skin much more easier clickable, because although its background still looks like it'd be transparent, in reality it's not any more, having an opacity of 1 (from 255). This trick makes much more easier to click (or right click) the skin.
Thanks, I'll do that with the background. The reason for the height is because I want it to go down the side of the screen. I want to add a forecast for the next 6 days to the skin as well. Can I just remove the skin height value, and use the #WORKAREAHEIGHT# for that?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Meters not being drawn on screen after adding to file

Post by balala »

nosanctuary wrote:Can I just remove the skin height value, and use the #WORKAREAHEIGHT# for that?
Yeah, you can. But I'd be tempted to use instead the #SCREENAREAHEIGHT#.
nosanctuary
Posts: 24
Joined: February 21st, 2018, 4:51 pm

Re: Meters not being drawn on screen after adding to file

Post by nosanctuary »

jsmorley wrote:The issue is the SkinWidth and SkinHeight here:

Code: Select all

[Rainmeter]
Update=1000
SkinWidth=251
SkinHeight=1000
DynamicWindowSize=1
AccurateText=1
Adjust those values as needed...
I forgot to ask earlier if it was okay for me to use your WXDataWeathRegExp.inc and CheckAlerts.lua script - and also to THANK YOU because reading through your tutorial and weather skin code were very helpful in figuring all this out enough to try creating my own. :rosegift:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Meters not being drawn on screen after adding to file

Post by jsmorley »

nosanctuary wrote:I forgot to ask earlier if it was okay for me to use your WXDataWeathRegExp.inc and CheckAlerts.lua script - and also to THANK YOU because reading through your tutorial and weather skin code were very helpful in figuring all this out enough to try creating my own. :rosegift:
Anything that I do with Rainmeter is entirely open for any kind of use or change that you desire.
nosanctuary
Posts: 24
Joined: February 21st, 2018, 4:51 pm

Re: Meters not being drawn on screen after adding to file

Post by nosanctuary »

Thank you to everyone who helped me with this - I still have some tweaking to do, but the skin is mostly done!
Attachments
WeatherCenter.png
Post Reply