silphius/app/react/components/pixi/extensions.js

33 lines
744 B
JavaScript
Raw Normal View History

2024-07-17 20:43:29 -05:00
import {ExtensionType} from '@pixi/core';
2024-07-19 01:27:47 -05:00
import {Stage as LayerStage} from '@pixi/layers';
2024-07-17 20:43:29 -05:00
2024-07-18 04:18:06 -05:00
import {
AmbientLight,
2024-07-19 01:27:47 -05:00
deferredLighting,
2024-07-18 04:18:06 -05:00
} from './lights.js';
2024-07-17 20:43:29 -05:00
export const ApplicationStageLayers = {
type: ExtensionType.Application,
priority: 100,
ref: {
destroy: function() {},
init: function() {
this.stage = new LayerStage();
},
},
};
export const ApplicationStageLights = {
type: ExtensionType.Application,
ref: {
destroy: function() {},
init: function() {
const {stage} = this;
2024-07-19 01:27:47 -05:00
deferredLighting.addToStage(stage);
// const ambientLight = new AmbientLight(0x2244cc, 0.25);
const ambientLight = new AmbientLight(0xffffff, 1);
stage.addChild(ambientLight);
2024-07-17 20:43:29 -05:00
},
},
};