- Moderator
- #1
Currently the width and height of the arrows used in the selectbuttoncontrol is hardcoded to 16 x 16 pixels:
To allow skinners using arrows/textures that are bigger (and thereby improve the 10-foot GUI) I have introduced width and height properties for the four textures used:
The values are set like this in XML:
These are then used to set the correct width/height for the arrows:
Now, for the last 3 months I have tried, and tried, and tried to understand how to use GIT to make my own branch. And not succeeded. Yes, the old SVN-patching could be horrible, but at least it didn't take a major in math-astro-science to submit a small 2 kb patch file. My gut-feeling tells me that the number of new MP-contributers (patch-wise) is lower than ever. I blame GIT
So, I have attached an entire copy of the code for the control. This hasn't changed much in some time anyway (last change was AFAIK the shadow on text).
Code:
int x1 = 16;
int y1 = 16;
GUIGraphicsContext.ScalePosToScreenResolution(ref x1, ref y1);
To allow skinners using arrows/textures that are bigger (and thereby improve the 10-foot GUI) I have introduced width and height properties for the four textures used:
Code:
[XMLSkinElement("textureLeftHeight")] private int _leftTextureHeight = 16;
[XMLSkinElement("textureLeftWidth")] private int _leftTextureWidth = 16;
[XMLSkinElement("textureRight")] protected string _rightTextureName = "";
[XMLSkinElement("textureRightHeight")] private int _rightTextureHeight = 16;
[XMLSkinElement("textureRightWidth")] private int _rightTextureWidth = 16;
[XMLSkinElement("textureLeftFocus")] protected string _leftFocusName = "";
[XMLSkinElement("textureLeftFocusHeight")] private int _leftTextureFocusHeight = 16;
[XMLSkinElement("textureLeftFocusWidth")] private int _leftTextureFocusWidth = 16;
[XMLSkinElement("textureRightFocus")] protected string _rightFocusName = "";
[XMLSkinElement("textureRightFocusHeight")] private int _rightTextureFocusHeight = 16;
[XMLSkinElement("textureRightFocusWidth")] private int _rightTextureFocusWidth = 16;
The values are set like this in XML:
Code:
<textureLeftHeight>21</textureLeftHeight>
<textureLeftWidth>21</textureLeftWidth>
<textureLeftFocus>arrow_round_left_focus.png</textureLeftFocus>
<textureLeftFocusHeight>21</textureLeftFocusHeight>
<textureLeftFocusWidth>21</textureLeftFocusWidth>
<textureRight>arrow_round_right_nofocus.png</textureRight>
<textureRightHeight>21</textureRightHeight>
<textureRightWidth>21</textureRightWidth>
<textureRightFocus>arrow_round_right_focus.png</textureRightFocus>
<textureRightFocusHeight>21</textureRightFocusHeight>
<textureRightFocusWidth>21</textureRightFocusWidth>
These are then used to set the correct width/height for the arrows:
Code:
_imageLeft = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _leftTextureWidth, _leftTextureHeight, _leftTextureName);
_imageLeft.DimColor = DimColor;
_imageLeft.ParentControl = this;
_imageLeftFocus = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _leftTextureFocusWidth, _leftTextureFocusHeight,
_leftFocusName);
_imageLeftFocus.ParentControl = this;
_imageLeftFocus.DimColor = DimColor;
_imageRight = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _rightTextureWidth, _rightTextureHeight, _rightTextureName);
_imageRight.ParentControl = this;
_imageRight.DimColor = DimColor;
_imageRightFocus = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _rightTextureFocusWidth, _rightTextureFocusHeight,
_rightFocusName);
_imageRightFocus.ParentControl = this;
_imageRightFocus.DimColor = DimColor;
Now, for the last 3 months I have tried, and tried, and tried to understand how to use GIT to make my own branch. And not succeeded. Yes, the old SVN-patching could be horrible, but at least it didn't take a major in math-astro-science to submit a small 2 kb patch file. My gut-feeling tells me that the number of new MP-contributers (patch-wise) is lower than ever. I blame GIT
So, I have attached an entire copy of the code for the control. This hasn't changed much in some time anyway (last change was AFAIK the shadow on text).
Attachments
Last edited: