UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

21 lines (20 loc) 550 B
"use strict"; import { BaseMethod } from "./_Base"; import { Vector2 } from "three"; export class WindowSizeExpression extends BaseMethod { constructor() { super(...arguments); this._windowSize = new Vector2(); } static requiredArguments() { return [[]]; } findDependency(indexOrPath) { this.param.addGraphInput(this.param.scene().windowController.graphNode()); return null; } async processArguments(args) { this._windowSize.set(globalThis.innerWidth, globalThis.innerHeight); return this._windowSize; } }