phina.js.d.ts
    Preparing search index...

    Interface Physical

    interface Physical {
        friction: number;
        gravity: phina.geom.Vector2;
        target?: phina.app.Element;
        velocity: phina.geom.Vector2;
        addEventListener(type: string, listener: Function): this;
        addForce(x: number, y: number): this;
        attachTo(element: phina.app.Element): this;
        clear(type: string): this;
        clearEventListener(type: string): this;
        dispatchEvent(e: { type: string }): this;
        dispatchEventByType(type: string, param: object): this;
        fire(e: { type: string }): this;
        flare(type: string, param?: object): this;
        force(x: number, y: number): this;
        getTarget(): void | phina.app.Element;
        has(type: string): boolean;
        hasEventListener(type: string): boolean;
        isAttached(): boolean;
        off(type: string, listener: Function): this;
        on(type: string, listener: Function): this;
        one(type: string, listener: Function): this;
        remove(): void;
        removeEventListener(type: string, listener: Function): this;
        setFriction(fr: number): this;
        setGravity(x: number, y: number): this;
        setTarget(target: phina.app.Element): this;
        update(): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    friction: number
    gravity: phina.geom.Vector2
    target?: phina.app.Element
    velocity: phina.geom.Vector2

    Methods

    • Parameters

      • x: number
      • y: number

      Returns this

    • Parameters

      • type: string
      • Optionalparam: object

      Returns this

    • Parameters

      • x: number
      • y: number

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • fr: number

      Returns this

    • Parameters

      • x: number
      • y: number

      Returns this