Let hammer perfectly support pixi.js-2d WEBG Library

Source: Internet
Author: User

Because of the project transformation, the use of the 2D WEBG Pixi Library, then based on the structure of the canvas, the event is the biggest problem

The principle of transformation is very simple, the hammer inside the Addeventlisteners event bound to a third-party library instead, the binding of the event is controlled by a third party

Hammer is responsible for receiving event messages.

Pass a Pixi reference, which is a reference to the Sprite object inside each canvas, because each object is bound to an event

Hammer internal:

Hammer Addeventlisteners event bindings are replaced by third-party bindings

Replace

Note that one of the problems is:

The EV given by Hammer is a packaged object, so it takes Ev.originalevent, the event object

The last modification of the Touchaction class, canvas is not, so when it comes to calling touchaction, you need to judge the cancellation

At this point, the hammer Library is perfectly supported by the pixi.js-2d Webg/canvas Library ....

Let hammer perfectly support pixi.js-2d WEBG Library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.