How to use the @pixi/display.DisplayObject.mixin function in @pixi/display

To help you get started, we’ve selected a few @pixi/display examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pixijs / pixi.js / packages / interaction / src / InteractionManager.js View on Github external
import { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';
import { Point } from '@pixi/math';
import { DisplayObject } from '@pixi/display';
import InteractionData from './InteractionData';
import InteractionEvent from './InteractionEvent';
import InteractionTrackingData from './InteractionTrackingData';
import { EventEmitter } from '@pixi/utils';
import interactiveTarget from './interactiveTarget';

// Mix interactiveTarget into DisplayObject.prototype,
// after deprecation has been handled
DisplayObject.mixin(interactiveTarget);

const MOUSE_POINTER_ID = 1;

// helpers for hitTest() - only used inside hitTest()
const hitTestEvent = {
    target: null,
    data: {
        global: null,
    },
};

/**
 * The interaction manager deals with mouse, touch and pointer events.
 *
 * Any DisplayObject can be interactive if its `interactive` property is set to true.
 *
github pixijs / pixi.js / packages / accessibility / src / AccessibilityManager.js View on Github external
import { accessibleTarget } from './accessibleTarget';
import { removeItems, isMobile } from '@pixi/utils';
import { DisplayObject } from '@pixi/display';

// add some extra variables to the container..
DisplayObject.mixin(accessibleTarget);

const KEY_CODE_TAB = 9;

const DIV_TOUCH_SIZE = 100;
const DIV_TOUCH_POS_X = 0;
const DIV_TOUCH_POS_Y = 0;
const DIV_TOUCH_ZINDEX = 2;

const DIV_HOOK_SIZE = 1;
const DIV_HOOK_POS_X = -1000;
const DIV_HOOK_POS_Y = -1000;
const DIV_HOOK_ZINDEX = 2;

/**
 * The Accessibility manager recreates the ability to tab and have content read by screen readers.
 * This is very important as it can possibly help people with disabilities access PixiJS content.

@pixi/display

Core display functionality

MIT
Latest version published 8 months ago

Package Health Score

88 / 100
Full package analysis