Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • createObjectFromGroupOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists, objectName: string, x: number, y: number, layerName: string): void
  • Allows events to create a new object on a scene.

    Parameters

    • objectsContext: RuntimeScene | EventsFunctionContext
    • objectsLists: ObjectsLists
    • objectName: string
    • x: number
    • y: number
    • layerName: string

    Returns void

  • createObjectOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists, x: number, y: number, layerName: string): null | RuntimeObject
  • Allows events to create a new object on a scene.

    Parameters

    • objectsContext: RuntimeScene | EventsFunctionContext
    • objectsLists: ObjectsLists
    • x: number
    • y: number
    • layerName: string

    Returns null | RuntimeObject

  • distanceTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, distance: number, inverted: boolean): boolean
  • Parameters

    • objectsLists1: ObjectsLists
    • objectsLists2: ObjectsLists
    • distance: number
    • inverted: boolean

    Returns boolean

  • doCreateObjectOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectName: string, objectsLists: ObjectsLists, x: number, y: number, layerName: string): null | RuntimeObject
  • Do the work of creating a new object

    Parameters

    • objectsContext: RuntimeScene | EventsFunctionContext
    • objectName: string
    • objectsLists: ObjectsLists
    • x: number
    • y: number
    • layerName: string

    Returns null | RuntimeObject

  • Filter in-place the specified array to remove objects for which pick property is set to false.

    Parameters

    Returns void

  • getPickedInstancesCount(objectsLists: ObjectsLists): number
  • Return the number of instances in the specified lists of objects.

    Parameters

    • objectsLists: ObjectsLists

    Returns number

  • getSceneInstancesCount(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists): number
  • Return the number of instances of the specified objects living on the scene.

    Parameters

    • objectsContext: RuntimeScene | EventsFunctionContext
    • objectsLists: ObjectsLists

    Returns number

  • hitBoxesCollisionTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, inverted: boolean, instanceContainer: RuntimeInstanceContainer, ignoreTouchingEdges: boolean): boolean
  • Parameters

    • objectsLists1: ObjectsLists
    • objectsLists2: ObjectsLists
    • inverted: boolean
    • instanceContainer: RuntimeInstanceContainer
    • ignoreTouchingEdges: boolean

    Returns boolean

  • movesTowardTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, tolerance: number, inverted: boolean): boolean
  • Parameters

    • objectsLists1: ObjectsLists
    • objectsLists2: ObjectsLists
    • tolerance: number
    • inverted: boolean

    Returns boolean

  • pickAllObjects(objectsContext: any, objectsLists: any): boolean
  • Parameters

    • objectsContext: any
    • objectsLists: any

    Returns boolean

  • pickNearestObject(objectsLists: any, x: any, y: any, inverted: any): boolean
  • Parameters

    • objectsLists: any
    • x: any
    • y: any
    • inverted: any

    Returns boolean

  • pickObjectsIf(predicate: Function, objectsLists: ObjectsLists, negatePredicate: boolean, extraArg: any): boolean
  • Filter objects to keep only the one that fullfil the predicate

    Objects that do not fullfil the predicate are removed from objects lists.

    Parameters

    • predicate: Function

      The function applied to each object: must return true if the object fulfill the predicate.

    • objectsLists: ObjectsLists

      The lists of objects to trim

    • negatePredicate: boolean

      If set to true, the result of the predicate is negated.

    • extraArg: any

      Argument passed to the predicate (along with the object). Useful for avoiding relying on temporary closures.

    Returns boolean

    true if at least one object fulfill the predicate.

  • pickOnly(objectsLists: ObjectsLists, runtimeObject: RuntimeObject): void
  • Keep only the specified object in the lists of picked objects.

    Parameters

    • objectsLists: ObjectsLists

      The lists of objects to trim

    • runtimeObject: RuntimeObject

      The object to keep in the lists

    Returns void

  • pickedObjectsCount(objectsLists: ObjectsLists): number
  • deprecated

    Parameters

    • objectsLists: ObjectsLists

    Returns number

  • raycastObject(objectsLists: ObjectsLists, x: number, y: number, angle: number, dist: number, varX: Variable, varY: Variable, inverted: boolean): boolean
  • Parameters

    • objectsLists: ObjectsLists
    • x: number
    • y: number
    • angle: number
    • dist: number
    • varX: Variable
    • varY: Variable
    • inverted: boolean

    Returns boolean

  • raycastObjectToPosition(objectsLists: ObjectsLists, x: number, y: number, endX: number, endY: number, varX: Variable, varY: Variable, inverted: boolean): boolean
  • Parameters

    • objectsLists: ObjectsLists
    • x: number
    • y: number
    • endX: number
    • endY: number
    • varX: Variable
    • varY: Variable
    • inverted: boolean

    Returns boolean

  • turnedTowardTest(objectsLists1: any, objectsLists2: any, tolerance: any, inverted: any): boolean
  • Parameters

    • objectsLists1: any
    • objectsLists2: any
    • tolerance: any
    • inverted: any

    Returns boolean

  • twoListsTest(predicate: (object1: RuntimeObject, object2: RuntimeObject, extraArg: any) => boolean, objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, inverted: boolean, extraArg: any): boolean
  • Do a test on two tables of objects so as to pick only the pair of objects for which the test is true.

    Note that the predicate method is not called strictly for each pair: When considering a pair of objects, if these objects have already been marked as picked, the predicate method won't be called again.

    Cost (Worst case, predicate being always false): Cost(Setting property 'picked' of NbObjList1+NbObjList2 objects to false)

    • Cost(predicate)NbObjList1NbObjList2
    • Cost(Testing NbObjList1+NbObjList2 booleans)
    • Cost(Removing NbObjList1+NbObjList2 objects from all the lists)

    Cost (Best case, predicate being always true): Cost(Setting property 'picked' of NbObjList1+NbObjList2 objects to false)

    • Cost(predicate)*(NbObjList1+NbObjList2)
    • Cost(Testing NbObjList1+NbObjList2 booleans)

    Parameters

    • predicate: (object1: RuntimeObject, object2: RuntimeObject, extraArg: any) => boolean

      The predicate function is called with the two objects to compare, and an optional argument extraArg

    • objectsLists1: ObjectsLists

      The first lists of objects

    • objectsLists2: ObjectsLists

      The second lists of objects

    • inverted: boolean

      If inverted == true, only the objects of the first table are filtered.

    • extraArg: any

      (optional) This argument should be used to avoid declaring the predicate as a closure that would be created and destroyed at each call to twoListsTest (potentially multiple time per frame).

    Returns boolean

Generated using TypeDoc