SDL:我有 8 个图像和一些 css 规则,如何创建按钮?

发布于 2024-11-15 17:35:35 字数 2161 浏览 2 评论 0原文

因此,我有 8 张图片,我在网络播放器中将它们用作背景对于不同的按钮状态。 我还有一些类似的 CSS 文件,其中包含用于正确调整大小的scaleGrid 声明:

    /* 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 ressized (rightly) Button in SDL that will use my asset and has at at at at at the right of 4 states?

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 scaleGrid 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文