So I have 8 images that I use in my web player as backgrounds for difrent button states. I also have something alike CSS file with sca开发者_Go百科leGrid declarations for correct resize:
/* CSS file */
mx|Button
{
disabledSkin: Embed(source="assets/Button_disabledSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
downSkin: Embed(source="assets/Button_downSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
overSkin: Embed(source="assets/Button_overSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
upSkin: Embed(source="assets/Button_upSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
selectedDisabledSkin: Embed(source="assets/Button_selectedDisabledSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
selectedDownSkin: Embed(source="assets/Button_selectedDownSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
selectedOverSkin: Embed(source="assets/Button_selectedUpSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
selectedUpSkin: Embed(source="assets/Button_selectedUpSkin.png",
scaleGridTop="5",
scaleGridLeft="5",
scaleGridRight="59",
scaleGridBottom="17");
}
How to make a resizable (correctly) button in SDL that would use my assets and have at least 4 states?
精彩评论