じ☆ve冰风 发表于 前天 18:01

Pixel Perfect Collition

Pixel Perfect Collition​
version 1.0.1​
 ​
What is this?

This script is a scripter's tool to allow to check pixel perfect collitions between pixels.

It's actually just a snipper than adds two methods to the Sprite's prototype.

What is Perfect pixel collition?

Is a way to check if two sprites "Touch" each other..

You can see an example here:

Spoiler
http://puu.sh/kVue2/ab5cc19463.png


Do you see? they are not touching each other (even if both rects are touching)


http://puu.sh/kVueC/327adba820.png


If they touch, you'll know.




Downloads:


[*]From My Dropbox.
[*]From My Github.
(Both links the master latest available version)

Bugs and limitations

At the moment it is rather simple, it doesn't check if the sprite's scale has changed or rotated sprites.

Those are features for next versions.

1.0.1 - Now it has to be a little faster, because it calculates less times per check.

Faq

How to use it?

In short terms:

spriteA.collidesWith(spriteB, tolerance=1); // means alpha 1 or bigger triggers touchTerms of Use

As almost all of my plugins, there are released under CC0 or Apache 2.0.

If you are worried about, don't worry you can use them in both commertial and non commertial games.

In this case, under Apache 2.0, it means you have to say 'thanks Ramiro' on a readme or your credits.

You can choose CC0 if Apache 2.0 license isn't available in your country.

Hope you enjoy.


本贴来自国际rpgmaker官方论坛作者:Ramiro处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/pixel-perfect-collition.46723/
页: [1]
查看完整版本: Pixel Perfect Collition