It is currently July 15th, 2020, 11:27 am

Help: Switching wallpapers with a button

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote:
May 13th, 2020, 9:21 pm
Actually I don't think I can go with choice 2, since I have a different ArcAngleStart and ArcAngleEnd for each arcs.
It would mean creating a measure for each arcs then.
FALSE! You'd have a single measure, just add [MeasureRotateClockwise] to each of the start/end angles like this:

Code: Select all

[!SetVariable ArcAngleStart1 (([MeasureRotateClockwise]+#ArcAngleStart1#)%360)][!SetVariable ArcAngleEnd1 (([MeasureRotateClockwise]+#ArcAngleEnd1#)%360)][!SetVariable ArcAngleStart2 (([MeasureRotateClockwise]+#ArcAngleStart2#)%360)][!SetVariable ArcAngleEnd2 (([MeasureRotateClockwise]+#ArcAngleEnd2#)%360)]...
in the OnUpdateAction of the measure. An update of the meters followed by a redraw might be needed, but not necessarily, I think.

Common, Mino, start to think for yourself, come up with solutions, be creative. Don't just look at the choices and take them literally. Anything can be tweaked to suit your needs... ;-)
Mino_el_Nukenin
Posts: 224
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Yincognito wrote:
May 13th, 2020, 9:35 pm
FALSE! You'd have a single measure, just add [MeasureRotateClockwise] to each of the start/end angles like this:

Code: Select all

[!SetVariable ArcAngleStart1 (([MeasureRotateClockwise]+#ArcAngleStart1#)%360)][!SetVariable ArcAngleEnd1 (([MeasureRotateClockwise]+#ArcAngleEnd1#)%360)][!SetVariable ArcAngleStart2 (([MeasureRotateClockwise]+#ArcAngleStart2#)%360)][!SetVariable ArcAngleEnd2 (([MeasureRotateClockwise]+#ArcAngleEnd2#)%360)]...
in the OnUpdateAction of the measure. An update of the meters followed by a redraw might be needed, but not necessarily, I think.

Common, Mino, start to think for yourself, come up with solutions, be creative. Don't just look at the choices and take them literally. Anything can be tweaked to suit your needs... ;-)
YEah just realized it after trying this solution.
I was tweaking already. I actually just have to put +(difference between arcstart and arcend. Thta's the same thing.

EDIT : Working now, had to put manually each arcstart and arcend to keep the original pattern with the chosen angles.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

Mino_el_Nukenin wrote:
May 13th, 2020, 9:43 pm
I was tweaking already. I actually just have to put +(difference between arcstart and arcend. Thta's the same thing.
Exactly.
User avatar
balala
Rainmeter Sage
Posts: 11036
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote:
May 13th, 2020, 9:21 pm
EDIT Choice 1 not working. The arcs go everywhere...
Actually as far as I can tell, at least for me it works:
GIF.gif
However I had to add a X=5 and Y=5 options to [MeterShapes], because without these, I get the upper and left side of the skin cut off.

EDIT: In fact both codes are working same way, get the same result. However the same X and Y options had to be added on both codes.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

balala wrote:
May 14th, 2020, 6:08 am
Actually as far as I can tell, at least for me it works:
GIF.gif
However I had to add a X=5 and Y=5 options to [MeterShapes], because without these, I get the upper and left side of the skin cut off.

EDIT: In fact both codes are working same way, get the same result. However the same X and Y options had to be added on both codes.
Well, yeah, in my samples it all works properly (bar the offset that had to be set on X and Y that I didn't bother to add since it was trivial), since the idea was to produce the same results throught 2 different methods, but in the OP's code he initially had:

Code: Select all

--- Anchors Rotation ---
AnchorX=(#EllipseCenterX#-#ArcCenterX#+#ArcRadiusX#)
AnchorY=(#EllipseCenterY#-#ArcCenterY#+#ArcRadiusY#)
which were incorrect, and that's why things were spread out everywhere. He probably set these variables trying to find out where he needs to set the center of rotation, because, as I mentioned here in the P.S., I think that the coordinates for rotations/skewing/scaling (basically all the shapes' Transform Modifiers) need to follow the same principles as in TransformationMatrix, where all transformations are relative to the top left corner of the window and not the meter itself. If so, the manual should have explicitly mentioned that, in my view.

Bottom line, if these things were "normal" (like in a Roundline meter, for example), then the center of rotation shouldn't have needed an offset on it, and would have been simply #ArcCenterX# and #ArcCenterY#, basically the same center as the ellipse. Choice 2 doesn't use the Rotate parameter of the shapes, so it's completely free of this drawback of having to set an offset to the rotation center - that's why I recommended it.
User avatar
balala
Rainmeter Sage
Posts: 11036
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Yincognito wrote:
May 14th, 2020, 9:49 am
because, as I mentioned here in the P.S., I think that the coordinates for rotations/skewing/scaling (basically all the shapes' Transform Modifiers) need to follow the same principles as in TransformationMatrix, where all transformations are relative to the top left corner of the window and not the meter itself. If so, the manual should have explicitly mentioned that, in my view.
If you think so, post a request on the Site Discussion section and it'll be fixed soon, probably.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help: Switching wallpapers with a button

Post by Yincognito »

balala wrote:
May 14th, 2020, 12:43 pm
If you think so, post a request on the Site Discussion section and it'll be fixed soon, probably.
Well, it's not that important to worth a request just for this, but not playing before with the shape's transform modifiers I had a hard time figuring out why and by how much the center of rotation had to be modified. I knew how things worked in transformation matrices, but even though the name of the options looked similar between the two, there was no specific note that the same rules applied here.
User avatar
balala
Rainmeter Sage
Posts: 11036
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Yincognito wrote:
May 14th, 2020, 1:20 pm
Well, it's not that important to worth a request just for this,
As you wish...
Mino_el_Nukenin
Posts: 224
Joined: April 24th, 2020, 7:39 pm
Location: France

Re: Help: Switching wallpapers with a button

Post by Mino_el_Nukenin »

Okay so i've been upgrading the skin with rotating shapes and i'm facing several problems.

- The meter with the shapes is central in my skins and I want to add severals different meters around it. So I was kinda stuck with how I could expand the skin size. The only way I found was to set the X and Y of the first meter (the one with shapes) in the center of my screen; then I created all the others meters with .png based on this and made them the size of the screen so they could fit exactly as I want with the first metershape.
But I'm pretty sure there is another way more easier to fit and add meters to a first meter that as to be in the middle of the screen.

- I've added a meter with a bang that toggle others hidden meters of the skin with a MyVar variable. This meter should also change visual when clicking again with MyVar but nothing as well. And last problem with this one, not only the meter but the whole skin is reacting to the mouse what it shouldn't do.

I join you the whole skin so you can see for yourself.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11036
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help: Switching wallpapers with a button

Post by balala »

Mino_el_Nukenin wrote:
May 15th, 2020, 9:25 pm
I join you the whole skin so you can see for yourself.
Something is not well with posted skin. In fact the it doesn't even appear on screen, especially that it has nothing to show. The complete code of NewSkin.ini is extremely simple:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=
Author=
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]

[MeterString]
Meter=String
As said, nothing to be shown. Please check the package.