- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
/**
* Generalized convenience utilities for PIXI.
* @example
* // Extend PIXI's internal Event Emitter.
* class MyEmitter extends PIXI.utils.EventEmitter {
* constructor() {
* super();
* console.log("Emitter created!");
* }
* }
*
* // Get info on current device
* console.log(PIXI.utils.isMobile);
*
* // Convert hex color to string
* console.log(PIXI.utils.hex2string(0xff00ff)); // returns: "#ff00ff"
* @namespace PIXI.utils
*/
/**
* A simple JS library that detects mobile devices.
* @see https://github.com/kaimallea/isMobile
* @memberof PIXI.utils
* @name isMobile
* @member {object}
* @property {boolean} any - `true` if current platform is tablet or phone device
* @property {boolean} tablet - `true` if current platform large-screen tablet device
* @property {boolean} phone - `true` if current platform small-screen phone device
* @property {object} apple -
* @property {boolean} apple.device - `true` if any Apple device
* @property {boolean} apple.tablet - `true` if any Apple iPad
* @property {boolean} apple.phone - `true` if any Apple iPhone
* @property {boolean} apple.ipod - `true` if any iPod
* @property {object} android -
* @property {boolean} android.device - `true` if any Android device
* @property {boolean} android.tablet - `true` if any Android tablet
* @property {boolean} android.phone - `true` if any Android phone
* @property {object} amazon -
* @property {boolean} amazon.device - `true` if any Silk device
* @property {boolean} amazon.tablet - `true` if any Silk tablet
* @property {boolean} amazon.phone - `true` if any Silk phone
* @property {object} windows -
* @property {boolean} windows.device - `true` if any Windows device
* @property {boolean} windows.tablet - `true` if any Windows tablet
* @property {boolean} windows.phone - `true` if any Windows phone
*/
export { isMobile } from '@pixi/settings';
import EventEmitter from 'eventemitter3';
/**
* A high performance event emitter
* @see https://github.com/primus/eventemitter3
* @memberof PIXI.utils
* @class EventEmitter
*/
export { EventEmitter };
/**
* A polygon triangulation library
* @see https://github.com/mapbox/earcut
* @memberof PIXI.utils
* @method earcut
* @param {number[]} vertices - A flat array of vertex coordinates
* @param {number[]} [holes] - An array of hole indices
* @param {number} [dimensions=2] - The number of coordinates per vertex in the input array
* @returns {number[]} Triangulated polygon
*/
export { default as earcut } from 'earcut';
/**
* Node.js compatible URL utilities.
* @see https://www.npmjs.com/package/url
* @memberof PIXI.utils
* @name url
* @member {object}
*/
export * from './url';
/**
* Browser and Node.js compatible path utilities.
* All paths that are passed in will become normalized to have posix separators.
* @memberof PIXI.utils
* @name path
* @member {object}
*/
export * from './path';
import './settings';
export * from './browser/hello';
export * from './browser/isWebGLSupported';
export * from './color/hex';
export * from './color/premultiply';
export * from './data/createIndicesForQuads';
export * from './data/getBufferType';
export * from './data/interleaveTypedArrays';
export * from './data/pow2';
export * from './data/removeItems';
export * from './data/sign';
export * from './data/uid';
export * from './logging/deprecation';
export * from './media/caches';
export * from './media/CanvasRenderTarget';
export * from './media/trimCanvas';
export * from './network/decomposeDataUri';
export * from './network/determineCrossOrigin';
export * from './network/getResolutionOfUrl';
export * from './const';
export * from './types';