It is currently April 30th, 2024, 3:44 pm

How to rotate text

Get help with creating, editing & fixing problems with skins
Xnester
Posts: 1
Joined: April 15th, 2024, 4:58 pm

How to rotate text

Post by Xnester »

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh] 

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\#Language#.inc
Scale=0.3

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureGreeting]
Measure=Time
Format=%H
Substitute=#Greets#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterGreetingText]
Meter=String
MeasureName=MeasureGreeting
StringAlign=Left
FontColor=255,255,255
FontFace=Aquatico
FontSize=(40*#Scale#)
X=(0*#Scale#)
Y=(0*#Scale#)
Text="%1!"
AntiAlias=1
This is the code for a small text module. But I want to rotate this in a certian angle. How can I do that?
Last edited by Brian on April 15th, 2024, 5:53 pm, edited 1 time in total.
Reason: Changed [Snippet] tags to [Code] tags. It's the </> button.
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to rotate text

Post by Yincognito »

Xnester wrote: April 15th, 2024, 5:01 pmBut I want to rotate this in a certian angle. How can I do that?
If it's only about the text in a String meter:
https://docs.rainmeter.net/manual/meters/string/#Angle
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16190
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to rotate text

Post by balala »

By TransformationMatrix. Question is where would you like to have the rotation center. If it should be in the center of the [MeterGreetingText] meter, add the followings:
  • An Angle=XX variable to the [Variables] section. As you probably figured out, this will be the rotation angle. Note that a positive value means anticlockwise rotation, while negative values clockwise rotation.
  • A TransformationMatrix=(Cos(Rad(#Angle#)));(-Sin(Rad(#Angle#)));(Sin(Rad(#Angle#)));(Cos(Rad(#Angle#)));((([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*(1-Cos(Rad(#Angle#))))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#Angle#))));((([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*(1+Sin(Rad(#Angle#))))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#Angle#)))) option to the meter you'd like to rotate (in this case [MeterGreetingText] probably).