UNPKG

arx-level-generator

Version:
32 lines 1 kB
import { ArxPolygonFlags } from 'arx-convert/types'; import { Texture } from './Texture.js'; export class Material extends Texture { flags; opacity; opacityMode; constructor({ flags = ArxPolygonFlags.None, opacity = 100, opacityMode = 'additive', ...props }) { super(props); this.flags = flags; this.opacity = opacity; this.opacityMode = opacityMode; } clone() { const copy = super.clone(); copy.flags = this.flags; copy.opacity = this.opacity; copy.opacityMode = this.opacityMode; return copy; } static fromTexture(texture, props = {}) { return new Material({ filename: texture.filename, isNative: texture.isNative, width: texture._width, height: texture._height, sourcePath: texture.sourcePath, isInternalAsset: texture.isInternalAsset, ...props, }); } } //# sourceMappingURL=Material.js.map