AS3 Scale9 Bitmap类

翻译自:
[url=http://www.uza.lt/codex/as3-scale9-bitmap/]http://www.uza.lt/codex/as3-scale9-bitmap/[/url]
简介:
AS3 Scale9 Bitmap是个辅助的类,使用它可以通过bitmap数据填充创建九宫格sprite,而这些在Flash 9中是无法实现的。这个辅助类根据用户定义的缩放矩阵创建了9个虚拟的九宫格sprite。特别适用于创建用户界面(比如按钮,可伸缩的UI元素等等)。
内容:
Scale9SimpleStateButton - 用于创建可伸缩的1、3 或者3种状态使用bitmap数据(皮肤)的按钮的类。
Scale9SimpleBitmapSprite - 用于创建静态的可伸缩的UI元素的使用bitmap数据(皮肤)的sprite的类。
示例代码(Flex Builder 3 项目)
要求:
ActionScript3
Scale9SimpleStateButton(左上角),Scale9SimpleBitmapSprite(右下角)以及初始的皮肤文件(底部)
示例语法:
Actionscript:
      var scale9_example:Rectangle = new Rectangle(6,6,105,20);
      /* Initialize the button with all 3 states (normal, hover, down) using 3 different bitmaps */
      var button_example:Scale9SimpleStateButton = new Scale9SimpleStateButton(
          scale9_example,
          button_skin_normal.bitmapData,
          button_skin_hover.bitmapData,
          button_skin_down.bitmapData
      );
      /*
        * Scale the button using "width" and "scaleY" properties
        * (in general you can use "width", "height", "scaleY", "scaleX" properties for scaling)
        */
      button_example.width = 300;
      button_example.scaleY = 2;
下载:
[url=http://www.uza.lt/download/2]http://www.uza.lt/download/2[/url]
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/4911.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值