W+K东京新的网站

生活+工作 No Comments »

W+K TOKYO
W+K TOKYO BLOG

noidea!@#$%^&*

生活+工作 No Comments »

KitchenSync

生活+工作 No Comments »


KitchenSync is an ActionScript 3.0 library for sequencing animations and other time-based actions.
demo
project site

bitmap.hittest

设计+开发 No Comments »

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

单纯的hittest已经不能满足精确的碰撞检测,还好flash 8里有了bitmapdata,而其中有个hittest的方法。就是用来检测复杂不规则图形的collision.
BitmapData.hitTest(firstPoint:Point, firstAlphaThreshold:uint,secondObject:Object, secondBitmapDataPoint:Point = null, secondAlphaThreshold:uint = 1):Boolean
其中firstpoint是BitmapData的左上角的x,y坐标,endpoint为碰撞物的坐标,firstAlphaThreshold和secondAlphaThreshold是对于透明区域的值,越高的话应该越精确。上面那个例子已开始没用用到bitmap的检测,我改了一下代码,就出现了那样的效果。


Entries RSS
Copy all rights reserved by lotloft