在AS3雪碧的最大尺寸是多少? [英] maximum size of a sprite in as3?
本文介绍了在AS3雪碧的最大尺寸是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个上限,以在AS3精灵的尺寸/闪存10?
Is there an upper bound to the size of a sprite in as3 / flash 10?
我知道位图数据有其局限性 ...
推荐答案
看来,这xScale等和yScale不得超过为0x8000 ...
it seems, that xScale and yScale may not exceed 0x8000 ...
尺寸本身也似乎被绑定...我发现了一个极限0x6666660 ...
size itself also seems to be bound ... i found a limit 0x6666660 ...
这里的code:
package {
import flash.display.*;
public class Main extends Sprite {
public function Main():void {
var size:Number = 1;
var s:Shape = new Shape();
s.graphics.beginFill(0xFF00FF);
s.graphics.drawRect(0, 0, size, size);
var old:Number = 0;
while (s.width > old) {
old = s.scaleX;
s.scaleX *= 1.1;
}
trace(s.width.toString(16));
size = 1;
s.scaleX = 1;
while (true) {
size *= 2;
s.graphics.clear();
s.graphics.drawRect(0, 0, size, size);
if (s.width < 0) break;
}
var min:Number = size / 2;
var max:Number = size;
while (true) {
size = (min + max) / 2;
s.graphics.clear();
s.graphics.drawRect(0, 0, size, size);
if (s.width < 0) max = size;
else
if (max - min < 1) break;
else min = size;
}
trace(s.width.toString(16));
}
}
}
没有找到关于它的任何文件...所以你甚至可以让你的计算机上的其他结果...
didn't find any documentation about it ... so you may even get other results on your machine ...
这篇关于在AS3雪碧的最大尺寸是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文