Read this way it is more understandable, if I like mathematics what happens is that all those calculations are complex, once you start reading and searching them you begin to understand, the angles already work correctly. and taking ideas from your skin I got to work and managed to make the buttons to select the size from 1 to 15, and I did the same with the angles. I already have that working, for a single planet, but since I have several, I wanted to use this same code to write to the variables. Here I leave you the publication that I made to my friend Yincognito so that you can also give your opinion when you can.balala wrote: ↑September 19th, 2023, 6:39 pm 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: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.
- a = cos(angle)
- b = -sin(angle)
- c = sin(angle)
- d = cos(angle)
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.
Instead of Size, I used a Scale variable. It is handled by the following sections of the Mirage\Settings\Settings.ini skin: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.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
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.
Help, using these forms does not write the variable correctly, I know something went wrong, but I can't figure out what, since the value does appear correctly. As before, the SizeVenus variable must be created there to write the value of that variable in the Variables file, then update the skin of that planet, the latter if done correctly. Are you telling me what I'm doing wrong???
Applying it this way
ButtonCommand=[!WriteKeyValue Variables "[#*Size[#*Planet*]]" "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
[#*Size[#Planet]]=7
Applying it this way
ButtonCommand=[!WriteKeyValue Variables [#Size[#Planet]] "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
5=9
I already managed to create a separate code to vary the size of the planets and the angle of rotation, writing this in the corresponding variable in the Variables file. but with a single planet it works perfectly, now I want to use a variable that will be called PlanetSelect for when. I select planet Venus from a button PlanetSelect=Venus
From there I want the button that I show in the photo, the one that says ok, to write the selected value for the size on the correct planet. I would use this line ButtonCommand=[!WriteKeyValue Variables [#*Size[#*Planet*]] "#Size#" "#@#\Config\Variables.inc"][!Refresh
"@AL\Planets\#Planet#" "#Planet#.ini"] but I can't get it to write to the variable that I am creating.
I'm doing all this so as not to make the code so extensive, having to make the buttons for each planet in the configuration mask, and use them only once. Is it possible or am I inventing too much???
PD:I am writing to both of you to notify you both of the publication.