as3isolib 会自动深度排序吗?
我构建了一个等轴测平面,该等轴测平面包含 64 个草对象和一个单击时移动的框对象。
每个草对象都附加了一个 MouseEvent.CLICK 处理程序。 我使用 as3isolib 绘制了草和盒子。两者都是 as3isolib 对象。
当用户单击平面上任何位置的任何草对象时,盒子会移动到该位置,但我无法理解是否每次都会为草和盒子对象返回新的索引值?
public function OverOnEachTile(evt:ProxyEvent):void
{
var targetGrassObject:IsoSprite = evt.target as IsoSprite;
scene.getChildIndex(targetGrassObject) // returns different value for same tile or grass object
scene.getChildIndex(isoBox1); // returns different value for same single box instance of type isoBox
}
I have built an isometric plane and isometric plane contains 64 grass object and one box object that move on click.
A MouseEvent.CLICK handler is attached to each grass object.
I have drawn grass and box using as3isolib. Both are as3isolib objects.
When the user clicks at any of the grass object that is anywhere on the plane, the box moves to that position but I can not understand if each time new index value is returned for the grass and box objects ?
public function OverOnEachTile(evt:ProxyEvent):void
{
var targetGrassObject:IsoSprite = evt.target as IsoSprite;
scene.getChildIndex(targetGrassObject) // returns different value for same tile or grass object
scene.getChildIndex(isoBox1); // returns different value for same single box instance of type isoBox
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

是的 Z 排序是自动完成的。
Yes Z-Sorting is done automatically.