import * as Attributes from "../core/Attributes" ; import { Layout } from "./Layout" ; import { UIFillUtils } from "./UIFillUtils" ; import { VertexBuffer } from "../graphics/VertexBuffer" ; import { Component } from "../core/Component" ; import { Entity } from "../core/Entity" ; import { Transform } from "../core/Transform" ; export enum UIOverflow { Clip , Scroll } export class UIElement extends Component { get isTouchInside ( ) { return this . _touchInside ; } get isTouchPressed ( ) { return this . _touchPressed ; } @ Attributes . unserializable ( ) private _touchInside = false ; @ Attributes . unserializable ( ) private _touchPressed = false ; setEntity ( entity ) { super . setEntity ( entity ) ; entity . clearComponent ( Transform ) ; entity . getOrSetComponent ( Layout ) ; } getVertexBuffer ( ) { return UIFillUtils . getVertexBuffer ( this . entity . getComponent ( Layout ) as Layout ) ; } setTouchInside ( inside ) { this . _touchInside = inside ; } setTouchPressed ( pressed ) { this . _touchPressed = pressed ; } }