首页 > 其他 > 详细

Flash自适应舞台和对齐处理

时间:2014-07-09 08:51:59      阅读:609      评论:0      收藏:0      [点我收藏+]

普通应用:

import flash.display.StageAlign;

import flash.display.StageScaleMode;

stage.align=StageAlign.TOP_LEFT;

stage.scaleMode="noScale";

stage.addEventListener(Event.RESIZE,resizeHandler);

function resizeHandler(event:Event) {

bj.width=stage.stageWidth;

bj.height=stage.stageHeight;

}

GS应用:

import flash.display.StageAlign;

import flash.display.StageScaleMode;

import com.greensock.layout.*;

//无缩放+左上对齐

stage.scaleMode=StageScaleMode.NO_SCALE;

stage.align=StageAlign.TOP_LEFT;

//舞台元素自适应

var area:AutoFitArea=new AutoFitArea(this,0,0,stage.stageWidth,stage.stageHeight,0xff0000);

area.attach(pp1,ScaleMode.PROPORTIONAL_OUTSIDE, AlignMode.CENTER, AlignMode.CENTER);

area.preview=true;

//舞台元素对齐处理

var ls:LiquidStage=new LiquidStage(this.stage,800,555,800,555);

ls.attach(pp2, ls.RIGHT_CENTER);

ls.attach(pp3, ls.LEFT_CENTER);

Flash自适应舞台和对齐处理,布布扣,bubuko.com

Flash自适应舞台和对齐处理

原文:http://1213785174.blog.51cto.com/7211787/1435736

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!