Options
All
  • Public
  • Public/Protected
  • All
Menu

RuntimeObject represents an object being used on a RuntimeScene.

A gdjs.RuntimeObject should not be instantiated directly, always a child class (because gdjs.RuntimeObject don't call onCreated at the end of its constructor).

Hierarchy

Implements

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void
  • De/activate a behavior of the object.

    Parameters

    • name: string

      The behavior name.

    • enable: boolean

      true to activate the behavior

    Returns void

  • addEffect(effectData: EffectData): boolean
  • Add a new effect, or replace the one with the same name.

    Parameters

    • effectData: EffectData

      The data describing the effect to add.

    Returns boolean

  • addForce(x: number, y: number, multiplier: number): void
  • Add a force to the object to move it.

    Parameters

    • x: number

      The x coordinates of the force

    • y: number

      The y coordinates of the force

    • multiplier: number

      Set the force multiplier

    Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
  • Add a force oriented toward another object.
    (Shortcut for addForceTowardPosition)

    Parameters

    • object: null | RuntimeObject

      The target object

    • len: number

      The force length, in pixels.

    • multiplier: number

      Set the force multiplier

    Returns void

  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
  • Add a force oriented toward a position

    Parameters

    • x: number

      The target x position

    • y: number

      The target y position

    • len: number

      The force length, in pixels.

    • multiplier: number

      Set the force multiplier

    Returns void

  • addNewBehavior(behaviorData: BehaviorData): boolean
  • Create the behavior described by the given BehaviorData

    Parameters

    • behaviorData: BehaviorData

      The data to be used to construct the behavior.

    Returns boolean

    true if the behavior was properly created, false otherwise.

  • addPolarForce(angle: number, len: number, multiplier: number): void
  • Add a force using polar coordinates.

    Parameters

    • angle: number

      The angle of the force, in degrees.

    • len: number

      The length of the force, in pixels.

    • multiplier: number

      Set the force multiplier

    Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean
  • Return true if the average angle of the forces applied on the object is in a given range.

    deprecated

    Use isTotalForceAngleAround instead.

    Parameters

    • angle: number

      The angle to be tested.

    • toleranceInDegrees: number

      The length of the range :

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

  • behaviorActivated(name: string): boolean
  • Check if a behavior is activated

    Parameters

    • name: string

      The behavior name.

    Returns boolean

    true if the behavior is activated.

  • clearEffects(): boolean
  • clearForces(): void
  • Return true if the hitboxes of two objects are overlapping

    static

    Parameters

    • obj1: RuntimeObject

      The first runtimeObject

    • obj2: RuntimeObject

      The second runtimeObject

    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    • ignoredObject1Polygon: null | Polygon = null

      A polygon from the obj1 collision mask to ignore

    Returns boolean

    true if obj1 and obj2 are in collision

  • enableEffect(name: string, enable: boolean): void
  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
  • Called when the object is created from an initial instance at the startup of the scene.
    Note that common properties (position, angle, z order...) have already been setup.

    Parameters

    • initialInstanceData: InstanceData

      The data of the initial instance.

    Returns void

  • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
  • Get the AABB (axis aligned bounding box) for the object.

    The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

    You should probably redefine updateAABB instead of this function.

    Returns AABB

    The bounding box

  • getAABBBottom(): number
  • getAABBCenterX(): number
  • getAABBCenterY(): number
  • getAABBLeft(): number
  • getAABBRight(): number
  • getAABBTop(): number
  • getAngle(): number
  • getAngleToPosition(targetX: number, targetY: number): number
  • Get the angle, in degrees, from the object center to a position.

    Parameters

    • targetX: number

      Target X position

    • targetY: number

      Target Y position

    Returns number

  • Get a behavior from its name. If the behavior does not exists, undefined is returned.

    Never keep a reference to a behavior, as they can be hot-reloaded. Instead, always call getBehavior on the object.

    Parameters

    • name: string

      The behavior name.

    Returns null | RuntimeBehavior

    The behavior with the given name, or undefined.

  • getCenterX(): number
  • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

    Returns number

    the X position of the object center, relative to getDrawableX().

  • getCenterXInScene(): number
  • Return the X position of the object center, relative to the scene origin.

    Returns number

    the X position of the object center, relative to the scene origin.

  • getCenterY(): number
  • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

    Returns number

    the Y position of the object center, relative to getDrawableY().

  • getCenterYInScene(): number
  • Return the Y position of the object center, relative to the scene origin.

    Returns number

    the Y position of the object center, relative to the scene origin.

  • getDistanceToPosition(targetX: number, targetY: number): number
  • Get the distance, in pixels, between the center of this object and a position.

    Parameters

    • targetX: number

      Target X position

    • targetY: number

      Target Y position

    Returns number

  • getDrawableX(): number
  • Get the X position of the rendered object.

    For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

    Returns number

    The X position of the rendered object.

  • getDrawableY(): number
  • Get the Y position of the rendered object.

    For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

    Returns number

    The Y position of the rendered object.

  • getHeight(): number
  • Get all the hit boxes for the object.

    For collision checks, getHitBoxesAround should be used instead.

    The default implementation returns a basic bounding box based the size (getWidth and getHeight) and the center point of the object (getCenterX and getCenterY).

    You should probably redefine updateHitBoxes instead of this function.

    Returns Polygon[]

    An array composed of polygon.

  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • Return at least all the hit boxes that overlap a given area.

    The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) but the ones that do must be returned.

    The default implementation returns the same as getHitBoxes.

    This method can be overridden by grid based objects (or other objects that can quickly compute which hitboxes are touching a given area) to optimize collision checks.

    When overriding this method, the following ones should be overridden too:

    Parameters

    • left: number

      bound of the area in scene coordinates

    • top: number

      bound of the area in scene coordinates

    • right: number

      bound of the area in scene coordinates

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

  • getLayer(): string
  • getName(): string
  • getNameId(): number
  • getNameIdentifier(name: string): number
  • Get the identifier associated to an object name. Some features may want to compare objects name a large number of time. In this case, it may be more efficient to compare objects name identifiers.

    static

    Parameters

    • name: string

    Returns number

  • getNetworkSyncData(): ObjectNetworkSyncData
  • Called when trying to send all information about the state of an object to other peers. This can be redefined by objects to send more information.

    Returns ObjectNetworkSyncData

    The full network sync data.

  • getRendererEffects(): Record<string, Filter>
  • getSqDistanceToPosition(targetX: number, targetY: number): number
  • Get the squared distance, in pixels, between the center of this object and a position.

    Parameters

    • targetX: number

      Target X position

    • targetY: number

      Target Y position

    Returns number

  • getTimerElapsedTimeInSeconds(timerName: string): number
  • Get a timer elapsed time.

    This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

    Parameters

    • timerName: string

      The timer name.

    Returns number

    The timer elapsed time in seconds, 0 if the timer doesn't exist.

  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • Get a timer elapsed time.

    This is used by conditions to return false when a timer doesn't exist, no matter the relational operator.

    Parameters

    • timerName: string

      The timer name.

    Returns number

    The timer elapsed time in seconds, NaN if the timer doesn't exist.

  • getUniqueId(): number
  • Get the unique identifier of the object.
    The identifier is set by the runtimeScene owning the object.
    You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

    Returns number

    The object identifier

  • getVariableChildCount(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

    static

    Parameters

    • variable: Variable

      The variable to be accessed

    Returns number

    The value of the specified variable

  • getVariableString(variable: Variable): string
  • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

    static

    Parameters

    • variable: Variable

      The variable to be accessed

    Returns string

    The string of the specified variable

  • getVisibilityAABB(): null | AABB
  • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

    The default implementation uses the AABB returned by getAABB.

    If null is returned, the object is assumed to be always visible.

    Returns null | AABB

    The bounding box or null.

  • getWidth(): number
  • getX(): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • Compute the X position when given an angle and distance relative to the starting object. This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

    Returns number

  • getY(): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • Compute the Y position when given an angle and distance relative to the starting object. This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

    Returns number

  • getZOrder(): number
  • hasBehavior(name: string): boolean
  • hasEffect(name: string): boolean
  • Check if an effect exists on this object

    Parameters

    • name: string

      The name of the effect

    Returns boolean

    true if the effect exists, false otherwise.

  • hasNoForces(): boolean
  • hasVariable(name: string): boolean
  • Shortcut to test if a variable exists for the object.

    Parameters

    • name: string

      The variable to be tested

    Returns boolean

    true if the variable exists.

  • hide(enable: boolean): void
  • insideObject(x: number, y: number): boolean
  • Return true if the specified position is inside object bounding box.

    The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

    Parameters

    • x: number
    • y: number

    Returns boolean

  • invalidateHitboxes(): void
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • Check if a point is inside the object collision hitboxes.

    Parameters

    • pointX: number

      The point x coordinate.

    • pointY: number

      The point y coordinate.

    Returns boolean

    true if the point is inside the object collision hitboxes.

  • isEffectEnabled(name: string): boolean
  • isHidden(): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • Return true if the object is on the specified layer

    Parameters

    • layer: string

      The layer to be tested.

    Returns boolean

    true if the object is on the specified layer

  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • Return true if the angle of the total force applied on the object is in a given range.

    Parameters

    • angle: number

      The angle to be tested.

    • toleranceInDegrees: number

      The maximum distance from the given angle.

    Returns boolean

    true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

  • isVisible(): boolean
  • Return true if the object is not hidden.

    Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

    Returns boolean

    true if the object is not hidden.

  • notifyBehaviorsObjectHotReloaded(): void
  • Called when the object was hot reloaded, to notify behaviors that the object was modified. Useful for behaviors that

    Returns void

  • onCreated(): void
  • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

    If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

    Returns void

  • Called when the object is destroyed (because it is removed from a scene or the scene is being unloaded). If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onDestroyFromScene.call(this, runtimeScene);).

    Parameters

    Returns void

  • onDestroyed(): void
  • Called whenever the scene owning the object is paused. This should not impact objects, but some may need to inform their renderer.

    Parameters

    Returns void

  • Called whenever the scene owning the object is resumed after a pause. This should not impact objects, but some may need to inform their renderer.

    Parameters

    Returns void

  • pauseTimer(timerName: string): void
  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
  • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

    Parameters

    • x: number

      The x position of the target

    • y: number

      The y position of the target

    • distance: number

      The distance between the object and the target, in pixels.

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

    Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
  • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

    Parameters

    • obj: null | RuntimeObject

      The target object

    • distance: number

      The distance between the object and the target

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

    Returns void

  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • Parameters

    • x: number

      The raycast source X

    • y: number

      The raycast source Y

    • endX: number

      The raycast end position X

    • endY: number

      The raycast end position Y

    • closest: boolean

      Get the closest or farthest collision mask result?

    Returns RaycastTestResult

    A raycast result with the contact points and distances

  • registerDestroyCallback(callback: () => void): void
  • reinitialize(objectData: ObjectData): void
  • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, reinitialize will be called. The object must then work as if it was a newly constructed object.

    To implement this in your object:

    • Set gdjs.YourRuntimeObject.supportsReinitialization = true; to declare support for recycling.
    • Implement reinitialize. It must call the reinitialize of gdjs.RuntimeObject, and call this.onCreated(); at the end of reinitialize.
    • It must reset the object as if it was newly constructed (be careful about your renderers and any global state).
    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.

    Parameters

    • objectData: ObjectData

    Returns void

  • removeBehavior(name: string): boolean
  • Remove the behavior with the given name. Usually only used by hot-reloading, as performance of this operation is not guaranteed (in the future, this could lead to re-organization of arrays holding behaviors).

    Parameters

    • name: string

      The name of the behavior to remove.

    Returns boolean

    true if the behavior was properly removed, false otherwise.

  • removeEffect(effectName: string): boolean
  • removeTimer(timerName: string): void
  • resetTimer(timerName: string): void
  • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
  • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean
  • Separate the object from others objects, using their hitboxes.

    Parameters

    • objects: RuntimeObject[]

      Objects

    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if the object was moved

  • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
  • Separate the object from others objects, using their hitboxes.

    Parameters

    • objectsLists: ObjectsLists

      Tables of objects

    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if the object was moved

  • separateObjectsWithForces(objectsLists: ObjectsLists): void
  • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
  • setAngle(angle: number): void
  • setCenterPositionInScene(x: number, y: number): void
  • Change the object center position in the scene.

    Parameters

    • x: number

      The new X position of the center in the scene.

    • y: number

      The new Y position of the center in the scene.

    Returns void

  • setCenterXInScene(x: number): void
  • Change the object center X position in the scene.

    Parameters

    • x: number

      The new X position of the center in the scene.

    Returns void

  • setCenterYInScene(y: number): void
  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
  • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
  • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
  • setHeight(height: number): void
  • setIncludedInParentCollisionMask(isIncluded: boolean): void
  • setLayer(layer: string): void
  • setPosition(x: number, y: number): void
  • setVariableNumber(variable: Variable, newValue: number): void
  • Shortcut to set the value of a variable considered as a number

    Parameters

    • variable: Variable

      The variable to be changed

    • newValue: number

      The value to be set

    Returns void

  • setVariableString(variable: Variable, newValue: string): void
  • Shortcut to set the value of a variable considered as a string

    Parameters

    • variable: Variable

      The variable to be changed

    • newValue: string

      The value to be set

    Returns void

  • setWidth(width: number): void
  • setX(x: number): void
  • setY(y: number): void
  • setZOrder(z: number): void
  • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
  • Compare a timer elapsed time. If the timer does not exist, it is created.

    deprecated

    prefer using getTimerElapsedTimeInSecondsOrNaN.

    Parameters

    • timerName: string

      The timer name.

    • timeInSeconds: number

      The time value to check in seconds.

    Returns boolean

    True if the timer exists and its value is greater than or equal than the given time, false otherwise.

  • timerPaused(timerName: string): boolean
  • Test a if a timer is paused.

    Parameters

    • timerName: string

      The timer name.

    Returns boolean

    True if the timer exists and is paused, false otherwise.

  • unpauseTimer(timerName: string): void
  • unregisterDestroyCallback(callback: () => void): void
  • updateAABB(): void
  • Update the AABB (axis aligned bounding box) for the object.

    Default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box.

    You should not call this function by yourself, it is called when necessary by getAABB method. However, you can redefine it if your object can have a faster implementation.

    Returns void

  • updateAllEffectParameters(effectData: EffectData): boolean
  • updateForces(elapsedTime: number): void
  • Called once a step by runtimeScene to update forces magnitudes and remove null ones.

    Parameters

    • elapsedTime: number

    Returns void

  • updateFromNetworkSyncData(networkSyncData: ObjectNetworkSyncData): void
  • Called when the object must be updated using the specified networkSyncData. This is the case during an update of the object from the network.

    Parameters

    • networkSyncData: ObjectNetworkSyncData

      The new data for the object.

    Returns void

    true if the object was updated, false if it could not (i.e: network sync is not supported).

  • updateFromObjectData(oldObjectData: ObjectData, newObjectData: ObjectData): boolean
  • Called when the object must be updated using the specified objectData. This is the case during hot-reload, and is only called if the object was modified.

    Parameters

    • oldObjectData: ObjectData

      The previous data for the object.

    • newObjectData: ObjectData

      The new data for the object.

    Returns boolean

    true if the object was updated, false if it could not (i.e: hot-reload is not supported).

  • updateHitBoxes(): void
  • Update the hit boxes for the object.

    The default implementation set a basic bounding box based on the size (getWidth and getHeight) and the center point of the object (getCenterX and getCenterY). Result is cached until invalidated (by a position change, angle change...).

    You should not call this function by yourself, it is called when necessary by getHitBoxes method. However, you can redefine it if your object need custom hit boxes.

    Returns void

  • updateTimers(elapsedTime: number): void
  • Updates the object timers. Called once during the game loop, before events and rendering.

    Parameters

    • elapsedTime: number

      The elapsed time since the previous frame in milliseconds.

    Returns void

  • variableChildExists(variable: Variable, childName: string): boolean
  • variableClearChildren(variable: Variable): void
  • variableRemoveChild(variable: Variable, childName: string): void

Properties

angle: number = 0
forcesGarbage: Force[] = []

Global container for unused forces, avoiding recreating forces each tick.

static
getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      Parameters

      Returns number

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      Parameters

      Returns number

getFirstVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      Parameters

      Returns string

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      Parameters

      Returns string

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      Parameters

      Returns number

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      Parameters

      Returns number

getLastVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      Parameters

      Returns string

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • Get the squared distance, in pixels, between the center of this object and a position.

      Parameters

      • targetX: number

        Target X position

      • targetY: number

        Target Y position

      Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • Get the number of children from a variable

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The number of children

getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

    • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The value of the specified variable

getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

    • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns string

      The string of the specified variable

hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null

A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

persistentUuid: null | string = null

An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

pick: boolean = false

A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

    • Return the variable passed as argument without any change. Only for usage by events.

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns Variable

      The specified variable

setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • Shortcut to set the value of a variable considered as a number

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: number

        The value to be set

      Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • Shortcut to set the value of a variable considered as a string

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: string

        The value to be set

      Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable

        The variable to be tested

      • childName: string

        The name of the child

      Returns boolean

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

    • static

      Parameters

      • variable: Variable

        The variable to be cleared

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

    • This shortcut function is needed for events code generation.

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

    • This shortcut function is needed for events code generation.

      Parameters

      Returns void

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

      • variable: Variable

        The variable to be changed

      • childName: string

        The name of the child

      Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
destroyCallbacks: Set<() => void> = ...
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      Parameters

      Returns void

Constructors

Generated using TypeDoc