arcanosa84 wrote: ↑September 19th, 2023, 4:03 pm
I already tried the turning angle thing, it works perfectly. Thanks, it would be impossible to follow your code or the manual, I didn't understand much of the explanation, but I won't torment myself with that, I'll be able to understand it at some point.
Not sure about your math skills, but the TransformationMatrx option is extremely well described
here (I think I already posted the link, however...). Specifically the rotation is described into the Transformations section. According to this description, the first four elements of the TransformationMatrix option have to be the following ones:
- a = cos(angle)
- b = -sin(angle)
- c = sin(angle)
- d = cos(angle)
Obviously angle is the rotation angle, which in my code is used as #InclinationAngle#. Additionally I added a
Rad(#InclinationAngle#) function, to convert the degree-expressed angle into radians.
The last two (fifth and sixth - tx and ty) elements of the above TransformationMatrix option are taken from the What the heck is Rainmeter doing?! section. The formulas used there has been adapted to our needs. The x, x', y and y' parameters are set to the horizontal respectively vertical center of the image. For the horizontal center for instance I used the
([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2) expression. In this expression #CURRENTSECTION# represents the section in which this variable is used (in this case [MeterFrame]).
[#CURRENTSECTION#:X] is the horizontal position of the meter (this is a
section variable), while
[#CURRENTSECTION#:W] is the
width of the same meter. Adding together the horizontal position of a meter and half of its width, we get the position of the center of that image (or meter). Same applies for the vertical position as well.
These parameters have been used to calculate the tx and ty parameters of the TransformationMatrix option.
Finally the six above elements have been added to form the TransformationMatrix option.
arcanosa84 wrote: ↑September 19th, 2023, 4:03 pm
I was telling you about the size of the planet, I already did that, but I didn't send it to you that way because I was editing the images, the image of the planet and the image of the atmosphere that surrounds them were not the same, and to center the 2 images It was going to present more problems, and that's just a one-time fix. I show you how the complete code looks adding the size of the planets.
What I wanted was to achieve that instead of writing the variable as I have done in my configuration skin, use that idea of yours of selecting it directly, but it happens to me that I still can't decipher it from your code.
Instead of Size, I used a Scale variable. It is handled by the following sections of the
Mirage\Settings\Settings.ini skin:
Code: Select all
[MenuFieldStringStyle]
FontColor=0,0,0
FontEffectColor=220,220,220
StringEffect=Shadow
FontFace=#FontName#
StringStyle=BOLD
ClipString=1
AntiAlias=1
Hidden=1
[MenuButtonStyle]
MyModifiers1=Fill Color #ButtonColor#
MyModifiers2=StrokeWidth 1
MyModifiers3=Stroke Color #ButtonStrokeColor#
[MeterScaleField]
Meter=Shape
MeterStyle=FieldStyle
X=0
Y=0
Shape=Rectangle 0,0,60,18 | Extend CheckModifiers
CheckModifiers=Fill Color 225,225,225 | StrokeWidth 1 | Stroke Color #CheckStrokeColor#
MouseScrollUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...
MouseScrollDownAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
LeftMouseUpAction=[!CommandMeasure "MeasureInputScale" "ExecuteBatch 1"]
DynamicVariables=1
Group=General
[MeterScaleValue]
Meter=STRING
MeterStyle=MenuFieldStringStyle
X=33r
Y=0r
FontSize=10
StringAlign=RIGHT
Text=#Size#
DynamicVariables=1
Group=General
[MeterScaleUp]
Meter=Shape
MeterStyle=MenuButtonStyle
X=9r
Y=0r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...
[MeterScaleUpLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=S
Group=General
[MeterScaleDown]
Meter=Shape
MeterStyle=MenuButtonStyle
X=-9r
Y=5r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
Group=General
[MeterScaleDownLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=T
Group=General
This is a quite simplified code, but it doesn't use images. But it requires to have the Arrows.ttf font into the
@Resources\Fonts folder. If you place the above file there, Rainmeter will be able to use it.
Not too easy, definitely. Try to implement it if you want and if any question arises, pack the config you have and upload the package here, along with a description of the issue. Will try to take a look.