Git Product home page Git Product logo

Comments (2)

danzen avatar danzen commented on July 23, 2024

Hi @Matt-Maerz - you may want to check out the various hitTests in ZIM, a framework built on CreateJS. We do several types of hitTests that are not pixel based and even the pixel based ones we do a calculated bounds check first. May as well see if the bounds are hitting with an equation before testing pixels. This dramatically increases the efficiency of hitTests. ZIM is at https://zimjs.com and the tips page https://zimjs.com/tips.html#HITTEST. You can see the types of hitTests in the docs https://zimjs.com/docs.html under the methods section.
image

hitTestPoint() is the same as the CreateJS hitTest.
hitTestReg() same as above but tests against the registration point
hitTestBounds() is a fast calculation between bounds of objects
hitTestCircleRect() is a fast calculation between a circle and a rectangle
hitTestGrid() is a fast calculation for grid sections
hitTestRect() and hitTestCircle() test any shape against points around a rectangle or circle (slower as shape based)
etc.

from easeljs.

danzen avatar danzen commented on July 23, 2024

Oh!!! Sorry, @Matt-Maerz - I just re-read the issue and it seems like you may have been talking about just rollovers in CreateJS using pixel based detection. Okay. I will leave the last response there in case you are wanting to do your own hitTests. We have been fine with mouseover speed in general and keep it turned on by default in ZIM. We then use mouseChildren and mouseEnabled false when objects do not need to be interacted with. We have simplified this with a mouse() and noMouse() methods available on all our DisplayObjects.

from easeljs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.