Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • createObjectFromGroupOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists, objectName: string, x: number, y: number, layerName: string): void
  • createObjectOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists, x: number, y: number, layerName: string): null | RuntimeObject
  • distanceTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, distance: number, inverted: boolean): boolean
  • doCreateObjectOnScene(objectsContext: RuntimeScene | EventsFunctionContext, objectName: string, objectsLists: ObjectsLists, x: number, y: number, layerName: string): null | RuntimeObject
  • getPickedInstancesCount(objectsLists: ObjectsLists): number
  • getSceneInstancesCount(objectsContext: RuntimeScene | EventsFunctionContext, objectsLists: ObjectsLists): number
  • hitBoxesCollisionTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, inverted: boolean, instanceContainer: RuntimeInstanceContainer, ignoreTouchingEdges: boolean): boolean
  • isTurnedTowardObject(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, tolerance: number, inverted: boolean): boolean
  • movesTowardTest(objectsLists1: ObjectsLists, objectsLists2: ObjectsLists, tolerance: number, inverted: boolean): boolean
  • pickAllObjects(objectsContext: any, objectsLists: any): boolean
  • pickNearestObject(objectsLists: any, x: any, y: any, inverted: any): 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
  • pickedObjectsCount(objectsLists: ObjectsLists): number
  • raycastObject(objectsLists: ObjectsLists, x: number, y: number, angle: number, dist: number, varX: Variable, varY: Variable, inverted: boolean): boolean
  • raycastObjectToPosition(objectsLists: ObjectsLists, x: number, y: number, endX: number, endY: number, varX: Variable, varY: Variable, inverted: boolean): boolean
  • turnedTowardTest(objectsLists1: any, objectsLists2: any, tolerance: any, inverted: any): 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