It is currently April 27th, 2024, 10:40 am

Need help to rotate weatherdesk

Get help with creating, editing & fixing problems with skins
Ayaan25
Posts: 1
Joined: February 10th, 2024, 10:14 am

Need help to rotate weatherdesk

Post by Ayaan25 »

https://www.deviantart.com/xenium-art/art/Weather-Desk-UPDATED-10-FEB-2022-753974672

I want to tilt it slightly to the right. Can anyone help me to do it? :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Need help to rotate weatherdesk

Post by Yincognito »

Ayaan25 wrote: February 10th, 2024, 1:03 pm https://www.deviantart.com/xenium-art/art/Weather-Desk-UPDATED-10-FEB-2022-753974672

I want to tilt it slightly to the right. Can anyone help me to do it? :thumbup:
So, you really want rotation (like at the top of this image) and not skewing (like at the bottom of this image)?
Rotation vs Skew.jpg
Either way, this is normally impossible to do in a straightforward manner, since the skin area is basically a window without borders (i.e. a plain rectangle) with no option to rotate it, just like other windows are. You can however rotate each meter (i.e. visual element) in the skin, by using either:
1) for String meters: https://docs.rainmeter.net/manual/meters/string/#Angle
2) for Image meters: https://docs.rainmeter.net/manual/meters/general-options/image-options/#ImageRotate
3) for Shape meters: https://docs.rainmeter.net/manual/meters/shape/#Rotate
4) for every meter: https://docs.rainmeter.net/manual/meters/general-options/#TransformationMatrix
but that would require correspondingly altering the X, Y coordinates and probably the W and H dimensions of each such meter (for the 1), 2) and 3) cases) in order to match visuals across the skin, as well as key drawbacks in terms of mouse actions and increased complexity (for the 4) case).

In other words, while it's technically possible to do what you want, you'd have to go through every meter in WeatherDesk.ini and adjust it to your preference, so I'm not sure it's worth the effort. Also, if you still want to do that, it would be recommended to avoid excessively polling the weather.com site during the frequent refreshing of the skin to see how it looks, by extracting the contents of this archive directly in the [YourSkinsFolder]\WeatherDesk\@Resources folder:
Weather.zip
and then temporarily replacing the line:

Code: Select all

URL=https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-wx-forecast-daily-15day;v3alertsHeadlines;v3-location-point;v3-wx-forecast-hourly-12hour?format=json&geocode=#Latitude#,#Longitude#&units=#Units#&language=#Language#&apiKey=#APIKey#
from the [YourSkinsFolder]\WeatherDesk\@Resources\Variables.inc file with:

Code: Select all

;URL=https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-wx-forecast-daily-15day;v3alertsHeadlines;v3-location-point;v3-wx-forecast-hourly-12hour?format=json&geocode=#Latitude#,#Longitude#&units=#Units#&language=#Language#&apiKey=#APIKey#
URL=file://#@#Weather.json
in order to use an equivalent local file as the source for weather data for the duration of testing the visuals. Once you're done and satisfied with the result, you can revert to the online source by simply deleting URL=file://#@#Weather.json and the ; at the beginning of the previous line in that file (in case you wonder, a ; placed at the beginning of a line comments that line so it is ignored by Rainmeter).

If you're thinking of asking, no, we (or at least, me) won't do the above for you, but we can help if you encounter difficulties. ;-)

EDIT: On a second look, it looks like the meters for the forecast days seem a bit offset to the right visually. Is this the reason why you need the above rotation?
Forecast.jpg
If so, adjusting their positions is a much simpler matter - you'd only need to adjust the numerical factor near the #size# variable, in the formulas for the X coordinate of each of the [MeterF...] meters.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need help to rotate weatherdesk

Post by balala »

As Yincognito said, to tilt a skin you have to add a properly written TransformationMatrix option to every meter of the skin. The solution is definitely not too easy, but can be done. The only disadvantage is that if any of those meters have mouse action(s) defined, the are on which the mouse action is working is not altered by the option. This means that you have to click where have to click with no TransformationMatrix applied. But at least as far as I can tell, it's not the case here, there are no such mouse actions defined.
To simplify little bit the solution add the following things to the code of your skin:
  • Add a Tilt=0.2 variable to the [Variables] section. The value is controlling the tilt of the skin. Obviously you can experiment with different values.
  • Add this section to the code:

    Code: Select all

    [TransformationMatrixStyle]
    TransformationMatrix=1;0;(-#Tilt#);1;(0.5*#Tilt#*#CURRENTCONFIGHEIGHT#);0
    DynamicVariables=1
  • Finally add the following option to each meter, one by one: MeterStyle=TransformationMatrixStyle.
Let me know if you could apply this and if this is what you wanted to achieve.