refactor: PIXI shims

This commit is contained in:
cha0s 2019-11-22 02:19:44 -06:00
parent 631106b29c
commit bf0b5a5f2f
8 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,40 @@
export const BLEND_MODES = {
NORMAL: 0,
ADD: 1,
MULTIPLY: 2,
SCREEN: 3,
OVERLAY: 4,
DARKEN: 5,
LIGHTEN: 6,
COLOR_DODGE: 7,
COLOR_BURN: 8,
HARD_LIGHT: 9,
SOFT_LIGHT: 10,
DIFFERENCE: 11,
EXCLUSION: 12,
HUE: 13,
SATURATION: 14,
COLOR: 15,
LUMINOSITY: 16,
NORMAL_NPM: 17,
ADD_NPM: 18,
SCREEN_NPM: 19,
NONE: 20,
SRC_OVER: 0,
SRC_IN: 21,
SRC_OUT: 22,
SRC_ATOP: 23,
DST_OVER: 24,
DST_IN: 25,
DST_OUT: 26,
DST_ATOP: 27,
ERASE: 26,
SUBTRACT: 28,
XOR: 29,
};
export const SCALE_MODES = {
NEAREST: 0,
LINEAR: 1,
};

View File

@ -0,0 +1,13 @@
export class BaseRenderer {}
export class BaseTexture {}
export class BatchRenderer {}
export class Filter {}
export class Renderer {
static registerPlugin() {}
}
export class RenderTexture {}
export class Texture {}
export const defaultFilterVertex = '';

View File

@ -0,0 +1 @@
export class Container {}

View File

View File

@ -0,0 +1,20 @@
const path = require('path');
module.exports = ({options, side}) => {
if ('server' === side) {
const pixiPackages = [
'constants',
'core',
'display',
'graphics',
'settings',
'text',
];
pixiPackages.forEach((pixiPackage) => {
options.resolve.alias[`@pixi/${pixiPackage}`] = path.join(
__dirname,
pixiPackage,
);
});
}
};

View File

@ -0,0 +1,4 @@
import {settings} from './settings';
export {settings};
export const isMobile = settings.isMobile;

View File

@ -0,0 +1,6 @@
export const settings = {
isMobile: {
android: {},
apple: {},
},
};

View File