It is currently May 11th, 2024, 7:44 am

Button meter w < h

Get help with creating, editing & fixing problems with skins
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Button meter w < h

Post by Scolex »

If you have buttons to where the width is less than the height the button will not display properly.
Below is a series of buttons that are positioned with X=R and Y=r and are colored red=normal blue=click white=hover
they range from 3w to 18w and 20h, a 21w/20h, and a 27w/30h.
The 21w/20h image is correct as you can see. The others show the whole image width even though 2/3 of it should
be hidden while the visible height is ~40% of the total.

The image below is at 4x magnification just to make it easier to see.
bug.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug] Button meter w < h

Post by jsmorley »

Well, not much help I can provide as you didn't post the actual button images or any skin code. I'm not going to guess what is going on, I need to see it happen.

The only general advice I can give is to remember that the way button meters work is that they look at size of the bitmap you are using for the button image. If it is "wide", it divides it by 3 horizontally to do the "states". If it is "tall", it divides it by 3 vertically. So you need to design button bitmaps with this in mind.
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: [Bug] Button meter w < h

Post by Scolex »

Here is the code and 3 of the images are attached below

Code: Select all

[DisplayBackground]
Meter=IMAGE
X=0
Y=0
H=21
W=120
SolidColor=255,255,255,1
DynamicVariables=1

[b60]
Meter=Button
X=0
Y=0
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\120.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 3600000"]
DynamicVariables=1

[b30]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\220.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 1800000"]
DynamicVariables=1

[b25]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\320.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 1500000"]
DynamicVariables=1

[b20]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\420.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 1200000"]
DynamicVariables=1

[b15]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\520.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 900000"]
DynamicVariables=1

[b10]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\620.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 600000"]
DynamicVariables=1

[b5]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\720.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 300000"]
DynamicVariables=1

[b1]
Meter=Button
X=R
Y=r
ButtonImage=#SKINSPATH#RiverFront\Resources\Images\Button\930.png
LeftMouseUpAction=!Execute ["#MCxx#" "/MCC 10035, 300000"]
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug] Button meter w < h

Post by jsmorley »

Without even testing, now that I can see the images, it is what I said in my previous post.

From the manual:

ButtonImage
The name of the button image. The image must have 3 frames which can be set either horizontally or vertically (the orientation is determined by the width and height of the image). The first frame corresponds to he button's normal image. The second frame is shown when the button is clicked. The third frame is shown while the mouse is hovering over the button.


If you want to have all buttons with the states "horizontal" in them, they must all be at least one pixel wider than they are tall.
User avatar
Scolex
Posts: 111
Joined: July 31st, 2010, 8:52 am

Re: [Bug] Button meter w < h

Post by Scolex »

Thanks
I was not aware of the 1px wider or taller aspect primarily because if you have a square button it uses a horizontal orientation.
Any chance of adding a setting that determines the orientation instead of it being based on the dimensions.
I don't really see any advantage to being able to set the frames in either orientation. What am I missing?
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug] Button meter w < h

Post by jsmorley »

Scolex wrote:Thanks
I was not aware of the 1px wider or taller aspect primarily because if you have a square button it uses a horizontal orientation.
Any chance of adding a setting that determines the orientation instead of it being based on the dimensions.
It really does work really well now, you just have to use it as intended. I would not be against a setting to "force" the orientation, but not sure what the impact on the math the code does would be. You never know, but I would not expect a change like this soon.