It is currently April 18th, 2024, 1:46 am

Rotating buttons

Get help with creating, editing & fixing problems with skins
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Rotating buttons

Post by kyriakos876 »

Hello, I'm currently working on a skin and I want some buttons to display on a circle. So I went to the docs and found that adding:

Code: Select all

OffsetX=SomeX
OffsetY=SomeY
StartAngle=SomeAngle
RotationAngle=SomeAngle2
to any meter should display the meter rotated in an angle as set above. Yet here I am getting no changes between these two codes:

Code: Select all

[MeterName]
Meter=Button
X=0
Y=0
ButtonImage=#@#Button.png
OffsetX=3
OffsetY=3
StartAngle=45
RotationAngle=23

Code: Select all

[MeterName]
Meter=Button
X=0
Y=0
ButtonImage=#@#Button.png
Both codes display the same meter with no rotation whatsoever. Any idea on what it is that I'm doing wrong?
Thanks in advance.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating buttons

Post by jsmorley »

No, those options you are using are for the Rotator and Roundline meters (OffsetX, OffsetY are just for Rotator), and are not general meter options.

The only thing that will rotate a Button meter is TransformationMatrix, and I have not tested to see what impact that might have on the mouse targeting.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Rotating buttons

Post by kyriakos876 »

jsmorley wrote:No, those options you are using are for the Rotator and Roundline meters (OffsetX, OffsetY are just for Rotator), and are not general meter options.

The only thing that will rotate a Button meter is TransformationMatrix, and I had not tested to see what impact that might have on the mouse targeting.
Doesn't that mean I can use any meter? (See picture below)
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating buttons

Post by jsmorley »

kyriakos876 wrote:Doesn't that mean I can use any meter? (See picture below)
Nope. That means that that meter type (Rotator) in this case, also supports all the options listed in the link for General Meter Options, in addition to the specific options listed in the specific documentation for the Rotator meter.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Rotating buttons

Post by kyriakos876 »

jsmorley wrote:Nope. That means that that meter type (Rotator) in this case, also supports all the options listed in the link for General Meter Options
Okay, I feel stupid, but I also went to this link and the first option is "Meter" and has (e.g. Bar or String) which implies Image Button etc. as well.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Rotating buttons

Post by kyriakos876 »

jsmorley wrote:Nope. That means that that meter type (Rotator) in this case, also supports all the options listed in the link for General Meter Options, in addition to the specific options listed in the specific documentation for the Rotator meter.
Oh I get it. Okay thanks :)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating buttons

Post by jsmorley »

I'm not a huge fan of the Button meter, as it does have limitations. You can't ever "size" the button with W and / or H, and you can't use Image options like ImageRotate. Personally, I find that three images, using all the various mouse hover and click options, gives me the best control while keeping all the flexibility of the Image meter.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating buttons

Post by jsmorley »

The Button meter has a couple of strengths as well, in fairness.

1) You don't have to use LeftMouseDownAction to get the "down" effect, which when used with an Image meter can complicate "dragging" the skin when on that meter.

2) The mouse targeting on a Button meter is always only on the solid bits of the button image. With an Image meter, the mouse targeting is on ANY solid bit that is contained in the meter bounds defined by the image meter. That means that if you have anything solid "behind" the image meter, you can get mouse detection when you might not want it, on transparent parts of the actual image.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Rotating buttons

Post by kyriakos876 »

jsmorley wrote:I'm not a huge fan of the Button meter, as it does have limitations. You can't ever "size" the button with W and / or H, and you can't use Image options like ImageRotate. Personally, I find that three images, using all the various mouse hover and click options, gives me the best control while keeping all the flexibility of the Image meter.
I don't like the Button meter for that as well but I like even less the MouseDownAction (even more when the skin consists of buttons making it unable to drag unless you hit Ctrl+click) :D I took a look in the TransformationMatrix command and it won't do what I want to do any different than using X and Y in the meter.
In the picture below those grey circle are what I'm doing. It took me a long time to find the correct X and Y for every button to make a legit curve, and I had to do more maths than code. So I saw the rotationAngle thing and hoped I could do that just with one number (the angle of the rotation) and avoid all this lame X and Y stuff.
You do not have the required permissions to view the files attached to this post.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Rotating buttons

Post by kyriakos876 »

jsmorley wrote:The Button meter has a couple of strengths as well, in fairness.

1) You don't have to use LeftMouseDownAction to get the "down" effect, which when used with an Image meter can complicate "dragging" the skin when on that meter.

2) The mouse targeting on a Button meter is always only on the solid bits of the button image. With an Image meter, the mouse targeting is on ANY solid bit that is contained in the meter bounds defined by the image meter. That means that if you have anything solid "behind" the image meter, you can get mouse detection when you might not want it, on transparent parts of the actual image.
Sometimes tho the 2nd one can be irritating (as you saw in one of my posts yesterday if you remember), due the weird Icon set as a button but yea. I hate that MouseDownAction too much to give up for the 2nd reason being a problem :P