开发者

SDL: I have 8 images, and some css rules, how to create a button?

开发者 https://www.devze.com 2023-03-13 18:41 出处:网络
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:

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号