MCPcopy Create free account
hub / github.com/eva-engine/eva.js / constructor

Method constructor

packages/plugin-worker/lib/events/EventSystem.ts:219–254  ·  view source on GitHub ↗

* @param {Renderer} renderer

(renderer: Renderer)

Source from the content-addressed store, hash-verified

217 * @param {Renderer} renderer
218 */
219 constructor(renderer: Renderer) {
220 this.renderer = renderer;
221 this.rootBoundary = new EventBoundary(null);
222 EventsTicker.init(this);
223
224 this.autoPreventDefault = true;
225 this._eventsAdded = false;
226
227 this._rootPointerEvent = new FederatedPointerEvent(null);
228 this._rootWheelEvent = new FederatedWheelEvent(null);
229
230 this.cursorStyles = {
231 default: 'inherit',
232 pointer: 'pointer',
233 };
234
235 this.features = new Proxy(
236 { ...EventSystem.defaultEventFeatures },
237 {
238 set: (target, key, value) => {
239 if (key === 'globalMove') {
240 this.rootBoundary.enableGlobalMoveEvents = value;
241 }
242 target[key as keyof EventSystemFeatures] = value;
243
244 return true;
245 },
246 },
247 );
248
249 this._onPointerDown = this._onPointerDown.bind(this);
250 this._onPointerMove = this._onPointerMove.bind(this);
251 this._onPointerUp = this._onPointerUp.bind(this);
252 this._onPointerOverOut = this._onPointerOverOut.bind(this);
253 this.onWheel = this.onWheel.bind(this);
254 }
255
256 /**
257 * Runner init called, view is available at this point.

Callers

nothing calls this directly

Calls 1

initMethod · 0.45

Tested by

no test coverage detected