Comments (6)
In the new interaction model, containers are not returned for getObjectUnderPoint, however you can use "contains" to check if the item returned is within the container. You should also be able to use Container.hitTest to check if a container is under a point, however this is currently broken - I will fix this in an update very soon.
This report also led me to find a major issue with triggering onPress/Click handlers on containers, which is now resolved.
Given the above, would you still want to be able to get containers returned in getObjectUnderPoint? If so, what would you expect the property to be named for making a container return instead it's children? "mouseChildren" was misleading, because it didn't really involve the mouse. "treatContainerAsGroupForObjectsUnderPoint" is a little verbose.
from easeljs.
Well, as I told on this tweet, I am moving away from getObjectUnderPoint. I need actual collision detection algorithms, so alpha checking no longer solves my point, When this is done, I'll try again coming back to 0.3.
But thanks for the reply.
from easeljs.
To address the original point, I just pushed an update that fixes hitTest and mouse event callbacks for containers.
For collision detection, are you looking for SAT collisions? I think it would be pretty straightforward to implement this as a layer on top of EaselJS, but is unlikely to be part of the core library. I'd like to keep the core of EaselJS focused on being a strong display management library, which people can easily extend for more specific purposes.
Here's a starting point, from the developer of crafty.js: http://craftyjs.tumblr.com/post/3096403769/sat-collision-made-easy-part-1
from easeljs.
I wish to implement SAT. However, I'll keep it simple for now. The naive approach is easy enough to implement and test (was already implemented), and will suffice. If things get too slow, quadtrees shall probably be enough.
I don't want to get too caught up to this, as I may have to switch to Box2DJS, which use SAT.
But I agree with your approach. Collision detection on the core library can be too much too soon.
I am just glad I'll not have to implement general Computational Geometry techniques (in particular these ones) for collision detection.
Thanks for the links.
from easeljs.
Closing.
from easeljs.
Ok, the issue is fixxed. The dicussion that lingered (was a good one btw).
from easeljs.
Related Issues (20)
- Graphics new method 'drawPolygon' HOT 7
- sortChildren on Chrome not working - works in Firefox HOT 1
- Easel JS not working on codepen HOT 1
- Android text lineheight doesn't match Web or Windows HOT 2
- Memory leak when tween assigned HOT 1
- getBounds returns unexpected result after caching with a non-1 scale HOT 2
- can not cache with StageGL instance get "TypeError: Cannot create property 'width' on boolean" HOT 2
- Shadow "Stroke" appears on top of shape when using fill and strokestyle. HOT 4
- New touch issues on touch-screen boards with new Chrome HOT 4
- CreateJS touch 'pressmove' event
- Is it possible to make webgl mask work in animation? HOT 1
- Bitmap class - new createjs.Bitmap - SVG not loading at viewbox size HOT 1
- Text is still compressed when maxWidth is null HOT 1
- Mousemovement Performance improvement HOT 2
- Different Luminence values for Saturation vs Hue HOT 3
- Hit area detection on Samsung Internet Browser HOT 1
- When will you update createjs2.0? The current version of movieclip is incorrect, and stageGL cannot be used. HOT 4
- Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true HOT 6
- The Typescript Typings in DefinitelyTyped are missing Graphics.StrokeDash HOT 4
- Createjs website dose not work ! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easeljs.