diff --git a/README.md b/README.md index cb9efb5..06a311d 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,4 @@ fantomEngine provides a lot of feature like these: * **Easy scene/room management**. * Objects can be composed of several single images. * **Automatic object pooling**. + * **Custom GUI elements** diff --git a/docs/cftAStar.monkey.html b/docs/cftAStar.monkey.html index c6c3719..0afc4c8 100644 --- a/docs/cftAStar.monkey.html +++ b/docs/cftAStar.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftAStar -

Module fantomEngine.cftAStar


The cftAStar module hosts several classes that bring A* pathfinding to fantomEngine. The grid of nodes can be of any size and shape.

Table of contents:

Classes:

Class ftAStar
Description:The class ftAStar provides A-Star pathfinding functionality for fantomEngine. The calculated paths can be used to set up waypoints for the ftWaypoint class.
Table of contents:Methods:
  • AddNode   ( Method AddNode:ftGridNode(ID:Int, xpos:Float, ypos:Float, relative:Bool = False) )   Changed in v1.55
  • Connect   ( Method Connect:Void(parentIndex:Int, childIndex:Int, bothSides:Bool = False) )
  • ConnectByID   ( Method ConnectByID:Void(parentID:Int, childID:Int, bothSides:Bool = False) )
  • FindClosestNode   ( Method FindClosestNode:ftGridNode(xpos:Float, ypos:Float) )
  • FindPath   ( Method FindPath:Float(startIndex:Int, endIndex:Int) )
  • GetAngle   ( Method GetAngle:Float() )   New in v.155
  • GetBlock   ( Method GetBlock:bool(index:Int) )
  • GetChild   ( Method GetChild:ftGridNode(parentIndex:Int, childIndex:Int) )
  • GetChildCount   ( Method GetChildCount:Int(index:Int) )
  • GetNode   ( Method GetNode:ftGridNode(index:Int) )
  • GetNodeByID   ( Method GetNodeByID:ftGridNode(id:Int) )
  • GetNodeCount   ( Method GetNodeCount:Int() )
  • GetNodeID   ( Method GetNodeID:Int(index:Int) )
  • GetNodeIndex   ( Method GetNodeIndex:Int(id:Int) )
  • GetPathNode   ( Method GetPathNode:ftGridNode(index:Int) )
  • GetPathNodeCount   ( Method GetPathNodeCount:Int() )
  • GetPos   ( Method GetPos:Float[](index:Int) )
  • GetPosX   ( Method GetPosX:Float(index:Int) )
  • GetPosY   ( Method GetPosY:Float(index:Int) )
  • GetScaleX   ( Method GetScaleX:Float() )   New in v.155
  • GetScaleY   ( Method GetScaleY:Float() )   New in v.155
  • LoadFromString   ( Method LoadFromString:Void(ps:String) )
  • Remove   ( Method Remove:Void() )
  • RemoveAllNodes   ( Method RemoveAllNodes:Void() )
  • Render   ( Method Render:Void(size:Int=20) )
  • SaveToString   ( Method SaveToString:String() )
  • SetAngle   ( Method SetAngle:Void(a:Float, relative:Bool = False) )
  • SetBlock   ( Method SetBlock:Void(index:Int, blockFlag:Bool) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )   Changed in v1.55
  • SetPos   ( Method SetPos:Void(y:Float, relative:Bool = False) )   Changed in v1.55
  • SetPosX   ( Method SetPosX:Void(x:Float, relative:Bool = False) )   Changed in v1.55
  • SetScale   ( Method SetScale:Void(x:Float, y:Float, relative:Bool = False) )   Changed in v1.55.

Method AddNode:ftGridNode(ID:Int, xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftGridNode = ftAStar.AddNode (ID:Int, xpos:Float, ypos:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Add a node to a grid.
Return type:ftGridNode
Parameters:
NameTypeValue
IDInt
xposFloat
yposFloat
relativeBoolFalse
Method Connect:Void(parentIndex:Int, childIndex:Int, bothSides:Bool = False)

Syntax:


ftAStar.Connect (parentIndex:Int, childIndex:Int, bothSides:Bool = False)
Description:Connect a child node to its parent node by their node index.
Parameters:
NameTypeValue
parentIndexInt
childIndexInt
bothSidesBoolFalse
Method ConnectByID:Void(parentID:Int, childID:Int, bothSides:Bool = False)

Syntax:


ftAStar.ConnectByID (parentID:Int, childID:Int, bothSides:Bool = False)
Description:Connect a child node to its parent node by their ID values.
Parameters:
NameTypeValue
parentIDInt
childIDInt
bothSidesBoolFalse
Method FindClosestNode:ftGridNode(xpos:Float, ypos:Float)

Syntax:


ftGridNode = ftAStar.FindClosestNode (xpos:Float, ypos:Float)
Description:To find the closest node of a grid to a given position, use this method.
Return type:ftGridNode
Parameters:
NameTypeValue
xposFloat
yposFloat
Method FindPath:Float(startIndex:Int, endIndex:Int)

Syntax:


Float = ftAStar.FindPath (startIndex:Int, endIndex:Int)
Description:Calculates a path between two grid nodes and return the length of the path in pixel.
Return type:Float
Parameters:
NameTypeValue
startIndexInt
endIndexInt
Method GetAngle:Float()

Syntax:


Float = ftAStar.GetAngle ()
Changes:New in v.155
Description:Returns the angle of the grid.
Return type:Float
Method GetBlock:bool(index:Int)

Syntax:


bool = ftAStar.GetBlock (index:Int)
Description:Returns the block flag of a grid node.
Return type:bool
Parameters:
NameTypeValue
indexInt
Method GetChild:ftGridNode(parentIndex:Int, childIndex:Int)

Syntax:


ftGridNode = ftAStar.GetChild (parentIndex:Int, childIndex:Int)
Description:Returns the the child grid node of a parent grid node specified both by index. Index start at 1.
Return type:ftGridNode
Parameters:
NameTypeValue
parentIndexInt
childIndexInt
Method GetChildCount:Int(index:Int)

Syntax:


Int = ftAStar.GetChildCount (index:Int)
Description:Returns the number of child nodes of a child node.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetNode:ftGridNode(index:Int)

Syntax:


ftGridNode = ftAStar.GetNode (index:Int)
Description:Get the node with the given index. Index starts with 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetNodeByID:ftGridNode(id:Int)

Syntax:


ftGridNode = ftAStar.GetNodeByID (id:Int)
Description:Get the node with the given ID.
Return type:ftGridNode
Parameters:
NameTypeValue
idInt
Method GetNodeCount:Int()

Syntax:


Int = ftAStar.GetNodeCount ()
Description:Returns the grid node count.
Return type:Int
Method GetNodeID:Int(index:Int)

Syntax:


Int = ftAStar.GetNodeID (index:Int)
Description:Get the node ID with the given index. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetNodeIndex:Int(id:Int)

Syntax:


Int = ftAStar.GetNodeIndex (id:Int)
Description:Get the node index with the given ID. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
idInt
Method GetPathNode:ftGridNode(index:Int)

Syntax:


ftGridNode = ftAStar.GetPathNode (index:Int)
Description:Get the grid node with the given index. Index starts with 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetPathNodeCount:Int()

Syntax:


Int = ftAStar.GetPathNodeCount ()
Description:Returns the path node count of the last calculated path.
Return type:Int
Method GetPos:Float[](index:Int)

Syntax:


Float[] = ftAStar.GetPos (index:Int)
Description:Returns the X and Y position of a grid node.
Return type:Float[]
Parameters:
NameTypeValue
indexInt
Method GetPosX:Float(index:Int)

Syntax:


Float = ftAStar.GetPosX (index:Int)
Description:Returns the X position of a grid node.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetPosY:Float(index:Int)

Syntax:


Float = ftAStar.GetPosY (index:Int)
Description:Returns the Y position of a grid node.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetScaleX:Float()

Syntax:


Float = ftAStar.GetScaleX ()
Changes:New in v.155
Description:Returns the X scale factor of the grid.
Return type:Float
Method GetScaleY:Float()

Syntax:


Float = ftAStar.GetScaleY ()
Changes:New in v.155
Description:Returns the Y scale factor of the grid.
Return type:Float
Method LoadFromString:Void(ps:String)

Syntax:


ftAStar.LoadFromString (ps:String)
Description:Load a grid from a string.
Parameters:
NameTypeValue
psString
Method Remove:Void()

Syntax:


ftAStar.Remove ()
Description:Removes the complete grid.
Method RemoveAllNodes:Void()

Syntax:


ftAStar.RemoveAllNodes ()
Description:Removes all grid nodes.
Method Render:Void(size:Int=20)

Syntax:


ftAStar.Render (size:Int=20)
Description:Render the grid.
Parameters:
NameTypeValue
sizeInt20
Method SaveToString:String()

Syntax:


String = ftAStar.SaveToString ()
Description:Save a path to a string.
Return type:String
Method SetAngle:Void(a:Float, relative:Bool = False)

Syntax:


ftAStar.SetAngle (a:Float, relative:Bool = False)
Description:Sets the angle of a grid and position its nodes regarding the angle.
Parameters:
NameTypeValue
aFloat
relativeBoolFalse
Method SetBlock:Void(index:Int, blockFlag:Bool)

Syntax:


ftAStar.SetBlock (index:Int, blockFlag:Bool)
Description:Set the block flag of a grid node.
Parameters:
NameTypeValue
indexInt
blockFlagBool
Details:A blocked grid node won't be visited during the path finding
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftAStar.SetPos (x:Float, y:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the position of a grid and its nodes.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetPos:Void(y:Float, relative:Bool = False)

Syntax:


ftAStar.SetPos (y:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the Y position of a grid and its nodes.
Parameters:
NameTypeValue
yFloat
relativeBoolFalse
Method SetPosX:Void(x:Float, relative:Bool = False)

Syntax:


ftAStar.SetPosX (x:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the X position of a grid and its nodes.
Parameters:
NameTypeValue
xFloat
relativeBoolFalse
Method SetScale:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftAStar.SetScale (x:Float, y:Float, relative:Bool = False)
Changes:Changed in v1.55.
Description:Sets the scale of a grid and position its nodes regarding the angle.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Class ftGridNode
Description:An instance of the class ftGridNode represents one node inside a grid. And after you have found a path via ftAStar.FindPath, you get a list of nodes you can travewl along their positions.
Table of contents:Methods:
  • GetBlock   ( Method GetBlock:Bool() )
  • GetChild   ( Method GetChild:ftGridNode(index:Int) )
  • GetChildCount   ( Method GetChildCount:Int() )
  • GetID   ( Method GetID:Int() )
  • GetIndex   ( Method GetIndex:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • Remove   ( Method Remove:Void() )
  • RemoveAllChildren   ( Method RemoveAllChildren:Void() )
  • SetBlock   ( Method SetBlock:Void(blockFlag:Bool) )
  • SetPos   ( Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False) )   Changed in v1.55

Method GetBlock:Bool()

Syntax:


Bool = ftGridNode.GetBlock ()
Description:Returns if the node is blocked.
Return type:Bool
Method GetChild:ftGridNode(index:Int)

Syntax:


ftGridNode = ftGridNode.GetChild (index:Int)
Description:Returns the child of a node specified by a given index. Index starts at 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetChildCount:Int()

Syntax:


Int = ftGridNode.GetChildCount ()
Description:Returns the number of children of a node.
Return type:Int
Method GetID:Int()

Syntax:


Int = ftGridNode.GetID ()
Description:Returns the ID of a node.
Return type:Int
Method GetIndex:Int()

Syntax:


Int = ftGridNode.GetIndex ()
Description:Get the node index Index starts with 1.
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftGridNode.GetPos ()
Description:Returns the X and Y position of a node.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftGridNode.GetPosX ()
Description:Returns the X position of a node.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftGridNode.GetPosY ()
Description:Returns the Y position of a node.
Return type:Float
Method Remove:Void()

Syntax:


ftGridNode.Remove ()
Description:Remove a node.
Method RemoveAllChildren:Void()

Syntax:


ftGridNode.RemoveAllChildren ()
Description:Remove all connected children of a node.
Method SetBlock:Void(blockFlag:Bool)

Syntax:


ftGridNode.SetBlock (blockFlag:Bool)
Description:Sets the block flag of a node
Parameters:
NameTypeValue
blockFlagBool
Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftGridNode.SetPos (xpos:Float, ypos:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the position of a node inside a grid.
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftAStar


The cftAStar module hosts several classes that bring A* pathfinding to fantomEngine. The grid of nodes can be of any size and shape.

Table of contents:

Classes:

Class ftAStar
Description:The class ftAStar provides A-Star pathfinding functionality for fantomEngine. The calculated paths can be used to set up waypoints for the ftWaypoint class.
Table of contents:Methods:
  • AddNode   ( Method AddNode:ftGridNode(ID:Int, xpos:Float, ypos:Float, relative:Bool = False) )   Changed in v1.55
  • Connect   ( Method Connect:Void(parentIndex:Int, childIndex:Int, bothSides:Bool = False) )
  • ConnectByID   ( Method ConnectByID:Void(parentID:Int, childID:Int, bothSides:Bool = False) )
  • FindClosestNode   ( Method FindClosestNode:ftGridNode(xpos:Float, ypos:Float) )
  • FindPath   ( Method FindPath:Float(startIndex:Int, endIndex:Int) )
  • GetAngle   ( Method GetAngle:Float() )   New in v.155
  • GetBlock   ( Method GetBlock:bool(index:Int) )
  • GetChild   ( Method GetChild:ftGridNode(parentIndex:Int, childIndex:Int) )
  • GetChildCount   ( Method GetChildCount:Int(index:Int) )
  • GetNode   ( Method GetNode:ftGridNode(index:Int) )
  • GetNodeByID   ( Method GetNodeByID:ftGridNode(id:Int) )
  • GetNodeCount   ( Method GetNodeCount:Int() )
  • GetNodeID   ( Method GetNodeID:Int(index:Int) )
  • GetNodeIndex   ( Method GetNodeIndex:Int(id:Int) )
  • GetPathNode   ( Method GetPathNode:ftGridNode(index:Int) )
  • GetPathNodeCount   ( Method GetPathNodeCount:Int() )
  • GetPos   ( Method GetPos:Float[](index:Int) )
  • GetPosX   ( Method GetPosX:Float(index:Int) )
  • GetPosY   ( Method GetPosY:Float(index:Int) )
  • GetScaleX   ( Method GetScaleX:Float() )   New in v.155
  • GetScaleY   ( Method GetScaleY:Float() )   New in v.155
  • LoadFromString   ( Method LoadFromString:Void(ps:String) )
  • Remove   ( Method Remove:Void() )
  • RemoveAllNodes   ( Method RemoveAllNodes:Void() )
  • Render   ( Method Render:Void(size:Int=20) )
  • SaveToString   ( Method SaveToString:String() )
  • SetAngle   ( Method SetAngle:Void(a:Float, relative:Bool = False) )
  • SetBlock   ( Method SetBlock:Void(index:Int, blockFlag:Bool) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )   Changed in v1.55
  • SetPos   ( Method SetPos:Void(y:Float, relative:Bool = False) )   Changed in v1.55
  • SetPosX   ( Method SetPosX:Void(x:Float, relative:Bool = False) )   Changed in v1.55
  • SetScale   ( Method SetScale:Void(x:Float, y:Float, relative:Bool = False) )   Changed in v1.55.

Method AddNode:ftGridNode(ID:Int, xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftGridNode = ftAStar.AddNode (ID:Int, xpos:Float, ypos:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Add a node to a grid.
Return type:ftGridNode
Parameters:
NameTypeValue
IDInt
xposFloat
yposFloat
relativeBoolFalse
Method Connect:Void(parentIndex:Int, childIndex:Int, bothSides:Bool = False)

Syntax:


ftAStar.Connect (parentIndex:Int, childIndex:Int, bothSides:Bool = False)
Description:Connect a child node to its parent node by their node index.
Parameters:
NameTypeValue
parentIndexInt
childIndexInt
bothSidesBoolFalse
Method ConnectByID:Void(parentID:Int, childID:Int, bothSides:Bool = False)

Syntax:


ftAStar.ConnectByID (parentID:Int, childID:Int, bothSides:Bool = False)
Description:Connect a child node to its parent node by their ID values.
Parameters:
NameTypeValue
parentIDInt
childIDInt
bothSidesBoolFalse
Method FindClosestNode:ftGridNode(xpos:Float, ypos:Float)

Syntax:


ftGridNode = ftAStar.FindClosestNode (xpos:Float, ypos:Float)
Description:To find the closest node of a grid to a given position, use this method.
Return type:ftGridNode
Parameters:
NameTypeValue
xposFloat
yposFloat
Method FindPath:Float(startIndex:Int, endIndex:Int)

Syntax:


Float = ftAStar.FindPath (startIndex:Int, endIndex:Int)
Description:Calculates a path between two grid nodes and return the length of the path in pixel.
Return type:Float
Parameters:
NameTypeValue
startIndexInt
endIndexInt
Method GetAngle:Float()

Syntax:


Float = ftAStar.GetAngle ()
Changes:New in v.155
Description:Returns the angle of the grid.
Return type:Float
Method GetBlock:bool(index:Int)

Syntax:


bool = ftAStar.GetBlock (index:Int)
Description:Returns the block flag of a grid node.
Return type:bool
Parameters:
NameTypeValue
indexInt
Method GetChild:ftGridNode(parentIndex:Int, childIndex:Int)

Syntax:


ftGridNode = ftAStar.GetChild (parentIndex:Int, childIndex:Int)
Description:Returns the the child grid node of a parent grid node specified both by index. Index start at 1.
Return type:ftGridNode
Parameters:
NameTypeValue
parentIndexInt
childIndexInt
Method GetChildCount:Int(index:Int)

Syntax:


Int = ftAStar.GetChildCount (index:Int)
Description:Returns the number of child nodes of a child node.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetNode:ftGridNode(index:Int)

Syntax:


ftGridNode = ftAStar.GetNode (index:Int)
Description:Get the node with the given index. Index starts with 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetNodeByID:ftGridNode(id:Int)

Syntax:


ftGridNode = ftAStar.GetNodeByID (id:Int)
Description:Get the node with the given ID.
Return type:ftGridNode
Parameters:
NameTypeValue
idInt
Method GetNodeCount:Int()

Syntax:


Int = ftAStar.GetNodeCount ()
Description:Returns the grid node count.
Return type:Int
Method GetNodeID:Int(index:Int)

Syntax:


Int = ftAStar.GetNodeID (index:Int)
Description:Get the node ID with the given index. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetNodeIndex:Int(id:Int)

Syntax:


Int = ftAStar.GetNodeIndex (id:Int)
Description:Get the node index with the given ID. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
idInt
Method GetPathNode:ftGridNode(index:Int)

Syntax:


ftGridNode = ftAStar.GetPathNode (index:Int)
Description:Get the grid node with the given index. Index starts with 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetPathNodeCount:Int()

Syntax:


Int = ftAStar.GetPathNodeCount ()
Description:Returns the path node count of the last calculated path.
Return type:Int
Method GetPos:Float[](index:Int)

Syntax:


Float[] = ftAStar.GetPos (index:Int)
Description:Returns the X and Y position of a grid node.
Return type:Float[]
Parameters:
NameTypeValue
indexInt
Method GetPosX:Float(index:Int)

Syntax:


Float = ftAStar.GetPosX (index:Int)
Description:Returns the X position of a grid node.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetPosY:Float(index:Int)

Syntax:


Float = ftAStar.GetPosY (index:Int)
Description:Returns the Y position of a grid node.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetScaleX:Float()

Syntax:


Float = ftAStar.GetScaleX ()
Changes:New in v.155
Description:Returns the X scale factor of the grid.
Return type:Float
Method GetScaleY:Float()

Syntax:


Float = ftAStar.GetScaleY ()
Changes:New in v.155
Description:Returns the Y scale factor of the grid.
Return type:Float
Method LoadFromString:Void(ps:String)

Syntax:


ftAStar.LoadFromString (ps:String)
Description:Load a grid from a string.
Parameters:
NameTypeValue
psString
Method Remove:Void()

Syntax:


ftAStar.Remove ()
Description:Removes the complete grid.
Method RemoveAllNodes:Void()

Syntax:


ftAStar.RemoveAllNodes ()
Description:Removes all grid nodes.
Method Render:Void(size:Int=20)

Syntax:


ftAStar.Render (size:Int=20)
Description:Render the grid.
Parameters:
NameTypeValue
sizeInt20
Method SaveToString:String()

Syntax:


String = ftAStar.SaveToString ()
Description:Save a path to a string.
Return type:String
Method SetAngle:Void(a:Float, relative:Bool = False)

Syntax:


ftAStar.SetAngle (a:Float, relative:Bool = False)
Description:Sets the angle of a grid and position its nodes regarding the angle.
Parameters:
NameTypeValue
aFloat
relativeBoolFalse
Method SetBlock:Void(index:Int, blockFlag:Bool)

Syntax:


ftAStar.SetBlock (index:Int, blockFlag:Bool)
Description:Set the block flag of a grid node.
Parameters:
NameTypeValue
indexInt
blockFlagBool
Details:A blocked grid node won't be visited during the path finding
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftAStar.SetPos (x:Float, y:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the position of a grid and its nodes.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetPos:Void(y:Float, relative:Bool = False)

Syntax:


ftAStar.SetPos (y:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the Y position of a grid and its nodes.
Parameters:
NameTypeValue
yFloat
relativeBoolFalse
Method SetPosX:Void(x:Float, relative:Bool = False)

Syntax:


ftAStar.SetPosX (x:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the X position of a grid and its nodes.
Parameters:
NameTypeValue
xFloat
relativeBoolFalse
Method SetScale:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftAStar.SetScale (x:Float, y:Float, relative:Bool = False)
Changes:Changed in v1.55.
Description:Sets the scale of a grid and position its nodes regarding the angle.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Class ftGridNode
Description:An instance of the class ftGridNode represents one node inside a grid. And after you have found a path via ftAStar.FindPath, you get a list of nodes you can travewl along their positions.
Table of contents:Methods:
  • GetBlock   ( Method GetBlock:Bool() )
  • GetChild   ( Method GetChild:ftGridNode(index:Int) )
  • GetChildCount   ( Method GetChildCount:Int() )
  • GetID   ( Method GetID:Int() )
  • GetIndex   ( Method GetIndex:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • Remove   ( Method Remove:Void() )
  • RemoveAllChildren   ( Method RemoveAllChildren:Void() )
  • SetBlock   ( Method SetBlock:Void(blockFlag:Bool) )
  • SetPos   ( Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False) )   Changed in v1.55

Method GetBlock:Bool()

Syntax:


Bool = ftGridNode.GetBlock ()
Description:Returns if the node is blocked.
Return type:Bool
Method GetChild:ftGridNode(index:Int)

Syntax:


ftGridNode = ftGridNode.GetChild (index:Int)
Description:Returns the child of a node specified by a given index. Index starts at 1.
Return type:ftGridNode
Parameters:
NameTypeValue
indexInt
Method GetChildCount:Int()

Syntax:


Int = ftGridNode.GetChildCount ()
Description:Returns the number of children of a node.
Return type:Int
Method GetID:Int()

Syntax:


Int = ftGridNode.GetID ()
Description:Returns the ID of a node.
Return type:Int
Method GetIndex:Int()

Syntax:


Int = ftGridNode.GetIndex ()
Description:Get the node index Index starts with 1.
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftGridNode.GetPos ()
Description:Returns the X and Y position of a node.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftGridNode.GetPosX ()
Description:Returns the X position of a node.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftGridNode.GetPosY ()
Description:Returns the Y position of a node.
Return type:Float
Method Remove:Void()

Syntax:


ftGridNode.Remove ()
Description:Remove a node.
Method RemoveAllChildren:Void()

Syntax:


ftGridNode.RemoveAllChildren ()
Description:Remove all connected children of a node.
Method SetBlock:Void(blockFlag:Bool)

Syntax:


ftGridNode.SetBlock (blockFlag:Bool)
Description:Sets the block flag of a node
Parameters:
NameTypeValue
blockFlagBool
Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftGridNode.SetPos (xpos:Float, ypos:Float, relative:Bool = False)
Changes:Changed in v1.55
Description:Sets the position of a node inside a grid.
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftBox2D.monkey.html b/docs/cftBox2D.monkey.html index f797029..53ceaba 100644 --- a/docs/cftBox2D.monkey.html +++ b/docs/cftBox2D.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftBox2D -

Module fantomEngine.cftBox2D


The cftBox2D module hosts an optional Box2D integration class. At the moment, not all functionality of Box2D is integrated but you can create objects, joints, do collision detection and even raycasting.

Table of contents:

Classes:

Class ftBox2D
Description:The ftBox2D class integrates some functionality of Box2D into your project. With it you can connect ftObjects with Box2D bodies. For feature requests, please contact Michael about what you need.
Table of contents:Methods:
  • AddPolygon   ( Method AddPolygon:Void(tmpObj:ftObject, vec:Float[] ) )
  • ApplyForce   ( Method ApplyForce:Void(tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float) )
  • ApplyImpulse   ( Method ApplyImpulse:Void(tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float) )
  • ApplyTorque   ( Method ApplyTorque:Void(tmpObj:ftObject, torque:Float, degree:Bool=True) )
  • ConnectBody   ( Method ConnectBody:Void(tmpObj:ftObject, body:b2Body ) )
  • CreateBox   ( Method CreateBox:b2Body(width:Float,height:Float, xpos:Float, ypos:float ) )
  • CreateCircle   ( Method CreateCircle:b2Body(radius:Float, xpos:Float, ypos:float ) )
  • CreateDistantJoint   ( Method CreateDistantJoint:b2DistanceJoint(bodyA:b2Body, bodyB:b2Body) )
  • CreateMouseJoint   ( Method CreateMouseJoint:b2MouseJoint(groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7 ) )
  • CreateObject   ( Method CreateObject:b2Body(tmpObj:ftObject, btype:Int = b2Body.b2_Body ) )
  • CreatePolygon   ( Method CreatePolygon:b2Body(vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body ) )
  • CreatePolygon   ( Method CreatePolygon:b2Body(filename:String, subBodyName:String, xpos:Float, ypos:Float) )
  • CreateRevoluteJoint   ( Method CreateRevoluteJoint:b2RevoluteJoint(bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True) )
  • CreateRopeJoint   ( Method CreateRopeJoint:b2RopeJoint(bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True) )
  • CreateWeldJoint   ( Method CreateWeldJoint:b2WeldJoint(bodyA:b2Body, bodyB:b2Body) )
  • CreateWorld   ( Method CreateWorld:b2World() )
  • DestroyBody   ( Method DestroyBody:Void(tmpObj:ftObject ) )
  • DestroyJoint   ( Method DestroyJoint:Void(joint:b2Joint ) )
  • GetAngle   ( Method GetAngle:Float(tmpObj:ftObject, degree:Bool = True) )
  • GetAngularDamping   ( Method GetAngularDamping:Float(tmpObj:ftObject) )
  • GetAngularVelocity   ( Method GetAngularVelocity:Float(tmpObj:ftObject, degree:Bool = True) )
  • GetBody   ( Method GetBody:b2Body(tmpObj:ftObject ) )
  • GetDensity   ( Method GetDensity:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterCategoryBits   ( Method GetFilterCategoryBits:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterGroupIndex   ( Method GetFilterGroupIndex:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterMaskBits   ( Method GetFilterMaskBits:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFixture   ( Method GetFixture:b2Fixture(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFixtureCount   ( Method GetFixtureCount:Int(tmpObj:ftObject) )
  • GetFriction   ( Method GetFriction:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetLastRayCastHit   ( Method GetLastRayCastHit:Float[]() )
  • GetLinearDamping   ( Method GetLinearDamping:Float(tmpObj:ftObject) )
  • GetLinearVelocity   ( Method GetLinearVelocity:float[](tmpObj:ftObject) )
  • GetMassData   ( Method GetMassData:Float[](tmpObj:ftObject) )
  • GetPosition   ( Method GetPosition:Float[](tmpObj:ftObject) )
  • GetRestitution   ( Method GetRestitution:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetSensor   ( Method GetSensor:bool(tmpObj:ftObject, fIndex:Int = 1) )
  • GetType   ( Method GetType:Int(tmpObj:ftObject) )
  • InitDebugDraw   ( Method InitDebugDraw:Void() )
  • New   ( Method New(eng:ftEngine) )
  • OnBeginContact   ( Method OnBeginContact:Void (contact:b2Contact) )
  • OnEndContact   ( Method OnEndContact:Void (contact:b2Contact) )
  • OnPostSolve   ( Method OnPostSolve:Void (contact:b2Contact, impulse:b2ContactImpulse) )
  • OnPreSolve   ( Method OnPreSolve:Void (contact:b2Contact, manifold:b2Manifold) )
  • OnRayCast   ( Method OnRayCast:Void (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject) )
  • RayCast   ( Method RayCast:Bool(x1:Float, y1: Float, x2:Float, y2: Float) )
  • RenderDebugDraw   ( Method RenderDebugDraw:Void() )
  • ResetMassData   ( Method ResetMassData:Void(tmpObj:ftObject) )
  • SetActive   ( Method SetActive:Void(tmpObj:ftObject, flag:bool ) )
  • SetAngle   ( Method SetAngle:Void(tmpObj:ftObject, bodyAngle:Float, degree:Bool=True) )
  • SetAngularDamping   ( Method SetAngularDamping:Void(tmpObj:ftObject, damping:Float) )
  • SetAngularVelocity   ( Method SetAngularVelocity:Void(tmpObj:ftObject, velocity:Float, degree:Bool=True) )
  • SetAwake   ( Method SetAwake:Void(tmpObj:ftObject, flag:bool ) )
  • SetBullet   ( Method SetBullet:Void(tmpObj:ftObject, flag:bool ) )
  • SetDensity   ( Method SetDensity:Void(tmpObj:ftObject, density:Float, fIndex:Int = 1) )
  • SetEngine   ( Method SetEngine(eng:ftEngine) )
  • SetFilterCategoryBits   ( Method SetFilterCategoryBits:Void(tmpObj:ftObject, categorybits:Int, fIndex:Int = 1) )
  • SetFilterGroupIndex   ( Method SetFilterGroupIndex:Void(tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1) )
  • SetFilterMaskBits   ( Method SetFilterMaskBits:Void(tmpObj:ftObject, maskbits:Int, fIndex:Int = 1) )
  • SetFixedRotation   ( Method SetFixedRotation:Void(tmpObj:ftObject, flag:bool ) )
  • SetFriction   ( Method SetFriction:Void(tmpObj:ftObject, friction:Float, fIndex:Int = 1) )
  • SetGravity   ( Method SetGravity:Void(gravX:Float, gravY:Float) )
  • SetLinearDamping   ( Method SetLinearDamping:Void(tmpObj:ftObject, damping:Float) )
  • SetLinearVelocity   ( Method SetLinearVelocity:Void(tmpObj:ftObject, vx:Float, vy:Float) )
  • SetMassData   ( Method SetMassData:Void(tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float) )
  • SetPhysicScale   ( Method SetPhysicScale:Void(scale:Float = 30.0) )
  • SetPosition   ( Method SetPosition:Void(tmpObj:ftObject, xpos:Float, ypos:Float) )
  • SetRestitution   ( Method SetRestitution:Void(tmpObj:ftObject, restitution:Float, fIndex:Int = 1) )
  • SetSensor   ( Method SetSensor:Void(tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1) )
  • SetSleepingAllowed   ( Method SetSleepingAllowed:Void(tmpObj:ftObject, flag:Bool ) )
  • SetType   ( Method SetType:Void(tmpObj:ftObject, type:Int) )
  • UpdateObj   ( Method UpdateObj:Void(tmpObj:ftObject ) )
  • UpdateObjAngle   ( Method UpdateObjAngle:Void(tmpObj:ftObject ) )
  • UpdateObjPos   ( Method UpdateObjPos:Void(tmpObj:ftObject ) )
  • UpdateWorld   ( Method UpdateWorld:Void(timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10) )

Method AddPolygon:Void(tmpObj:ftObject, vec:Float[] )

Syntax:


ftBox2D.AddPolygon (tmpObj:ftObject, vec:Float[])
Description:Adds a polygon shape to an existing polygon physics body.
Parameters:
NameTypeValue
tmpObjftObject
vecFloat[]
Method ApplyForce:Void(tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float)

Syntax:


ftBox2D.ApplyForce (tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float)
Description:Applies force to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
forceXFloat
forceYFloat
pointXFloat
pointYFloat
Method ApplyImpulse:Void(tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float)

Syntax:


ftBox2D.ApplyImpulse (tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float)
Description:Applies an impulse to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
impulseXFloat
impulseYFloat
pointXFloat
pointYFloat
Method ApplyTorque:Void(tmpObj:ftObject, torque:Float, degree:Bool=True)

Syntax:


ftBox2D.ApplyTorque (tmpObj:ftObject, torque:Float, degree:Bool=True)
Description:Applies torque to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
torqueFloat
degreeBoolTrue
Method ConnectBody:Void(tmpObj:ftObject, body:b2Body )

Syntax:


ftBox2D.ConnectBody (tmpObj:ftObject, body:b2Body)
Description:Connects the body to an ftObject.
Parameters:
NameTypeValue
tmpObjftObject
bodyb2Body
Method CreateBox:b2Body(width:Float,height:Float, xpos:Float, ypos:float )

Syntax:


b2Body = ftBox2D.CreateBox (width:Float,height:Float, xpos:Float, ypos:float)
Description:Create a box shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposfloat
Method CreateCircle:b2Body(radius:Float, xpos:Float, ypos:float )

Syntax:


b2Body = ftBox2D.CreateCircle (radius:Float, xpos:Float, ypos:float)
Description:Create a circle shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposfloat
Method CreateDistantJoint:b2DistanceJoint(bodyA:b2Body, bodyB:b2Body)

Syntax:


b2DistanceJoint = ftBox2D.CreateDistantJoint (bodyA:b2Body, bodyB:b2Body)
Description:Create a distant joint.
Return type:b2DistanceJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
Method CreateMouseJoint:b2MouseJoint(groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7 )

Syntax:


b2MouseJoint = ftBox2D.CreateMouseJoint (groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7)
Description:Create a mouse joint.
Return type:b2MouseJoint
Parameters:
NameTypeValue
groundBodyb2Body
targetBodyb2Body
targetXFloat
targetYFloat
maxForceFloat
collideConnectBoolTrue
frequencyHzFloat5.0
dampingRatioFloat0.7
Method CreateObject:b2Body(tmpObj:ftObject, btype:Int = b2Body.b2_Body )

Syntax:


b2Body = ftBox2D.CreateObject (tmpObj:ftObject, btype:Int = b2Body.b2_Body)
Description:Create a B2Body object based on a ftObject. It will also connect it to the ftObject.
Return type:b2Body
Parameters:
NameTypeValue
tmpObjftObject
btypeIntb2Body.b2_Body
Method CreatePolygon:b2Body(vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body )

Syntax:


b2Body = ftBox2D.CreatePolygon (vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body)
Description:Create a polygon shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
vecFloat[]
xposFloat
yposFloat
btypeIntb2Body.b2_Body
Method CreatePolygon:b2Body(filename:String, subBodyName:String, xpos:Float, ypos:Float)

Syntax:


b2Body = ftBox2D.CreatePolygon (filename:String, subBodyName:String, xpos:Float, ypos:Float)
Description:Create a polygon shaped B2Body object from a PhysicsEditor compatible json file.
Return type:b2Body
Parameters:
NameTypeValue
filenameString
subBodyNameString
xposFloat
yposFloat
Method CreateRevoluteJoint:b2RevoluteJoint(bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True)

Syntax:


b2RevoluteJoint = ftBox2D.CreateRevoluteJoint (bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True)
Description:Create a revolute joint.
Return type:b2RevoluteJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
startXFloat
startYFloat
lowerAngleFloat
upperAngleFloat
degreeBoolTrue
Method CreateRopeJoint:b2RopeJoint(bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True)

Syntax:


b2RopeJoint = ftBox2D.CreateRopeJoint (bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True)
Description:Create a rope joint.
Return type:b2RopeJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
maxDistanceFloat
collideConnectBoolTrue
Method CreateWeldJoint:b2WeldJoint(bodyA:b2Body, bodyB:b2Body)

Syntax:


b2WeldJoint = ftBox2D.CreateWeldJoint (bodyA:b2Body, bodyB:b2Body)
Description:Create a weld joint.
Return type:b2WeldJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
Method CreateWorld:b2World()

Syntax:


b2World = ftBox2D.CreateWorld ()
Description:Create a B2World object.
Return type:b2World
Method DestroyBody:Void(tmpObj:ftObject )

Syntax:


ftBox2D.DestroyBody (tmpObj:ftObject)
Description:Disconnects and destroys the connected body of an ftObject.
Parameters:
NameTypeValue
tmpObjftObject
Method DestroyJoint:Void(joint:b2Joint )

Syntax:


ftBox2D.DestroyJoint (joint:b2Joint)
Description:Destroys a joint.
Parameters:
NameTypeValue
jointb2Joint
Method GetAngle:Float(tmpObj:ftObject, degree:Bool = True)

Syntax:


Float = ftBox2D.GetAngle (tmpObj:ftObject, degree:Bool = True)
Description:Returns the angle of the connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
degreeBoolTrue
Method GetAngularDamping:Float(tmpObj:ftObject)

Syntax:


Float = ftBox2D.GetAngularDamping (tmpObj:ftObject)
Description:Returns the angular damping of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
Method GetAngularVelocity:Float(tmpObj:ftObject, degree:Bool = True)

Syntax:


Float = ftBox2D.GetAngularVelocity (tmpObj:ftObject, degree:Bool = True)
Description:Returns the angular velocity of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
degreeBoolTrue
Method GetBody:b2Body(tmpObj:ftObject )

Syntax:


b2Body = ftBox2D.GetBody (tmpObj:ftObject)
Description:Returns the connected body of a ftObject.
Return type:b2Body
Parameters:
NameTypeValue
tmpObjftObject
Method GetDensity:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetDensity (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the density of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterCategoryBits:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterCategoryBits (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter category bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterGroupIndex:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterGroupIndex (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter mask bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterMaskBits:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterMaskBits (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter mask bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFixture:b2Fixture(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


b2Fixture = ftBox2D.GetFixture (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the fixture of a objects connected body with the given index.
Return type:b2Fixture
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFixtureCount:Int(tmpObj:ftObject)

Syntax:


Int = ftBox2D.GetFixtureCount (tmpObj:ftObject)
Description:Returns the number of fixtures of a connected body.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
Method GetFriction:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetFriction (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the friction of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetLastRayCastHit:Float[]()

Syntax:


Float[] = ftBox2D.GetLastRayCastHit ()
Description:Returns the postion of the last raycast hit.
Return type:Float[]
Method GetLinearDamping:Float(tmpObj:ftObject)

Syntax:


Float = ftBox2D.GetLinearDamping (tmpObj:ftObject)
Description:Returns the linear damping of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
Method GetLinearVelocity:float[](tmpObj:ftObject)

Syntax:


float[] = ftBox2D.GetLinearVelocity (tmpObj:ftObject)
Description:Returns the linear velocity of a connected body.
Return type:float[]
Parameters:
NameTypeValue
tmpObjftObject
Method GetMassData:Float[](tmpObj:ftObject)

Syntax:


Float[] = ftBox2D.GetMassData (tmpObj:ftObject)
Description:Returns the mass data of a connected body.
Return type:Float[]
Parameters:
NameTypeValue
tmpObjftObject
Details:It will return an array with the following float values
  • index #0 -> mass
  • index #1 -> centerX
  • index #2 -> centerY
  • index #3 -> I

Method GetPosition:Float[](tmpObj:ftObject)

Syntax:


Float[] = ftBox2D.GetPosition (tmpObj:ftObject)
Description:Returns the postion of a connected body.
Return type:Float[]
Parameters:
NameTypeValue
tmpObjftObject
Method GetRestitution:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetRestitution (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the restitution of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetSensor:bool(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


bool = ftBox2D.GetSensor (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the sensor flag of the fixture with the given index.
Return type:bool
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetType:Int(tmpObj:ftObject)

Syntax:


Int = ftBox2D.GetType (tmpObj:ftObject)
Description:Returns the type of a connected body.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
Method InitDebugDraw:Void()

Syntax:


ftBox2D.InitDebugDraw ()
Description:This method initialized the debug drawing of box2D.
Details:To actually draw it, use the RenderDebugDraw method.
Method New(eng:ftEngine)

Syntax:


none = ftBox2D.New (eng:ftEngine)
Description:This method creates a new box2D instance and connects it with the given ftEngine
Return type:none
Parameters:
NameTypeValue
engftEngine
Method OnBeginContact:Void (contact:b2Contact)

Syntax:


ftBox2D.OnBeginContact (contact:b2Contact)
Description:This callback method is called when a collision contact has begun.
Parameters:
NameTypeValue
contactb2Contact
Method OnEndContact:Void (contact:b2Contact)

Syntax:


ftBox2D.OnEndContact (contact:b2Contact)
Description:This callback method is called when a collision contact has ended.
Parameters:
NameTypeValue
contactb2Contact
Method OnPostSolve:Void (contact:b2Contact, impulse:b2ContactImpulse)

Syntax:


ftBox2D.OnPostSolve (contact:b2Contact, impulse:b2ContactImpulse)
Description:This callback method is called after the collision has been solved.
Parameters:
NameTypeValue
contactb2Contact
impulseb2ContactImpulse
Method OnPreSolve:Void (contact:b2Contact, manifold:b2Manifold)

Syntax:


ftBox2D.OnPreSolve (contact:b2Contact, manifold:b2Manifold)
Description:This callback method is called before the collision has been solved.
Parameters:
NameTypeValue
contactb2Contact
manifoldb2Manifold
Method OnRayCast:Void (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject)

Syntax:


ftBox2D.OnRayCast (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject)
Description:This callback method is called when a raycast was successful.
Parameters:
NameTypeValue
rayFractionFloat
rayVecb2Vec2
hitNormalb2Vec2
hitPointb2Vec2
nextPointb2Vec2
fixtureb2Fixture
objftObject
Method RayCast:Bool(x1:Float, y1: Float, x2:Float, y2: Float)

Syntax:


Bool = ftBox2D.RayCast (x1:Float, y1: Float, x2:Float, y2: Float)
Description:Cast a ray and returns TRUE if a shape was hit.
Return type:Bool
Parameters:
NameTypeValue
x1Float
y1 Float
x2Float
y2 Float
Details:If a body was hit, the OnRayCast method will be called.
Method RenderDebugDraw:Void()

Syntax:


ftBox2D.RenderDebugDraw ()
Description:Renders the debug information of the box2D world.
Method ResetMassData:Void(tmpObj:ftObject)

Syntax:


ftBox2D.ResetMassData (tmpObj:ftObject)
Description:Resets the mass data of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
Method SetActive:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetActive (tmpObj:ftObject, flag:bool)
Description:Set the active flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetAngle:Void(tmpObj:ftObject, bodyAngle:Float, degree:Bool=True)

Syntax:


ftBox2D.SetAngle (tmpObj:ftObject, bodyAngle:Float, degree:Bool=True)
Description:Set the angle of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
bodyAngleFloat
degreeBoolTrue
Method SetAngularDamping:Void(tmpObj:ftObject, damping:Float)

Syntax:


ftBox2D.SetAngularDamping (tmpObj:ftObject, damping:Float)
Description:Sets the angular damping of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
dampingFloat
Method SetAngularVelocity:Void(tmpObj:ftObject, velocity:Float, degree:Bool=True)

Syntax:


ftBox2D.SetAngularVelocity (tmpObj:ftObject, velocity:Float, degree:Bool=True)
Description:Set the angular velocity of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
velocityFloat
degreeBoolTrue
Method SetAwake:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetAwake (tmpObj:ftObject, flag:bool)
Description:Set the awake flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetBullet:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetBullet (tmpObj:ftObject, flag:bool)
Description:Sets the bullet flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetDensity:Void(tmpObj:ftObject, density:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetDensity (tmpObj:ftObject, density:Float, fIndex:Int = 1)
Description:Sets the density of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
densityFloat
fIndexInt1
Method SetEngine(eng:ftEngine)

Syntax:


none = ftBox2D.SetEngine (eng:ftEngine)
Description:This method connects it with the given ftEngine
Return type:none
Parameters:
NameTypeValue
engftEngine
Method SetFilterCategoryBits:Void(tmpObj:ftObject, categorybits:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterCategoryBits (tmpObj:ftObject, categorybits:Int, fIndex:Int = 1)
Description:Sets the filter category bits of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
categorybitsInt
fIndexInt1
Method SetFilterGroupIndex:Void(tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterGroupIndex (tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1)
Description:Sets the filter group index of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
groupIndexInt
fIndexInt1
Method SetFilterMaskBits:Void(tmpObj:ftObject, maskbits:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterMaskBits (tmpObj:ftObject, maskbits:Int, fIndex:Int = 1)
Description:Sets the filter mask bits of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
maskbitsInt
fIndexInt1
Method SetFixedRotation:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetFixedRotation (tmpObj:ftObject, flag:bool)
Description:Sets the fixed rotation flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetFriction:Void(tmpObj:ftObject, friction:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetFriction (tmpObj:ftObject, friction:Float, fIndex:Int = 1)
Description:Sets the friction of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
frictionFloat
fIndexInt1
Method SetGravity:Void(gravX:Float, gravY:Float)

Syntax:


ftBox2D.SetGravity (gravX:Float, gravY:Float)
Description:Sets the gravity of the world.
Parameters:
NameTypeValue
gravXFloat
gravYFloat
Method SetLinearDamping:Void(tmpObj:ftObject, damping:Float)

Syntax:


ftBox2D.SetLinearDamping (tmpObj:ftObject, damping:Float)
Description:Sets the linear damping of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
dampingFloat
Method SetLinearVelocity:Void(tmpObj:ftObject, vx:Float, vy:Float)

Syntax:


ftBox2D.SetLinearVelocity (tmpObj:ftObject, vx:Float, vy:Float)
Description:Sets the linear velocity of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
vxFloat
vyFloat
Method SetMassData:Void(tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float)

Syntax:


ftBox2D.SetMassData (tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float)
Description:Sets the mass data of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
massFloat
massCenterXFloat
massCenterYFloat
iFloat
Method SetPhysicScale:Void(scale:Float = 30.0)

Syntax:


ftBox2D.SetPhysicScale (scale:Float = 30.0)
Description:Sets the physic scale of the world.
Parameters:
NameTypeValue
scaleFloat30.0
Method SetPosition:Void(tmpObj:ftObject, xpos:Float, ypos:Float)

Syntax:


ftBox2D.SetPosition (tmpObj:ftObject, xpos:Float, ypos:Float)
Description:Sets the position of a connected body and the ftObject itself.
Parameters:
NameTypeValue
tmpObjftObject
xposFloat
yposFloat
Method SetRestitution:Void(tmpObj:ftObject, restitution:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetRestitution (tmpObj:ftObject, restitution:Float, fIndex:Int = 1)
Description:Sets the restitution of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
restitutionFloat
fIndexInt1
Method SetSensor:Void(tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1)

Syntax:


ftBox2D.SetSensor (tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1)
Description:Sets the sensor flag of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
sensorFlagBool
fIndexInt1
Method SetSleepingAllowed:Void(tmpObj:ftObject, flag:Bool )

Syntax:


ftBox2D.SetSleepingAllowed (tmpObj:ftObject, flag:Bool)
Description:Sets the sleeping allowed flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagBool
Method SetType:Void(tmpObj:ftObject, type:Int)

Syntax:


ftBox2D.SetType (tmpObj:ftObject, type:Int)
Description:Sets the type of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
typeInt
Method UpdateObj:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObj (tmpObj:ftObject)
Description:Updates a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Details:It will update ist position and angle.
Method UpdateObjAngle:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObjAngle (tmpObj:ftObject)
Description:Updates the angle of a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Method UpdateObjPos:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObjPos (tmpObj:ftObject)
Description:Updates the position of a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Method UpdateWorld:Void(timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10)

Syntax:


ftBox2D.UpdateWorld (timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10)
Description:Updates the physical simulation of the box2D world.
Parameters:
NameTypeValue
timeStepFloat1.0/60.0
velocityIterationsInt10
positionIterationsInt10
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftBox2D


The cftBox2D module hosts an optional Box2D integration class. At the moment, not all functionality of Box2D is integrated but you can create objects, joints, do collision detection and even raycasting.

Table of contents:

Classes:

Class ftBox2D
Description:The ftBox2D class integrates some functionality of Box2D into your project. With it you can connect ftObjects with Box2D bodies. For feature requests, please contact Michael about what you need.
Table of contents:Methods:
  • AddPolygon   ( Method AddPolygon:Void(tmpObj:ftObject, vec:Float[] ) )
  • ApplyForce   ( Method ApplyForce:Void(tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float) )
  • ApplyImpulse   ( Method ApplyImpulse:Void(tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float) )
  • ApplyTorque   ( Method ApplyTorque:Void(tmpObj:ftObject, torque:Float, degree:Bool=True) )
  • ConnectBody   ( Method ConnectBody:Void(tmpObj:ftObject, body:b2Body ) )
  • CreateBox   ( Method CreateBox:b2Body(width:Float,height:Float, xpos:Float, ypos:float ) )
  • CreateCircle   ( Method CreateCircle:b2Body(radius:Float, xpos:Float, ypos:float ) )
  • CreateDistantJoint   ( Method CreateDistantJoint:b2DistanceJoint(bodyA:b2Body, bodyB:b2Body) )
  • CreateMouseJoint   ( Method CreateMouseJoint:b2MouseJoint(groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7 ) )
  • CreateObject   ( Method CreateObject:b2Body(tmpObj:ftObject, btype:Int = b2Body.b2_Body ) )
  • CreatePolygon   ( Method CreatePolygon:b2Body(vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body ) )
  • CreatePolygon   ( Method CreatePolygon:b2Body(filename:String, subBodyName:String, xpos:Float, ypos:Float) )
  • CreateRevoluteJoint   ( Method CreateRevoluteJoint:b2RevoluteJoint(bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True) )
  • CreateRopeJoint   ( Method CreateRopeJoint:b2RopeJoint(bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True) )
  • CreateWeldJoint   ( Method CreateWeldJoint:b2WeldJoint(bodyA:b2Body, bodyB:b2Body) )
  • CreateWorld   ( Method CreateWorld:b2World() )
  • DestroyBody   ( Method DestroyBody:Void(tmpObj:ftObject ) )
  • DestroyJoint   ( Method DestroyJoint:Void(joint:b2Joint ) )
  • GetAngle   ( Method GetAngle:Float(tmpObj:ftObject, degree:Bool = True) )
  • GetAngularDamping   ( Method GetAngularDamping:Float(tmpObj:ftObject) )
  • GetAngularVelocity   ( Method GetAngularVelocity:Float(tmpObj:ftObject, degree:Bool = True) )
  • GetBody   ( Method GetBody:b2Body(tmpObj:ftObject ) )
  • GetDensity   ( Method GetDensity:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterCategoryBits   ( Method GetFilterCategoryBits:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterGroupIndex   ( Method GetFilterGroupIndex:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFilterMaskBits   ( Method GetFilterMaskBits:Int(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFixture   ( Method GetFixture:b2Fixture(tmpObj:ftObject, fIndex:Int = 1) )
  • GetFixtureCount   ( Method GetFixtureCount:Int(tmpObj:ftObject) )
  • GetFriction   ( Method GetFriction:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetLastRayCastHit   ( Method GetLastRayCastHit:Float[]() )
  • GetLinearDamping   ( Method GetLinearDamping:Float(tmpObj:ftObject) )
  • GetLinearVelocity   ( Method GetLinearVelocity:float[](tmpObj:ftObject) )
  • GetMassData   ( Method GetMassData:Float[](tmpObj:ftObject) )
  • GetPosition   ( Method GetPosition:Float[](tmpObj:ftObject) )
  • GetRestitution   ( Method GetRestitution:Float(tmpObj:ftObject, fIndex:Int = 1) )
  • GetSensor   ( Method GetSensor:bool(tmpObj:ftObject, fIndex:Int = 1) )
  • GetType   ( Method GetType:Int(tmpObj:ftObject) )
  • InitDebugDraw   ( Method InitDebugDraw:Void() )
  • New   ( Method New(eng:ftEngine) )
  • OnBeginContact   ( Method OnBeginContact:Void (contact:b2Contact) )
  • OnEndContact   ( Method OnEndContact:Void (contact:b2Contact) )
  • OnPostSolve   ( Method OnPostSolve:Void (contact:b2Contact, impulse:b2ContactImpulse) )
  • OnPreSolve   ( Method OnPreSolve:Void (contact:b2Contact, manifold:b2Manifold) )
  • OnRayCast   ( Method OnRayCast:Void (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject) )
  • RayCast   ( Method RayCast:Bool(x1:Float, y1: Float, x2:Float, y2: Float) )
  • RenderDebugDraw   ( Method RenderDebugDraw:Void() )
  • ResetMassData   ( Method ResetMassData:Void(tmpObj:ftObject) )
  • SetActive   ( Method SetActive:Void(tmpObj:ftObject, flag:bool ) )
  • SetAngle   ( Method SetAngle:Void(tmpObj:ftObject, bodyAngle:Float, degree:Bool=True) )
  • SetAngularDamping   ( Method SetAngularDamping:Void(tmpObj:ftObject, damping:Float) )
  • SetAngularVelocity   ( Method SetAngularVelocity:Void(tmpObj:ftObject, velocity:Float, degree:Bool=True) )
  • SetAwake   ( Method SetAwake:Void(tmpObj:ftObject, flag:bool ) )
  • SetBullet   ( Method SetBullet:Void(tmpObj:ftObject, flag:bool ) )
  • SetDensity   ( Method SetDensity:Void(tmpObj:ftObject, density:Float, fIndex:Int = 1) )
  • SetEngine   ( Method SetEngine(eng:ftEngine) )
  • SetFilterCategoryBits   ( Method SetFilterCategoryBits:Void(tmpObj:ftObject, categorybits:Int, fIndex:Int = 1) )
  • SetFilterGroupIndex   ( Method SetFilterGroupIndex:Void(tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1) )
  • SetFilterMaskBits   ( Method SetFilterMaskBits:Void(tmpObj:ftObject, maskbits:Int, fIndex:Int = 1) )
  • SetFixedRotation   ( Method SetFixedRotation:Void(tmpObj:ftObject, flag:bool ) )
  • SetFriction   ( Method SetFriction:Void(tmpObj:ftObject, friction:Float, fIndex:Int = 1) )
  • SetGravity   ( Method SetGravity:Void(gravX:Float, gravY:Float) )
  • SetLinearDamping   ( Method SetLinearDamping:Void(tmpObj:ftObject, damping:Float) )
  • SetLinearVelocity   ( Method SetLinearVelocity:Void(tmpObj:ftObject, vx:Float, vy:Float) )
  • SetMassData   ( Method SetMassData:Void(tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float) )
  • SetPhysicScale   ( Method SetPhysicScale:Void(scale:Float = 30.0) )
  • SetPosition   ( Method SetPosition:Void(tmpObj:ftObject, xpos:Float, ypos:Float) )
  • SetRestitution   ( Method SetRestitution:Void(tmpObj:ftObject, restitution:Float, fIndex:Int = 1) )
  • SetSensor   ( Method SetSensor:Void(tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1) )
  • SetSleepingAllowed   ( Method SetSleepingAllowed:Void(tmpObj:ftObject, flag:Bool ) )
  • SetType   ( Method SetType:Void(tmpObj:ftObject, type:Int) )
  • UpdateObj   ( Method UpdateObj:Void(tmpObj:ftObject ) )
  • UpdateObjAngle   ( Method UpdateObjAngle:Void(tmpObj:ftObject ) )
  • UpdateObjPos   ( Method UpdateObjPos:Void(tmpObj:ftObject ) )
  • UpdateWorld   ( Method UpdateWorld:Void(timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10) )

Method AddPolygon:Void(tmpObj:ftObject, vec:Float[] )

Syntax:


ftBox2D.AddPolygon (tmpObj:ftObject, vec:Float[])
Description:Adds a polygon shape to an existing polygon physics body.
Parameters:
NameTypeValue
tmpObjftObject
vecFloat[]
Method ApplyForce:Void(tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float)

Syntax:


ftBox2D.ApplyForce (tmpObj:ftObject, forceX:Float, forceY:Float, pointX:Float, pointY:Float)
Description:Applies force to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
forceXFloat
forceYFloat
pointXFloat
pointYFloat
Method ApplyImpulse:Void(tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float)

Syntax:


ftBox2D.ApplyImpulse (tmpObj:ftObject, impulseX:Float, impulseY:Float, pointX:Float, pointY:Float)
Description:Applies an impulse to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
impulseXFloat
impulseYFloat
pointXFloat
pointYFloat
Method ApplyTorque:Void(tmpObj:ftObject, torque:Float, degree:Bool=True)

Syntax:


ftBox2D.ApplyTorque (tmpObj:ftObject, torque:Float, degree:Bool=True)
Description:Applies torque to the connected body of a ftObject.
Parameters:
NameTypeValue
tmpObjftObject
torqueFloat
degreeBoolTrue
Method ConnectBody:Void(tmpObj:ftObject, body:b2Body )

Syntax:


ftBox2D.ConnectBody (tmpObj:ftObject, body:b2Body)
Description:Connects the body to an ftObject.
Parameters:
NameTypeValue
tmpObjftObject
bodyb2Body
Method CreateBox:b2Body(width:Float,height:Float, xpos:Float, ypos:float )

Syntax:


b2Body = ftBox2D.CreateBox (width:Float,height:Float, xpos:Float, ypos:float)
Description:Create a box shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposfloat
Method CreateCircle:b2Body(radius:Float, xpos:Float, ypos:float )

Syntax:


b2Body = ftBox2D.CreateCircle (radius:Float, xpos:Float, ypos:float)
Description:Create a circle shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposfloat
Method CreateDistantJoint:b2DistanceJoint(bodyA:b2Body, bodyB:b2Body)

Syntax:


b2DistanceJoint = ftBox2D.CreateDistantJoint (bodyA:b2Body, bodyB:b2Body)
Description:Create a distant joint.
Return type:b2DistanceJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
Method CreateMouseJoint:b2MouseJoint(groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7 )

Syntax:


b2MouseJoint = ftBox2D.CreateMouseJoint (groundBody:b2Body, targetBody:b2Body, targetX:Float, targetY:Float, maxForce:Float, collideConnect:Bool = True, frequencyHz:Float = 5.0, dampingRatio:Float = 0.7)
Description:Create a mouse joint.
Return type:b2MouseJoint
Parameters:
NameTypeValue
groundBodyb2Body
targetBodyb2Body
targetXFloat
targetYFloat
maxForceFloat
collideConnectBoolTrue
frequencyHzFloat5.0
dampingRatioFloat0.7
Method CreateObject:b2Body(tmpObj:ftObject, btype:Int = b2Body.b2_Body )

Syntax:


b2Body = ftBox2D.CreateObject (tmpObj:ftObject, btype:Int = b2Body.b2_Body)
Description:Create a B2Body object based on a ftObject. It will also connect it to the ftObject.
Return type:b2Body
Parameters:
NameTypeValue
tmpObjftObject
btypeIntb2Body.b2_Body
Method CreatePolygon:b2Body(vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body )

Syntax:


b2Body = ftBox2D.CreatePolygon (vec:Float[], xpos:Float, ypos:Float, btype:Int = b2Body.b2_Body)
Description:Create a polygon shaped B2Body object.
Return type:b2Body
Parameters:
NameTypeValue
vecFloat[]
xposFloat
yposFloat
btypeIntb2Body.b2_Body
Method CreatePolygon:b2Body(filename:String, subBodyName:String, xpos:Float, ypos:Float)

Syntax:


b2Body = ftBox2D.CreatePolygon (filename:String, subBodyName:String, xpos:Float, ypos:Float)
Description:Create a polygon shaped B2Body object from a PhysicsEditor compatible json file.
Return type:b2Body
Parameters:
NameTypeValue
filenameString
subBodyNameString
xposFloat
yposFloat
Method CreateRevoluteJoint:b2RevoluteJoint(bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True)

Syntax:


b2RevoluteJoint = ftBox2D.CreateRevoluteJoint (bodyA:b2Body, bodyB:b2Body, startX:Float, startY:Float, lowerAngle:Float, upperAngle:Float, degree:Bool = True)
Description:Create a revolute joint.
Return type:b2RevoluteJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
startXFloat
startYFloat
lowerAngleFloat
upperAngleFloat
degreeBoolTrue
Method CreateRopeJoint:b2RopeJoint(bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True)

Syntax:


b2RopeJoint = ftBox2D.CreateRopeJoint (bodyA:b2Body, bodyB:b2Body, maxDistance:Float, collideConnect:Bool = True)
Description:Create a rope joint.
Return type:b2RopeJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
maxDistanceFloat
collideConnectBoolTrue
Method CreateWeldJoint:b2WeldJoint(bodyA:b2Body, bodyB:b2Body)

Syntax:


b2WeldJoint = ftBox2D.CreateWeldJoint (bodyA:b2Body, bodyB:b2Body)
Description:Create a weld joint.
Return type:b2WeldJoint
Parameters:
NameTypeValue
bodyAb2Body
bodyBb2Body
Method CreateWorld:b2World()

Syntax:


b2World = ftBox2D.CreateWorld ()
Description:Create a B2World object.
Return type:b2World
Method DestroyBody:Void(tmpObj:ftObject )

Syntax:


ftBox2D.DestroyBody (tmpObj:ftObject)
Description:Disconnects and destroys the connected body of an ftObject.
Parameters:
NameTypeValue
tmpObjftObject
Method DestroyJoint:Void(joint:b2Joint )

Syntax:


ftBox2D.DestroyJoint (joint:b2Joint)
Description:Destroys a joint.
Parameters:
NameTypeValue
jointb2Joint
Method GetAngle:Float(tmpObj:ftObject, degree:Bool = True)

Syntax:


Float = ftBox2D.GetAngle (tmpObj:ftObject, degree:Bool = True)
Description:Returns the angle of the connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
degreeBoolTrue
Method GetAngularDamping:Float(tmpObj:ftObject)

Syntax:


Float = ftBox2D.GetAngularDamping (tmpObj:ftObject)
Description:Returns the angular damping of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
Method GetAngularVelocity:Float(tmpObj:ftObject, degree:Bool = True)

Syntax:


Float = ftBox2D.GetAngularVelocity (tmpObj:ftObject, degree:Bool = True)
Description:Returns the angular velocity of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
degreeBoolTrue
Method GetBody:b2Body(tmpObj:ftObject )

Syntax:


b2Body = ftBox2D.GetBody (tmpObj:ftObject)
Description:Returns the connected body of a ftObject.
Return type:b2Body
Parameters:
NameTypeValue
tmpObjftObject
Method GetDensity:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetDensity (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the density of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterCategoryBits:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterCategoryBits (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter category bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterGroupIndex:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterGroupIndex (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter mask bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFilterMaskBits:Int(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Int = ftBox2D.GetFilterMaskBits (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the filter mask bits of the fixture with the given index.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFixture:b2Fixture(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


b2Fixture = ftBox2D.GetFixture (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the fixture of a objects connected body with the given index.
Return type:b2Fixture
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetFixtureCount:Int(tmpObj:ftObject)

Syntax:


Int = ftBox2D.GetFixtureCount (tmpObj:ftObject)
Description:Returns the number of fixtures of a connected body.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
Method GetFriction:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetFriction (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the friction of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetLastRayCastHit:Float[]()

Syntax:


Float[] = ftBox2D.GetLastRayCastHit ()
Description:Returns the postion of the last raycast hit.
Return type:Float[]
Method GetLinearDamping:Float(tmpObj:ftObject)

Syntax:


Float = ftBox2D.GetLinearDamping (tmpObj:ftObject)
Description:Returns the linear damping of a connected body.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
Method GetLinearVelocity:float[](tmpObj:ftObject)

Syntax:


float[] = ftBox2D.GetLinearVelocity (tmpObj:ftObject)
Description:Returns the linear velocity of a connected body.
Return type:float[]
Parameters:
NameTypeValue
tmpObjftObject
Method GetMassData:Float[](tmpObj:ftObject)

Syntax:


Float[] = ftBox2D.GetMassData (tmpObj:ftObject)
Description:Returns the mass data of a connected body.
Return type:Float[]
Parameters:
NameTypeValue
tmpObjftObject
Details:It will return an array with the following float values
  • index #0 -> mass
  • index #1 -> centerX
  • index #2 -> centerY
  • index #3 -> I

Method GetPosition:Float[](tmpObj:ftObject)

Syntax:


Float[] = ftBox2D.GetPosition (tmpObj:ftObject)
Description:Returns the postion of a connected body.
Return type:Float[]
Parameters:
NameTypeValue
tmpObjftObject
Method GetRestitution:Float(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


Float = ftBox2D.GetRestitution (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the restitution of the fixture with the given index.
Return type:Float
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetSensor:bool(tmpObj:ftObject, fIndex:Int = 1)

Syntax:


bool = ftBox2D.GetSensor (tmpObj:ftObject, fIndex:Int = 1)
Description:Returns the sensor flag of the fixture with the given index.
Return type:bool
Parameters:
NameTypeValue
tmpObjftObject
fIndexInt1
Method GetType:Int(tmpObj:ftObject)

Syntax:


Int = ftBox2D.GetType (tmpObj:ftObject)
Description:Returns the type of a connected body.
Return type:Int
Parameters:
NameTypeValue
tmpObjftObject
Method InitDebugDraw:Void()

Syntax:


ftBox2D.InitDebugDraw ()
Description:This method initialized the debug drawing of box2D.
Details:To actually draw it, use the RenderDebugDraw method.
Method New(eng:ftEngine)

Syntax:


none = ftBox2D.New (eng:ftEngine)
Description:This method creates a new box2D instance and connects it with the given ftEngine
Return type:none
Parameters:
NameTypeValue
engftEngine
Method OnBeginContact:Void (contact:b2Contact)

Syntax:


ftBox2D.OnBeginContact (contact:b2Contact)
Description:This callback method is called when a collision contact has begun.
Parameters:
NameTypeValue
contactb2Contact
Method OnEndContact:Void (contact:b2Contact)

Syntax:


ftBox2D.OnEndContact (contact:b2Contact)
Description:This callback method is called when a collision contact has ended.
Parameters:
NameTypeValue
contactb2Contact
Method OnPostSolve:Void (contact:b2Contact, impulse:b2ContactImpulse)

Syntax:


ftBox2D.OnPostSolve (contact:b2Contact, impulse:b2ContactImpulse)
Description:This callback method is called after the collision has been solved.
Parameters:
NameTypeValue
contactb2Contact
impulseb2ContactImpulse
Method OnPreSolve:Void (contact:b2Contact, manifold:b2Manifold)

Syntax:


ftBox2D.OnPreSolve (contact:b2Contact, manifold:b2Manifold)
Description:This callback method is called before the collision has been solved.
Parameters:
NameTypeValue
contactb2Contact
manifoldb2Manifold
Method OnRayCast:Void (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject)

Syntax:


ftBox2D.OnRayCast (rayFraction:Float, rayVec:b2Vec2, hitNormal:b2Vec2, hitPoint:b2Vec2, nextPoint:b2Vec2, fixture:b2Fixture, obj:ftObject)
Description:This callback method is called when a raycast was successful.
Parameters:
NameTypeValue
rayFractionFloat
rayVecb2Vec2
hitNormalb2Vec2
hitPointb2Vec2
nextPointb2Vec2
fixtureb2Fixture
objftObject
Method RayCast:Bool(x1:Float, y1: Float, x2:Float, y2: Float)

Syntax:


Bool = ftBox2D.RayCast (x1:Float, y1: Float, x2:Float, y2: Float)
Description:Cast a ray and returns TRUE if a shape was hit.
Return type:Bool
Parameters:
NameTypeValue
x1Float
y1 Float
x2Float
y2 Float
Details:If a body was hit, the OnRayCast method will be called.
Method RenderDebugDraw:Void()

Syntax:


ftBox2D.RenderDebugDraw ()
Description:Renders the debug information of the box2D world.
Method ResetMassData:Void(tmpObj:ftObject)

Syntax:


ftBox2D.ResetMassData (tmpObj:ftObject)
Description:Resets the mass data of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
Method SetActive:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetActive (tmpObj:ftObject, flag:bool)
Description:Set the active flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetAngle:Void(tmpObj:ftObject, bodyAngle:Float, degree:Bool=True)

Syntax:


ftBox2D.SetAngle (tmpObj:ftObject, bodyAngle:Float, degree:Bool=True)
Description:Set the angle of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
bodyAngleFloat
degreeBoolTrue
Method SetAngularDamping:Void(tmpObj:ftObject, damping:Float)

Syntax:


ftBox2D.SetAngularDamping (tmpObj:ftObject, damping:Float)
Description:Sets the angular damping of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
dampingFloat
Method SetAngularVelocity:Void(tmpObj:ftObject, velocity:Float, degree:Bool=True)

Syntax:


ftBox2D.SetAngularVelocity (tmpObj:ftObject, velocity:Float, degree:Bool=True)
Description:Set the angular velocity of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
velocityFloat
degreeBoolTrue
Method SetAwake:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetAwake (tmpObj:ftObject, flag:bool)
Description:Set the awake flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetBullet:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetBullet (tmpObj:ftObject, flag:bool)
Description:Sets the bullet flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetDensity:Void(tmpObj:ftObject, density:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetDensity (tmpObj:ftObject, density:Float, fIndex:Int = 1)
Description:Sets the density of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
densityFloat
fIndexInt1
Method SetEngine(eng:ftEngine)

Syntax:


none = ftBox2D.SetEngine (eng:ftEngine)
Description:This method connects it with the given ftEngine
Return type:none
Parameters:
NameTypeValue
engftEngine
Method SetFilterCategoryBits:Void(tmpObj:ftObject, categorybits:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterCategoryBits (tmpObj:ftObject, categorybits:Int, fIndex:Int = 1)
Description:Sets the filter category bits of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
categorybitsInt
fIndexInt1
Method SetFilterGroupIndex:Void(tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterGroupIndex (tmpObj:ftObject, groupIndex:Int, fIndex:Int = 1)
Description:Sets the filter group index of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
groupIndexInt
fIndexInt1
Method SetFilterMaskBits:Void(tmpObj:ftObject, maskbits:Int, fIndex:Int = 1)

Syntax:


ftBox2D.SetFilterMaskBits (tmpObj:ftObject, maskbits:Int, fIndex:Int = 1)
Description:Sets the filter mask bits of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
maskbitsInt
fIndexInt1
Method SetFixedRotation:Void(tmpObj:ftObject, flag:bool )

Syntax:


ftBox2D.SetFixedRotation (tmpObj:ftObject, flag:bool)
Description:Sets the fixed rotation flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagbool
Method SetFriction:Void(tmpObj:ftObject, friction:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetFriction (tmpObj:ftObject, friction:Float, fIndex:Int = 1)
Description:Sets the friction of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
frictionFloat
fIndexInt1
Method SetGravity:Void(gravX:Float, gravY:Float)

Syntax:


ftBox2D.SetGravity (gravX:Float, gravY:Float)
Description:Sets the gravity of the world.
Parameters:
NameTypeValue
gravXFloat
gravYFloat
Method SetLinearDamping:Void(tmpObj:ftObject, damping:Float)

Syntax:


ftBox2D.SetLinearDamping (tmpObj:ftObject, damping:Float)
Description:Sets the linear damping of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
dampingFloat
Method SetLinearVelocity:Void(tmpObj:ftObject, vx:Float, vy:Float)

Syntax:


ftBox2D.SetLinearVelocity (tmpObj:ftObject, vx:Float, vy:Float)
Description:Sets the linear velocity of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
vxFloat
vyFloat
Method SetMassData:Void(tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float)

Syntax:


ftBox2D.SetMassData (tmpObj:ftObject, mass:Float, massCenterX:Float, massCenterY:Float, i:Float)
Description:Sets the mass data of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
massFloat
massCenterXFloat
massCenterYFloat
iFloat
Method SetPhysicScale:Void(scale:Float = 30.0)

Syntax:


ftBox2D.SetPhysicScale (scale:Float = 30.0)
Description:Sets the physic scale of the world.
Parameters:
NameTypeValue
scaleFloat30.0
Method SetPosition:Void(tmpObj:ftObject, xpos:Float, ypos:Float)

Syntax:


ftBox2D.SetPosition (tmpObj:ftObject, xpos:Float, ypos:Float)
Description:Sets the position of a connected body and the ftObject itself.
Parameters:
NameTypeValue
tmpObjftObject
xposFloat
yposFloat
Method SetRestitution:Void(tmpObj:ftObject, restitution:Float, fIndex:Int = 1)

Syntax:


ftBox2D.SetRestitution (tmpObj:ftObject, restitution:Float, fIndex:Int = 1)
Description:Sets the restitution of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
restitutionFloat
fIndexInt1
Method SetSensor:Void(tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1)

Syntax:


ftBox2D.SetSensor (tmpObj:ftObject, sensorFlag:Bool, fIndex:Int = 1)
Description:Sets the sensor flag of the fixture with the given index.
Parameters:
NameTypeValue
tmpObjftObject
sensorFlagBool
fIndexInt1
Method SetSleepingAllowed:Void(tmpObj:ftObject, flag:Bool )

Syntax:


ftBox2D.SetSleepingAllowed (tmpObj:ftObject, flag:Bool)
Description:Sets the sleeping allowed flag of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
flagBool
Method SetType:Void(tmpObj:ftObject, type:Int)

Syntax:


ftBox2D.SetType (tmpObj:ftObject, type:Int)
Description:Sets the type of a connected body.
Parameters:
NameTypeValue
tmpObjftObject
typeInt
Method UpdateObj:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObj (tmpObj:ftObject)
Description:Updates a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Details:It will update ist position and angle.
Method UpdateObjAngle:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObjAngle (tmpObj:ftObject)
Description:Updates the angle of a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Method UpdateObjPos:Void(tmpObj:ftObject )

Syntax:


ftBox2D.UpdateObjPos (tmpObj:ftObject)
Description:Updates the position of a ftObject regarding its connected Box2D body.
Parameters:
NameTypeValue
tmpObjftObject
Method UpdateWorld:Void(timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10)

Syntax:


ftBox2D.UpdateWorld (timeStep:Float=1.0/60.0, velocityIterations:Int = 10, positionIterations:Int= 10)
Description:Updates the physical simulation of the box2D world.
Parameters:
NameTypeValue
timeStepFloat1.0/60.0
velocityIterationsInt10
positionIterationsInt10
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftEngine.monkey.html b/docs/cftEngine.monkey.html index f7dc10b..fa607e4 100644 --- a/docs/cftEngine.monkey.html +++ b/docs/cftEngine.monkey.html @@ -8,15 +8,15 @@ fantomEngine.cftEngine -

Module fantomEngine.cftEngine


The module cftEngine contains the ftEngine class, which is the main part of the fantomEngine.

Table of contents:

Classes:

Class ftEngine
Changes:Fixed in v1.56
Description:The class ftEngine is the heart of the fantomEngine. After you have created one instance of it, you can let it deal with scenes, layers, objects and all the stuff a game needs.
Table of contents:Methods:
  • ActivateMusic   ( Method ActivateMusic:Void(onOff:Bool=True) )
  • ActivateSound   ( Method ActivateSound:Void(onOff:Bool=True) )
  • ActivateSwipe   ( Method ActivateSwipe:Void(onOff:Bool=True) )
  • CalcDeltaTime   ( Method CalcDeltaTime:Int() )
  • CancelTimerAll   ( Method CancelTimerAll:Void() )
  • CollisionCheck   ( Method CollisionCheck:Void() )
  • CollisionCheck   ( Method CollisionCheck:Void(layer:ftLayer) )
  • CollisionCheck   ( Method CollisionCheck:Void(obj:ftObject) )
  • CopyObject   ( Method CopyObject:ftObject(srcObj:ftObject) )
  • CreateAnimImage   ( Method CreateAnimImage:ftObject(atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateAnimImage   ( Method CreateAnimImage:ftObject(atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateBox   ( Method CreateBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateCircle   ( Method CreateCircle:ftObject(radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateGUI   ( Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0) )   New in v1.57
  • CreateImage   ( Method CreateImage:ftObject(filename:String, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fxied in v1.57
  • CreateImage   ( Method CreateImage:ftObject(image:Image, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateLayer   ( Method CreateLayer:ftLayer(_ucla:Object=Null) )
  • CreateLine   ( Method CreateLine:ftObject(xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateObjTimer   ( Method CreateObjTimer:ftTimer(obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateOval   ( Method CreateOval:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePath   ( Method CreatePath:ftPath(xpos:Float, ypos:Float ) )
  • CreatePivot   ( Method CreatePivot:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePoint   ( Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePoly   ( Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateScene   ( Method CreateScene:ftScene(_ucSc:Object=Null) )
  • CreateSpriteAtlas   ( Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string) )   New in v1.55
  • CreateStickMan   ( Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateText   ( Method CreateText:ftObject(font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null) )   Changed in v1.56
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )   Changed in v1.56 to support multiple tilesets
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )   Fixed in v1.57
  • CreateTileMap   ( Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 ) )   Changed in v1.56 to support multiple tilesets
  • CreateTimer   ( Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateZoneBox   ( Method CreateZoneBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float) )
  • CreateZoneCircle   ( Method CreateZoneCircle:ftObject(radius:Float, xpos:Float, ypos:Float) )
  • ExitApp   ( Method ExitApp:Int(retCode:Int=0) )
  • GetAccelX   ( Method GetAccelX:Float() )
  • GetAccelXY   ( Method GetAccelXY:Float[]() )
  • GetAccelY   ( Method GetAccelY:Float() )
  • GetAccelZ   ( Method GetAccelZ:Float() )
  • GetCam   ( Method GetCam:Float[] () )   New in version 1.56
  • GetCamX   ( Method GetCamX:Float () )   New in version 1.56
  • GetCamY   ( Method GetCamY:Float () )   New in version 1.56
  • GetCanvasHeight   ( Method GetCanvasHeight:Int() )
  • GetCanvasWidth   ( Method GetCanvasWidth:Int() )
  • GetDefaultLayer   ( Method GetDefaultLayer:ftLayer() )
  • GetDefaultScene   ( Method GetDefaultScene:ftScene() )
  • GetDeltaTime   ( Method GetDeltaTime:Int() )
  • GetFPS   ( Method GetFPS:Int() )
  • GetLocalX   ( Method GetLocalX:Float(wordXPos:Float, withCam:Bool = True) )   New in v1.55
  • GetLocalXY   ( Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetLocalY   ( Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetObjCount   ( Method GetObjCount:Int(type:Int = 0) )
  • GetPause   ( Method GetPause:Bool() )   Depreciated in version 1.51. Use GetPaused instead.
  • GetPaused   ( Method GetPaused:Bool() )
  • GetScaleX   ( Method GetScaleX:Float() )
  • GetScaleY   ( Method GetScaleY:Float() )
  • GetTime   ( Method GetTime:Int() )
  • GetTimeScale   ( Method GetTimeScale:Float() )
  • GetTouchX   ( Method GetTouchX:Float(index:Int=0) )
  • GetTouchXY   ( Method GetTouchXY:Float[](index:Int=0) )
  • GetTouchY   ( Method GetTouchY:Float(index:Int=0) )
  • GetVolumeMUS   ( Method GetVolumeMUS:Float() )
  • GetVolumeSFX   ( Method GetVolumeSFX:Float() )
  • GetWorldX   ( Method GetWorldX:Float(localXPos:Float, withCam:Bool = True) )   New in v1.55
  • GetWorldXY   ( Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetWorldY   ( Method GetWorldY:Float(localYPos:Float, withCam:Bool = True) )   New in v1.55
  • LoadFont   ( Method LoadFont:ftFont(filename:String) )   Added support for FontMachine in v1.54.
  • LoadImage   ( Method LoadImage:Image(path:String, frameCount:Int=1, flags:Int=Image.MidHandle) )   Changed in v1.55 to use Image.MidHandle as the default flag.
  • LoadImage   ( Method LoadImage:Image(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle) )   Changed in v1.55 to use Image.MidHandle as the default flag.
  • LoadMusic   ( Method LoadMusic:ftSound(filename:String, loopFlag:Bool=False) )
  • LoadSound   ( Method LoadSound:ftSound(filename:String, loopFlag:Bool=False) )
  • New   ( Method New() )   Fixed in version 1.57
  • OnLayerTransition   ( Method OnLayerTransition:Int(transId:Int, layer:ftLayer) )
  • OnLayerUpdate   ( Method OnLayerUpdate:Int(layer:ftLayer) )
  • OnMarkerBounce   ( Method OnMarkerBounce:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerCircle   ( Method OnMarkerCircle:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerStop   ( Method OnMarkerStop:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerWP   ( Method OnMarkerWP:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerWarp   ( Method OnMarkerWarp:Int(marker:ftMarker, obj:ftObject) )
  • OnObjectAnim   ( Method OnObjectAnim:Int(obj:ftObject) )   New in version 1.54
  • OnObjectCollision   ( Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject) )
  • OnObjectDelete   ( Method OnObjectDelete:Int(obj:ftObject) )
  • OnObjectRender   ( Method OnObjectRender:Int(obj:ftObject) )
  • OnObjectSort   ( Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject) )
  • OnObjectTimer   ( Method OnObjectTimer:Int(timerId:Int, obj:ftObject) )
  • OnObjectTouch   ( Method OnObjectTouch:Int(obj:ftObject, touchId:Int) )
  • OnObjectTransition   ( Method OnObjectTransition:Int(transId:Int, obj:ftObject) )
  • OnObjectUpdate   ( Method OnObjectUpdate:Int(obj:ftObject) )
  • OnSwipeDone   ( Method OnSwipeDone:Int(touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float) )
  • OnTimer   ( Method OnTimer:Int(timerId:Int) )
  • ReLoadAllImages   ( Method ReLoadAllImages:Void() )
  • RemoveAllImages   ( Method RemoveAllImages:Void(discard:Bool = False) )
  • RemoveAllLayer   ( Method RemoveAllLayer:Void() )
  • RemoveAllObjects   ( Method RemoveAllObjects:Void() )
  • RemoveAllScenes   ( Method RemoveAllScenes:Void() )
  • RemoveImage   ( Method RemoveImage:Void(image:Image, discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(filepath:String, discard:Bool = False) )
  • RemoveLayer   ( Method RemoveLayer:Void(layer:ftLayer) )
  • RemoveScene   ( Method RemoveScene:Void(scene:ftScene) )
  • Render   ( Method Render:Void() )
  • Render   ( Method Render:Void(layer:ftLayer) )
  • RenderLoadingBar   ( Method RenderLoadingBar:Void() )
  • RestoreAlpha   ( Method RestoreAlpha:Void() )
  • RestoreBlendmode   ( Method RestoreBlendmode:Void() )
  • RestoreColor   ( Method RestoreColor:Void() )
  • SetCam   ( Method SetCam:Void (x:Float, y:Float, relative:Int = False ) )
  • SetCamX   ( Method SetCamX:Void (x:Float, relative:Int = False ) )
  • SetCamY   ( Method SetCamY:Void (y:Float, relative:Int = False ) )
  • SetCanvasSize   ( Method SetCanvasSize:Void(width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox) )
  • SetDefaultActive   ( Method SetDefaultActive:Void(active:Bool) )
  • SetDefaultLayer   ( Method SetDefaultLayer:Void(layer:ftLayer) )
  • SetDefaultScene   ( Method SetDefaultScene:Void(scene:ftScene) )
  • SetDefaultVisible   ( Method SetDefaultVisible:Void(visible:Bool) )
  • SetFirstSoundChannel   ( Method SetFirstSoundChannel:Void(firstChannel:Int = 0) )
  • SetMaxSoundChannel   ( Method SetMaxSoundChannel:Void(maxChannel:Int = 32) )
  • SetPause   ( Method SetPause:Void(pauseFlag:Bool) )   Depreciated in version 1.51. Use SetPaused instead.
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool) )
  • SetSwipeDeadDist   ( Method SetSwipeDeadDist:Void(deadDist:Float = 20.0) )
  • SetSwipeSnap   ( Method SetSwipeSnap:Void(degrees:Int=1) )
  • SetTimeScale   ( Method SetTimeScale:Void(timescale:Float = 1.0) )
  • SetVolumeMUS   ( Method SetVolumeMUS:Void(volume:Float = 1.0) )
  • SetVolumeSFX   ( Method SetVolumeSFX:Void(volume:Float = 1.0) )
  • SortObjects   ( Method SortObjects:Void() )
  • SortObjects   ( Method SortObjects:Void(layer:ftLayer) )
  • SwipeUpdate   ( Method SwipeUpdate:Void(index:Int = 0) )
  • TouchCheck   ( Method TouchCheck:Void(touchID:Int=0) )   Changed in v1.56
  • TouchCheck   ( Method TouchCheck:Void(layer:ftLayer, touchID:Int=0) )
  • Update   ( Method Update:Void(speed:Float=1.0) )
  • Update   ( Method Update:Void(layer:ftLayer, speed:Float=1.0) )

Constants:

Method ActivateMusic:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateMusic (onOff:Bool=True)
Description:De-/activates the music playback for the engine.
Parameters:
NameTypeValue
onOffBoolTrue
Example:
Local myEngine = New ftEngine
-myEngine.ActivateMusic(True)
Method ActivateSound:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateSound (onOff:Bool=True)
Description:De-/activates the sound playback for the engine.
Parameters:
NameTypeValue
onOffBoolTrue
Example:
Local myEngine = New ftEngine
+

Module fantomEngine.cftEngine


The module cftEngine contains the ftEngine class, which is the main part of the fantomEngine.

Table of contents:

Classes:

Class ftEngine
Changes:Fixed in v1.56
Description:The class ftEngine is the heart of the fantomEngine. After you have created one instance of it, you can let it deal with scenes, layers, objects and all the stuff a game needs.
Table of contents:Methods:
  • ActivateMusic   ( Method ActivateMusic:Void(onOff:Bool=True) )
  • ActivateSound   ( Method ActivateSound:Void(onOff:Bool=True) )
  • ActivateSwipe   ( Method ActivateSwipe:Void(onOff:Bool=True) )
  • CalcDeltaTime   ( Method CalcDeltaTime:Int() )
  • CancelTimerAll   ( Method CancelTimerAll:Void() )
  • CollisionCheck   ( Method CollisionCheck:Void() )
  • CollisionCheck   ( Method CollisionCheck:Void(layer:ftLayer) )
  • CollisionCheck   ( Method CollisionCheck:Void(obj:ftObject) )
  • CopyObject   ( Method CopyObject:ftObject(srcObj:ftObject) )
  • CreateAnimImage   ( Method CreateAnimImage:ftObject(atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateAnimImage   ( Method CreateAnimImage:ftObject(atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateBox   ( Method CreateBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateCircle   ( Method CreateCircle:ftObject(radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateGUI   ( Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0) )   New in v1.57
  • CreateImage   ( Method CreateImage:ftObject(filename:String, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fxied in v1.57
  • CreateImage   ( Method CreateImage:ftObject(image:Image, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null) )   Fixed in v1.57
  • CreateLayer   ( Method CreateLayer:ftLayer(_ucla:Object=Null) )
  • CreateLine   ( Method CreateLine:ftObject(xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateObjTimer   ( Method CreateObjTimer:ftTimer(obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateOval   ( Method CreateOval:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePath   ( Method CreatePath:ftPath(xpos:Float, ypos:Float ) )
  • CreatePivot   ( Method CreatePivot:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePoint   ( Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreatePoly   ( Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateScene   ( Method CreateScene:ftScene(_ucSc:Object=Null) )
  • CreateSpriteAtlas   ( Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string) )   New in v1.55
  • CreateStickMan   ( Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )   Changed in v1.56
  • CreateText   ( Method CreateText:ftObject(font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null) )   Changed in v1.56
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )   Changed in v1.56 to support multiple tilesets
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )   Fixed in v1.57
  • CreateTileMap   ( Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 ) )   Changed in v1.56 to support multiple tilesets
  • CreateTimer   ( Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateZoneBox   ( Method CreateZoneBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float) )
  • CreateZoneCircle   ( Method CreateZoneCircle:ftObject(radius:Float, xpos:Float, ypos:Float) )
  • ExitApp   ( Method ExitApp:Int(retCode:Int=0) )
  • GetAccelX   ( Method GetAccelX:Float() )
  • GetAccelXY   ( Method GetAccelXY:Float[]() )
  • GetAccelY   ( Method GetAccelY:Float() )
  • GetAccelZ   ( Method GetAccelZ:Float() )
  • GetCam   ( Method GetCam:Float[] () )   New in version 1.56
  • GetCamX   ( Method GetCamX:Float () )   New in version 1.56
  • GetCamY   ( Method GetCamY:Float () )   New in version 1.56
  • GetCanvasHeight   ( Method GetCanvasHeight:Int() )
  • GetCanvasWidth   ( Method GetCanvasWidth:Int() )
  • GetDefaultLayer   ( Method GetDefaultLayer:ftLayer() )
  • GetDefaultScene   ( Method GetDefaultScene:ftScene() )
  • GetDeltaTime   ( Method GetDeltaTime:Int() )
  • GetFPS   ( Method GetFPS:Int() )
  • GetLocalX   ( Method GetLocalX:Float(wordXPos:Float, withCam:Bool = True) )   New in v1.55
  • GetLocalXY   ( Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetLocalY   ( Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetObjCount   ( Method GetObjCount:Int(type:Int = 0) )
  • GetPause   ( Method GetPause:Bool() )   Depreciated in version 1.51. Use GetPaused instead.
  • GetPaused   ( Method GetPaused:Bool() )
  • GetScaleX   ( Method GetScaleX:Float() )
  • GetScaleY   ( Method GetScaleY:Float() )
  • GetTime   ( Method GetTime:Int() )
  • GetTimeScale   ( Method GetTimeScale:Float() )
  • GetTouchX   ( Method GetTouchX:Float(index:Int=0) )
  • GetTouchXY   ( Method GetTouchXY:Float[](index:Int=0) )
  • GetTouchY   ( Method GetTouchY:Float(index:Int=0) )
  • GetVolumeMUS   ( Method GetVolumeMUS:Float() )
  • GetVolumeSFX   ( Method GetVolumeSFX:Float() )
  • GetWorldX   ( Method GetWorldX:Float(localXPos:Float, withCam:Bool = True) )   New in v1.55
  • GetWorldXY   ( Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True) )   New in v1.55
  • GetWorldY   ( Method GetWorldY:Float(localYPos:Float, withCam:Bool = True) )   New in v1.55
  • LoadFont   ( Method LoadFont:ftFont(filename:String) )   Added support for FontMachine in v1.54.
  • LoadImage   ( Method LoadImage:Image(path:String, frameCount:Int=1, flags:Int=Image.MidHandle) )   Changed in v1.55 to use Image.MidHandle as the default flag.
  • LoadImage   ( Method LoadImage:Image(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle) )   Changed in v1.55 to use Image.MidHandle as the default flag.
  • LoadMusic   ( Method LoadMusic:ftSound(filename:String, loopFlag:Bool=False) )
  • LoadSound   ( Method LoadSound:ftSound(filename:String, loopFlag:Bool=False) )
  • New   ( Method New() )   Fixed in version 1.57
  • OnLayerTransition   ( Method OnLayerTransition:Int(transId:Int, layer:ftLayer) )
  • OnLayerUpdate   ( Method OnLayerUpdate:Int(layer:ftLayer) )
  • OnMarkerBounce   ( Method OnMarkerBounce:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerCircle   ( Method OnMarkerCircle:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerStop   ( Method OnMarkerStop:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerWP   ( Method OnMarkerWP:Int(marker:ftMarker, obj:ftObject) )
  • OnMarkerWarp   ( Method OnMarkerWarp:Int(marker:ftMarker, obj:ftObject) )
  • OnObjectAnim   ( Method OnObjectAnim:Int(obj:ftObject) )   New in version 1.54
  • OnObjectCollision   ( Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject) )
  • OnObjectDelete   ( Method OnObjectDelete:Int(obj:ftObject) )
  • OnObjectRender   ( Method OnObjectRender:Int(obj:ftObject) )
  • OnObjectSort   ( Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject) )
  • OnObjectTimer   ( Method OnObjectTimer:Int(timerId:Int, obj:ftObject) )
  • OnObjectTouch   ( Method OnObjectTouch:Int(obj:ftObject, touchId:Int) )
  • OnObjectTransition   ( Method OnObjectTransition:Int(transId:Int, obj:ftObject) )
  • OnObjectUpdate   ( Method OnObjectUpdate:Int(obj:ftObject) )
  • OnSwipeDone   ( Method OnSwipeDone:Int(touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float) )
  • OnTimer   ( Method OnTimer:Int(timerId:Int) )
  • ReLoadAllImages   ( Method ReLoadAllImages:Void() )
  • RemoveAllImages   ( Method RemoveAllImages:Void(discard:Bool = False) )
  • RemoveAllLayer   ( Method RemoveAllLayer:Void() )
  • RemoveAllObjects   ( Method RemoveAllObjects:Void() )
  • RemoveAllScenes   ( Method RemoveAllScenes:Void() )
  • RemoveImage   ( Method RemoveImage:Void(image:Image, discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(filepath:String, discard:Bool = False) )
  • RemoveLayer   ( Method RemoveLayer:Void(layer:ftLayer) )
  • RemoveScene   ( Method RemoveScene:Void(scene:ftScene) )
  • Render   ( Method Render:Void() )
  • Render   ( Method Render:Void(layer:ftLayer) )
  • RenderLoadingBar   ( Method RenderLoadingBar:Void() )
  • RestoreAlpha   ( Method RestoreAlpha:Void() )
  • RestoreBlendmode   ( Method RestoreBlendmode:Void() )
  • RestoreColor   ( Method RestoreColor:Void() )
  • SetCam   ( Method SetCam:Void (x:Float, y:Float, relative:Int = False ) )
  • SetCamX   ( Method SetCamX:Void (x:Float, relative:Int = False ) )
  • SetCamY   ( Method SetCamY:Void (y:Float, relative:Int = False ) )
  • SetCanvasSize   ( Method SetCanvasSize:Void(width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox) )
  • SetDefaultActive   ( Method SetDefaultActive:Void(active:Bool) )
  • SetDefaultLayer   ( Method SetDefaultLayer:Void(layer:ftLayer) )
  • SetDefaultScene   ( Method SetDefaultScene:Void(scene:ftScene) )
  • SetDefaultVisible   ( Method SetDefaultVisible:Void(visible:Bool) )
  • SetFirstSoundChannel   ( Method SetFirstSoundChannel:Void(firstChannel:Int = 0) )
  • SetMaxSoundChannel   ( Method SetMaxSoundChannel:Void(maxChannel:Int = 32) )
  • SetPause   ( Method SetPause:Void(pauseFlag:Bool) )   Depreciated in version 1.51. Use SetPaused instead.
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool) )
  • SetSwipeDeadDist   ( Method SetSwipeDeadDist:Void(deadDist:Float = 20.0) )
  • SetSwipeSnap   ( Method SetSwipeSnap:Void(degrees:Int=1) )
  • SetTimeScale   ( Method SetTimeScale:Void(timescale:Float = 1.0) )
  • SetVolumeMUS   ( Method SetVolumeMUS:Void(volume:Float = 1.0) )
  • SetVolumeSFX   ( Method SetVolumeSFX:Void(volume:Float = 1.0) )
  • SortObjects   ( Method SortObjects:Void() )
  • SortObjects   ( Method SortObjects:Void(layer:ftLayer) )
  • SwipeUpdate   ( Method SwipeUpdate:Void(index:Int = 0) )
  • TouchCheck   ( Method TouchCheck:Void(touchID:Int=0) )   Changed in v1.56
  • TouchCheck   ( Method TouchCheck:Void(layer:ftLayer, touchID:Int=0) )
  • Update   ( Method Update:Void(speed:Float=1.0) )
  • Update   ( Method Update:Void(layer:ftLayer, speed:Float=1.0) )

Constants:

Method ActivateMusic:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateMusic (onOff:Bool=True)
Description:De-/activates the music playback for the engine.
Parameters:
NameTypeValue
onOffBoolTrue
Example:
Local myEngine = New ftEngine
+myEngine.ActivateMusic(True)
Method ActivateSound:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateSound (onOff:Bool=True)
Description:De-/activates the sound playback for the engine.
Parameters:
NameTypeValue
onOffBoolTrue
Example:
Local myEngine = New ftEngine
 ' Now deactivate all sound playback
-myEngine.ActivateSound(False)
Method ActivateSwipe:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateSwipe (onOff:Bool=True)
Description:Activates swipe gesture detection.
Parameters:
NameTypeValue
onOffBoolTrue
Details:To (de)activate the swipe detection, use ActivateSwipe. To detect(update) a swipe, use SwipeUpdate. If a swipe is detected, fantomEngine will call its OnSwipeDone method.
Also have a look at the sample script SwipeDetection.monkey
Example:
Local myEngine = New ftEngine
-myEngine.ActivateSwipe(True)
Method CalcDeltaTime:Int()

Syntax:


Int = ftEngine.CalcDeltaTime ()
Description:Returns the delta time in milliseconds since the last call.
Return type:Int
Details:Calculates the current delta time in milliseconds since the last call of this command.
Usually you call this command during the OnUpdate event of your app. If you just need to retrieve the delta time and not recalculate it, use GetDeltaTime.
Example:
Method OnUpdate:Int()
+myEngine.ActivateSound(False)
Method ActivateSwipe:Void(onOff:Bool=True)

Syntax:


ftEngine.ActivateSwipe (onOff:Bool=True)
Description:Activates swipe gesture detection.
Parameters:
NameTypeValue
onOffBoolTrue
Details:To (de)activate the swipe detection, use ActivateSwipe. To detect(update) a swipe, use SwipeUpdate. If a swipe is detected, fantomEngine will call its OnSwipeDone method.
Also have a look at the sample script SwipeDetection.monkey
Example:
Local myEngine = New ftEngine
+myEngine.ActivateSwipe(True)
Method CalcDeltaTime:Int()

Syntax:


Int = ftEngine.CalcDeltaTime ()
Description:Returns the delta time in milliseconds since the last call.
Return type:Int
Details:Calculates the current delta time in milliseconds since the last call of this command.
Usually you call this command during the OnUpdate event of your app. If you just need to retrieve the delta time and not recalculate it, use GetDeltaTime.
Example:
Method OnUpdate:Int()
   Local delta:Float = Float(myEngine.CalcDeltaTime())/60.0
   myEngine.Update(delta)
   Return 0
-End
Method CancelTimerAll:Void()

Syntax:


ftEngine.CancelTimerAll ()
Description:Cancels all timers attached of the engine.
Method CollisionCheck:Void()

Syntax:


ftEngine.CollisionCheck ()
Description:Does a collision check over all layers and active objects which has a collision group assigned to them.
Details:To check for collisions via the build-in functionality, use CollisionCheck. Without a parameter, it will check all active objects for collisions.
Typically you do this inside mojos' OnUpdate method. If a collision appears, it will call the ftEngine.onObjectCollision method with the two objects as parameters.
Objects that will be part of a collision need to have a collision group with [ftObject.SetColGroup SetColGroup] assigned to them.
The objects that then will need to be checked have to be told with which collision group the can collide. You do that with [ftObject.SetColWith SetColWith].
Example:
Method OnUpdate:Int()
+End
Method CancelTimerAll:Void()

Syntax:


ftEngine.CancelTimerAll ()
Description:Cancels all timers attached of the engine.
Method CollisionCheck:Void()

Syntax:


ftEngine.CollisionCheck ()
Description:Does a collision check over all layers and active objects which has a collision group assigned to them.
Details:To check for collisions via the build-in functionality, use CollisionCheck. Without a parameter, it will check all active objects for collisions.
Typically you do this inside mojos' OnUpdate method. If a collision appears, it will call the ftEngine.onObjectCollision method with the two objects as parameters.
Objects that will be part of a collision need to have a collision group with [ftObject.SetColGroup SetColGroup] assigned to them.
The objects that then will need to be checked have to be told with which collision group the can collide. You do that with [ftObject.SetColWith SetColWith].
Example:
Method OnUpdate:Int()
         'Determine the delta time and a update factor for the engines next update
         Local d:Float = Float(eng.CalcDeltaTime())/60.0
         'Update all objects in the engine
@@ -24,7 +24,7 @@ 

Module fantomEngine.cftEngine

Method CollisionCheck:Void(layer:ftLayer)

Syntax:


ftEngine.CollisionCheck (layer:ftLayer)
Description:Does a collision check of the given layer and it's active objects which has a collision group assigned to them.
Parameters:
NameTypeValue
layerftLayer
Example:
Method OnUpdate:Int()
+End
Method CollisionCheck:Void(layer:ftLayer)

Syntax:


ftEngine.CollisionCheck (layer:ftLayer)
Description:Does a collision check of the given layer and it's active objects which has a collision group assigned to them.
Parameters:
NameTypeValue
layerftLayer
Example:
Method OnUpdate:Int()
         'Determine the delta time and a update factor for the engines next update
         Local d:Float = Float(eng.CalcDeltaTime())/60.0
         'Update all objects in the engine
@@ -32,7 +32,7 @@ 

Module fantomEngine.cftEngine

Method CollisionCheck:Void(obj:ftObject)

Syntax:


ftEngine.CollisionCheck (obj:ftObject)
Description:Does a collision check of the given active object.
Parameters:
NameTypeValue
objftObject
Example:
Method OnUpdate:Int()
+End
Method CollisionCheck:Void(obj:ftObject)

Syntax:


ftEngine.CollisionCheck (obj:ftObject)
Description:Does a collision check of the given active object.
Parameters:
NameTypeValue
objftObject
Example:
Method OnUpdate:Int()
         'Determine the delta time and a update factor for the engines next update
         Local d:Float = Float(eng.CalcDeltaTime())/60.0
         'Update all objects in the engine
@@ -40,11 +40,11 @@ 

Module fantomEngine.cftEngine

Method CopyObject:ftObject(srcObj:ftObject)

Syntax:


ftObject = ftEngine.CopyObject (srcObj:ftObject)
Description:Copies an existing object.
Return type:ftObject
Parameters:
NameTypeValue
srcObjftObject
Details:This command copies a given object and returns the copy. The new object contains all properties of the source object, but not the following:
  • user data object
  • box2D object
  • path marker
  • timer
  • transitions
  • tileMaps

Example:
' Create the 1st object in the middle of the screen
+End
Method CopyObject:ftObject(srcObj:ftObject)

Syntax:


ftObject = ftEngine.CopyObject (srcObj:ftObject)
Description:Copies an existing object.
Return type:ftObject
Parameters:
NameTypeValue
srcObjftObject
Details:This command copies a given object and returns the copy. The new object contains all properties of the source object, but not the following:
  • user data object
  • box2D object
  • path marker
  • timer
  • transitions
  • tileMaps

Example:
' Create the 1st object in the middle of the screen
 Local obj1 := eng.CreateBox(20, 20, cw/2, ch/2 )
 
 ' Copy the 1st object, which creates the 2nd object
-Local obj2 := eng.CopyObject(obj1)
Method CreateAnimImage:ftObject(atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateAnimImage (atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos.
Return type:ftObject
Parameters:
NameTypeValue
atlftImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
xposFloat
yposFloat
_ucobObjectNull
Details:The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount.
It creates a DEFAULT animation automatically.
Example:
Method OnCreate:Int()
+Local obj2 := eng.CopyObject(obj1)
Method CreateAnimImage:ftObject(atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateAnimImage (atl:ftImage, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos.
Return type:ftObject
Parameters:
NameTypeValue
atlftImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
xposFloat
yposFloat
_ucobObjectNull
Details:The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount.
It creates a DEFAULT animation automatically.
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -55,7 +55,7 @@ 

Module fantomEngine.cftEngine

Method CreateAnimImage:ftObject(atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateAnimImage (atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos.
Return type:ftObject
Parameters:
NameTypeValue
atlImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
xposFloat
yposFloat
_ucobObjectNull
Details:The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount.
It creates a DEFAULT animation automatically.
Example:
Method OnCreate:Int()
+End
Method CreateAnimImage:ftObject(atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateAnimImage (atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos.
Return type:ftObject
Parameters:
NameTypeValue
atlImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
xposFloat
yposFloat
_ucobObjectNull
Details:The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount.
It creates a DEFAULT animation automatically.
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -66,21 +66,21 @@ 

Module fantomEngine.cftEngine

Method CreateBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateBox (width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a rectangle with the given width/height and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
+End
Method CreateBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateBox (width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a rectangle with the given width/height and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
         'Create the instance of the engine
         Local eng:ftEngine = New ftEngine
 
         ' Create now the object
         Local box:ftObject = eng.CreateBox(20, 100, 320, 240)
         Return 0
-End
Method CreateCircle:ftObject(radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateCircle (radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a circle with the given radius and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
+End
Method CreateCircle:ftObject(radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateCircle (radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a circle with the given radius and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
         'Create the instance of the engine
         Local eng:ftEngine = New ftEngine
 
         ' Create now the object
         Local circle:ftObject = eng.CreateCircle(100, 320, 240)
         Return 0
-End
Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0)

Syntax:


ftGuiMng = ftEngine.CreateGUI (xpos:Float=0.0, ypos:Float=0.0)
Changes:New in v1.57
Description:Creates an custom GUI manager object which you can use to GUI child objects to.
Return type:ftGuiMng
Parameters:
NameTypeValue
xposFloat0.0
yposFloat0.0
Method CreateImage:ftObject(filename:String, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (filename:String, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fxied in v1.57
Description:Creates an image object (sprite) from the given filename with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
filenameString
xposFloat
yposFloat
_ucobObjectNull
Details:To load an animated image object, use CreateAnimImage.
Example:
Method OnCreate:Int()
+End
Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0)

Syntax:


ftGuiMng = ftEngine.CreateGUI (xpos:Float=0.0, ypos:Float=0.0)
Changes:New in v1.57
Description:Creates an custom GUI manager object which you can use to GUI child objects to.
Return type:ftGuiMng
Parameters:
NameTypeValue
xposFloat0.0
yposFloat0.0
Method CreateImage:ftObject(filename:String, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (filename:String, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fxied in v1.57
Description:Creates an image object (sprite) from the given filename with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
filenameString
xposFloat
yposFloat
_ucobObjectNull
Details:To load an animated image object, use CreateAnimImage.
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -98,7 +98,7 @@ 

Module fantomEngine.cftEngine

Method CreateImage:ftObject(image:Image, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (image:Image, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an image object (sprite) from the given image with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
imageImage
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
+End
Method CreateImage:ftObject(image:Image, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (image:Image, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an image object (sprite) from the given image with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
imageImage
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -116,7 +116,7 @@ 

Module fantomEngine.cftEngine

Method CreateImage:ftObject(atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an image object (sprite) from the given sprite atlas with a center at xPos/yPos. The texture will be grabbed from x/y with the given width/height.
Return type:ftObject
Parameters:
NameTypeValue
atlasImage
xInt
yInt
widthInt
heightInt
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
+End
Method CreateImage:ftObject(atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Creates an image object (sprite) from the given sprite atlas with a center at xPos/yPos. The texture will be grabbed from x/y with the given width/height.
Return type:ftObject
Parameters:
NameTypeValue
atlasImage
xInt
yInt
widthInt
heightInt
xposFloat
yposFloat
_ucobObjectNull
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -134,7 +134,7 @@ 

Module fantomEngine.cftEngine

Method CreateImage:ftObject(atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Loads a subimage from a packed texture created by the tool TexturePacker with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
atlasImage
dataFileNameString
subImageNameString
xposFloat
yposFloat
_ucobObjectNull
Details:It supports rotated sub images in LibGDX files too.
From version 1.52 on it supports Sparrow compatible files (.xml).
Example:
Method OnCreate:Int()
+End
Method CreateImage:ftObject(atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateImage (atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Fixed in v1.57
Description:Loads a subimage from a packed texture created by the tool TexturePacker with a center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
atlasImage
dataFileNameString
subImageNameString
xposFloat
yposFloat
_ucobObjectNull
Details:It supports rotated sub images in LibGDX files too.
From version 1.52 on it supports Sparrow compatible files (.xml).
Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -152,11 +152,11 @@ 

Module fantomEngine.cftEngine

Method CreateLayer:ftLayer(_ucla:Object=Null)

Syntax:


ftLayer = ftEngine.CreateLayer (_ucla:Object=Null)
Description:Creates a new layer.
Return type:ftLayer
Parameters:
NameTypeValue
_uclaObjectNull
Details:To create a new layer, use CreateLayer. To delete a layer, use RemoveLayer. A new layer is automatically added to the defaultScene scene.
Example:
Local myEngine:ftEngine = New ftEngine
-Local myLayer:ftLayer = myEngine.CreateLayer()
Method CreateLine:ftObject(xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateLine (xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a line object starting at xpos/ypos and ending at x/y.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
x2Float
y2Float
_ucobObjectNull
Details:The objects handle is in the middle of the line by default and can be changed via a call to ftObject.SetHandle.
Example:
Local myEngine = New ftEngine
+End
Method CreateLayer:ftLayer(_ucla:Object=Null)

Syntax:


ftLayer = ftEngine.CreateLayer (_ucla:Object=Null)
Description:Creates a new layer.
Return type:ftLayer
Parameters:
NameTypeValue
_uclaObjectNull
Details:To create a new layer, use CreateLayer. To delete a layer, use RemoveLayer. A new layer is automatically added to the defaultScene scene.
Example:
Local myEngine:ftEngine = New ftEngine
+Local myLayer:ftLayer = myEngine.CreateLayer()
Method CreateLine:ftObject(xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateLine (xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a line object starting at xpos/ypos and ending at x/y.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
x2Float
y2Float
_ucobObjectNull
Details:The objects handle is in the middle of the line by default and can be changed via a call to ftObject.SetHandle.
Example:
Local myEngine = New ftEngine
 ' Create a line, that goes from the top left corner to the bottom right corner of the canvas
 Local myLine := myEngine.CreateLine(0,0, myEngine.GetCanvasWidth()-1, myEngine.GetCanvasHeight()-1)
-
Method CreateObjTimer:ftTimer(obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftEngine.CreateObjTimer (obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Creates a new object timer.
Return type:ftTimer
Parameters:
NameTypeValue
objftObject
timerIDInt
durationInt
repeatCountInt0
Details:When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let the timer run forever.
Example:
Local myEngine = New cEngine
+
Method CreateObjTimer:ftTimer(obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftEngine.CreateObjTimer (obj:ftObject, timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Creates a new object timer.
Return type:ftTimer
Parameters:
NameTypeValue
objftObject
timerIDInt
durationInt
repeatCountInt0
Details:When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let the timer run forever.
Example:
Local myEngine = New cEngine
 
 ' Create a constant for the timer ID
 Const circleTimerID:Int = 222
@@ -178,24 +178,24 @@ 

Module fantomEngine.cftEngine

Method CreateOval:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateOval (width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates an oval object with the given width/height and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Local myEngine = New ftEngine
+
Method CreateOval:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateOval (width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates an oval object with the given width/height and the center at xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
_ucobObjectNull
Example:
Local myEngine = New ftEngine
 ' Create an oval, located at the center of the canvas
 Local myOval := myEngine.CreateOval(30, 60, myEngine.GetCanvasWidth()/2.0, myEngine.GetCanvasHeight()/2.0)
-
Method CreatePath:ftPath(xpos:Float, ypos:Float )

Syntax:


ftPath = ftEngine.CreatePath (xpos:Float, ypos:Float)
Description:Creates a path with its center at the given xpos/ypos coordinates.
Return type:ftPath
Parameters:
NameTypeValue
xposFloat
yposFloat
Method CreatePivot:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePivot (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates an empty object (pivot) which you can use to attach/parent child objects to.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePoint (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a point object at the given xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePoly (verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a polygon object with supplied vertices pairs (Minimum of 3 pairs required).
Return type:ftObject
Parameters:
NameTypeValue
vertsFloat[]
xposFloat
yposFloat
_ucobObjectNull
Method CreateScene:ftScene(_ucSc:Object=Null)

Syntax:


ftScene = ftEngine.CreateScene (_ucSc:Object=Null)
Description:Creates a new scene.
Return type:ftScene
Parameters:
NameTypeValue
_ucScObjectNull
Details:To create a new scene, use CreateScene. To delete a scene, use RemoveScene. A new layer is automatically added to the defaultScene scene.
Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string)

Syntax:


ftSpriteAtlas = ftEngine.CreateSpriteAtlas (imgfileName:String, dataFileName:string)
Changes:New in v1.55
Description:Creates/loads a sprite atlas.
Return type:ftSpriteAtlas
Parameters:
NameTypeValue
imgfileNameString
dataFileNamestring
Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateStickMan (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a stickman with top left corner at position xpos/ypos with size of width:8 / height:29
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreateText:ftObject(font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateText (font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a new text object.
Return type:ftObject
Parameters:
NameTypeValue
fontftFont
txtString
xposFloat
yposFloat
textmodeIntftEngine.taTopLeft
_ucobObjectNull
Method CreateTileMap:ftObject(atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float )

Syntax:


ftObject = ftEngine.CreateTileMap (atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float)
Changes:Changed in v1.56 to support multiple tilesets
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlftImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
Method CreateTileMap:ftObject(atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float )

Syntax:


ftObject = ftEngine.CreateTileMap (atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float)
Changes:Fixed in v1.57
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 )

Syntax:


ftObject = ftEngine.CreateTileMap (filename:String, xpos:Float, ypos:Float, layerIndex:Int=1)
Changes:Changed in v1.56 to support multiple tilesets
Description:Create a tile map from a JSON file exported by the tool Tiled.
Return type:ftObject
Parameters:
NameTypeValue
filenameString
xposFloat
yposFloat
layerIndexInt1
Details:The layerIndex tells fantomEngine to load the tileLayer at that index. Index starts with 1.
Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftEngine.CreateTimer (timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Creates a new timer.
Return type:ftTimer
Parameters:
NameTypeValue
timerIDInt
durationInt
repeatCountInt0
Details:When the timer fires it will call OnTimer. A repeatCount of -1 will let the timer run forever.
Method CreateZoneBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float)

Syntax:


ftObject = ftEngine.CreateZoneBox (width:Float, height:Float, xpos:Float, ypos:Float)
Description:Creates a new ZoneBox object which can be used for touch and collision checks.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
Details:Zone objects are invisble and can be used as collision objects.
Example:
Method OnCreate:Int()
+
Method CreatePath:ftPath(xpos:Float, ypos:Float )

Syntax:


ftPath = ftEngine.CreatePath (xpos:Float, ypos:Float)
Description:Creates a path with its center at the given xpos/ypos coordinates.
Return type:ftPath
Parameters:
NameTypeValue
xposFloat
yposFloat
Method CreatePivot:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePivot (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates an empty object (pivot) which you can use to attach/parent child objects to.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePoint (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a point object at the given xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePoly (verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a polygon object with supplied vertices pairs (Minimum of 3 pairs required).
Return type:ftObject
Parameters:
NameTypeValue
vertsFloat[]
xposFloat
yposFloat
_ucobObjectNull
Method CreateScene:ftScene(_ucSc:Object=Null)

Syntax:


ftScene = ftEngine.CreateScene (_ucSc:Object=Null)
Description:Creates a new scene.
Return type:ftScene
Parameters:
NameTypeValue
_ucScObjectNull
Details:To create a new scene, use CreateScene. To delete a scene, use RemoveScene. A new layer is automatically added to the defaultScene scene.
Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string)

Syntax:


ftSpriteAtlas = ftEngine.CreateSpriteAtlas (imgfileName:String, dataFileName:string)
Changes:New in v1.55
Description:Creates/loads a sprite atlas.
Return type:ftSpriteAtlas
Parameters:
NameTypeValue
imgfileNameString
dataFileNamestring
Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateStickMan (xpos:Float, ypos:Float, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a stickman with top left corner at position xpos/ypos with size of width:8 / height:29
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
Method CreateText:ftObject(font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateText (font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null)
Changes:Changed in v1.56
Description:Creates a new text object.
Return type:ftObject
Parameters:
NameTypeValue
fontftFont
txtString
xposFloat
yposFloat
textmodeIntftEngine.taTopLeft
_ucobObjectNull
Method CreateTileMap:ftObject(atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float )

Syntax:


ftObject = ftEngine.CreateTileMap (atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float)
Changes:Changed in v1.56 to support multiple tilesets
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlftImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
Method CreateTileMap:ftObject(atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float )

Syntax:


ftObject = ftEngine.CreateTileMap (atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float)
Changes:Fixed in v1.57
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 )

Syntax:


ftObject = ftEngine.CreateTileMap (filename:String, xpos:Float, ypos:Float, layerIndex:Int=1)
Changes:Changed in v1.56 to support multiple tilesets
Description:Create a tile map from a JSON file exported by the tool Tiled.
Return type:ftObject
Parameters:
NameTypeValue
filenameString
xposFloat
yposFloat
layerIndexInt1
Details:The layerIndex tells fantomEngine to load the tileLayer at that index. Index starts with 1.
Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftEngine.CreateTimer (timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Creates a new timer.
Return type:ftTimer
Parameters:
NameTypeValue
timerIDInt
durationInt
repeatCountInt0
Details:When the timer fires it will call OnTimer. A repeatCount of -1 will let the timer run forever.
Method CreateZoneBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float)

Syntax:


ftObject = ftEngine.CreateZoneBox (width:Float, height:Float, xpos:Float, ypos:Float)
Description:Creates a new ZoneBox object which can be used for touch and collision checks.
Return type:ftObject
Parameters:
NameTypeValue
widthFloat
heightFloat
xposFloat
yposFloat
Details:Zone objects are invisble and can be used as collision objects.
Example:
Method OnCreate:Int()
         'Create the instance of the engine
         Local eng:ftEngine = New ftEngine
 
         ' Create now the object
         Local zonebox:ftObject = eng.CreateZoneBox(20, 100, 320, 240)
         Return 0
-End
Method CreateZoneCircle:ftObject(radius:Float, xpos:Float, ypos:Float)

Syntax:


ftObject = ftEngine.CreateZoneCircle (radius:Float, xpos:Float, ypos:Float)
Description:Creates a new ZoneCircle object which can be used for touch and collision checks.
Return type:ftObject
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposFloat
Details:Zone objects are invisble and can be used as collision objects.
Example:
Method OnCreate:Int()
+End
Method CreateZoneCircle:ftObject(radius:Float, xpos:Float, ypos:Float)

Syntax:


ftObject = ftEngine.CreateZoneCircle (radius:Float, xpos:Float, ypos:Float)
Description:Creates a new ZoneCircle object which can be used for touch and collision checks.
Return type:ftObject
Parameters:
NameTypeValue
radiusFloat
xposFloat
yposFloat
Details:Zone objects are invisble and can be used as collision objects.
Example:
Method OnCreate:Int()
         'Create the instance of the engine
         Local eng:ftEngine = New ftEngine
 
         ' Create now the object
         Local zonecircle:ftObject = eng.CreateZonecircle(50, 320, 240)
         Return 0
-End
Method ExitApp:Int(retCode:Int=0)

Syntax:


Int = ftEngine.ExitApp (retCode:Int=0)
Description:Ends the application.
Return type:Int
Parameters:
NameTypeValue
retCodeInt0
Example:
engine.ExitApp()
Method GetAccelX:Float()

Syntax:


Float = ftEngine.GetAccelX ()
Description:Return the X-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the X-axxis. To retrieve the Y-axxis, use GetAccelY. For the Z-axxis, use GetAccelZ.
Example:
Method OnUpdate:Int()
+End
Method ExitApp:Int(retCode:Int=0)

Syntax:


Int = ftEngine.ExitApp (retCode:Int=0)
Description:Ends the application.
Return type:Int
Parameters:
NameTypeValue
retCodeInt0
Example:
engine.ExitApp()
Method GetAccelX:Float()

Syntax:


Float = ftEngine.GetAccelX ()
Description:Return the X-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the X-axxis. To retrieve the Y-axxis, use GetAccelY. For the Z-axxis, use GetAccelZ.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -208,7 +208,7 @@ 

Module fantomEngine.cftEngine

Method GetAccelXY:Float[]()

Syntax:


Float[] = ftEngine.GetAccelXY ()
Description:Return the X and Y-axis value of the accelerator.
Return type:Float[]
Details:This command returns the current values of the accelerometer for the X and Y-axxis. To retrieve the X-axxis, use GetAccelX. For the Z-axxis, use GetAccelZ. And to retrieve the Y-axxis, use GetAccelY.
Example:
Method OnUpdate:Int()
+End
Method GetAccelXY:Float[]()

Syntax:


Float[] = ftEngine.GetAccelXY ()
Description:Return the X and Y-axis value of the accelerator.
Return type:Float[]
Details:This command returns the current values of the accelerometer for the X and Y-axxis. To retrieve the X-axxis, use GetAccelX. For the Z-axxis, use GetAccelZ. And to retrieve the Y-axxis, use GetAccelY.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -219,26 +219,26 @@ 

Module fantomEngine.cftEngine

Method GetAccelY:Float()

Syntax:


Float = ftEngine.GetAccelY ()
Description:Return the Y-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the Y-axxis. To retrieve the X-axxis, use GetAccelX. For the Z-axxis, use GetAccelZ.
Method GetAccelZ:Float()

Syntax:


Float = ftEngine.GetAccelZ ()
Description:Return the Z-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the Z-axxis. To retrieve the Y-axxis, use GetAccelY. For the X-axxis, use GetAccelX.
Method GetCam:Float[] ()

Syntax:


Float[] = ftEngine.GetCam ()
Changes:New in version 1.56
Description:Returns the cameras X and Y coordinate.
Return type:Float[]
Method GetCamX:Float ()

Syntax:


Float = ftEngine.GetCamX ()
Changes:New in version 1.56
Description:Returns the cameras X coordinate.
Return type:Float
Method GetCamY:Float ()

Syntax:


Float = ftEngine.GetCamY ()
Changes:New in version 1.56
Description:Returns the cameras Y coordinate.
Return type:Float
Method GetCanvasHeight:Int()

Syntax:


Int = ftEngine.GetCanvasHeight ()
Description:Returns the height of the canvas.
Return type:Int
Details:To retrieve the current height of the canvas, use GetCanvasHeight. To get the width the canvas, use GetCanvasWidth. To set the size of the virtual canvas, use SetCanvasSize.
Example:
Local myEngine:ftEngine = New ftEngine
-Local height:Int = myEngine.GetCanvasHeight()
Method GetCanvasWidth:Int()

Syntax:


Int = ftEngine.GetCanvasWidth ()
Description:Returns the width of the canvas.
Return type:Int
Details:To retrieve the current width of the canvas, use GetCanvasWidth. To get the height of the canvas, use GetCanvasHeight. To set the size of the virtual canvas, use SetCanvasSize.
Example:
Local myEngine:ftEngine = New ftEngine
-Local width:Int = myEngine.GetCanvasWidth()
Method GetDefaultLayer:ftLayer()

Syntax:


ftLayer = ftEngine.GetDefaultLayer ()
Description:Returns the current default layer.
Return type:ftLayer
Details:If you need to get the current layer where new objects are assigned to, then use GetDefaultLayer. To set the default layer, use SetDefaultLayer.
Example:
Local myEngine:ftEngine = New ftEngine
-Local currLayer:ftLayer = myEngine.GetDefaultLayer()
Method GetDefaultScene:ftScene()

Syntax:


ftScene = ftEngine.GetDefaultScene ()
Description:Returns the current default scene.
Return type:ftScene
Details:If you need to get the current scene where new layers are assigned to, then use GetDefaultScene. To set the default layer, use SetDefaultScene.
Method GetDeltaTime:Int()

Syntax:


Int = ftEngine.GetDeltaTime ()
Description:Returns the delta time in milliseconds which was calculated with CalcDeltaTime.
Return type:Int
Example:
Method OnUpdate:Int()
+End
Method GetAccelY:Float()

Syntax:


Float = ftEngine.GetAccelY ()
Description:Return the Y-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the Y-axxis. To retrieve the X-axxis, use GetAccelX. For the Z-axxis, use GetAccelZ.
Method GetAccelZ:Float()

Syntax:


Float = ftEngine.GetAccelZ ()
Description:Return the Z-axis value of the accelerator.
Return type:Float
Details:This command returns the current value of the accelerometer for the Z-axxis. To retrieve the Y-axxis, use GetAccelY. For the X-axxis, use GetAccelX.
Method GetCam:Float[] ()

Syntax:


Float[] = ftEngine.GetCam ()
Changes:New in version 1.56
Description:Returns the cameras X and Y coordinate.
Return type:Float[]
Method GetCamX:Float ()

Syntax:


Float = ftEngine.GetCamX ()
Changes:New in version 1.56
Description:Returns the cameras X coordinate.
Return type:Float
Method GetCamY:Float ()

Syntax:


Float = ftEngine.GetCamY ()
Changes:New in version 1.56
Description:Returns the cameras Y coordinate.
Return type:Float
Method GetCanvasHeight:Int()

Syntax:


Int = ftEngine.GetCanvasHeight ()
Description:Returns the height of the canvas.
Return type:Int
Details:To retrieve the current height of the canvas, use GetCanvasHeight. To get the width the canvas, use GetCanvasWidth. To set the size of the virtual canvas, use SetCanvasSize.
Example:
Local myEngine:ftEngine = New ftEngine
+Local height:Int = myEngine.GetCanvasHeight()
Method GetCanvasWidth:Int()

Syntax:


Int = ftEngine.GetCanvasWidth ()
Description:Returns the width of the canvas.
Return type:Int
Details:To retrieve the current width of the canvas, use GetCanvasWidth. To get the height of the canvas, use GetCanvasHeight. To set the size of the virtual canvas, use SetCanvasSize.
Example:
Local myEngine:ftEngine = New ftEngine
+Local width:Int = myEngine.GetCanvasWidth()
Method GetDefaultLayer:ftLayer()

Syntax:


ftLayer = ftEngine.GetDefaultLayer ()
Description:Returns the current default layer.
Return type:ftLayer
Details:If you need to get the current layer where new objects are assigned to, then use GetDefaultLayer. To set the default layer, use SetDefaultLayer.
Example:
Local myEngine:ftEngine = New ftEngine
+Local currLayer:ftLayer = myEngine.GetDefaultLayer()
Method GetDefaultScene:ftScene()

Syntax:


ftScene = ftEngine.GetDefaultScene ()
Description:Returns the current default scene.
Return type:ftScene
Details:If you need to get the current scene where new layers are assigned to, then use GetDefaultScene. To set the default layer, use SetDefaultScene.
Method GetDeltaTime:Int()

Syntax:


Int = ftEngine.GetDeltaTime ()
Description:Returns the delta time in milliseconds which was calculated with CalcDeltaTime.
Return type:Int
Example:
Method OnUpdate:Int()
 	Local milliSec:Int = myEngine.GetDeltaTime()
 	eng.Update()
-End
Method GetFPS:Int()

Syntax:


Int = ftEngine.GetFPS ()
Description:Determines the current frames per second.
Return type:Int
Details:Retrieves the current FPS value which is updated with each call of CalcDeltaTime.
Example:
Method OnRender:Int()
+End
Method GetFPS:Int()

Syntax:


Int = ftEngine.GetFPS ()
Description:Determines the current frames per second.
Return type:Int
Details:Retrieves the current FPS value which is updated with each call of CalcDeltaTime.
Example:
Method OnRender:Int()
 	Cls
 	Local currFPS:Int = myEngine.GetFPS()
 	eng.Render()
 	DrawText("FPS: "+currFPS, 10,10)
 End
-	
Method GetLocalX:Float(wordXPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetLocalX (wordXPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device X position of a virtual X coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
wordXPosFloat
withCamBoolTrue
Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetLocalXY (wordXPos:Float, wordYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device X/Y position of a virtual X/Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float[]
Parameters:
NameTypeValue
wordXPosFloat
wordYPosFloat
withCamBoolTrue
Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetLocalY (wordYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device Y position of a virtual Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
wordYPosFloat
withCamBoolTrue
Method GetObjCount:Int(type:Int = 0)

Syntax:


Int = ftEngine.GetObjCount (type:Int = 0)
Description:Returns the number of objects.
Return type:Int
Parameters:
NameTypeValue
typeInt0
Details:Type=0 >>> All objects are counted
Type=1 >>> Only active objects are counted
Type=2 >>> Only visible objects are counted
Method GetPause:Bool()

Syntax:


Bool = ftEngine.GetPause ()
Changes:Depreciated in version 1.51. Use GetPaused instead.
Description:Returns the isPaused flag of the engine.
Return type:Bool
Method GetPaused:Bool()

Syntax:


Bool = ftEngine.GetPaused ()
Description:Returns the isPaused flag of the engine.
Return type:Bool
Method GetScaleX:Float()

Syntax:


Float = ftEngine.GetScaleX ()
Description:Returns the X scale factor of the engine, which is set through SetCanvasSize.
Return type:Float
Details:Depending on which mode you used with SetCanvasSize, the scale factor for the canvas will be set. With GetScaleX you can retrieve this factor. To retrieve the Y-scale factor, use GetScaleY.
Example:
Method OnCreate:Int()
+	
Method GetLocalX:Float(wordXPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetLocalX (wordXPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device X position of a virtual X coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
wordXPosFloat
withCamBoolTrue
Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetLocalXY (wordXPos:Float, wordYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device X/Y position of a virtual X/Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float[]
Parameters:
NameTypeValue
wordXPosFloat
wordYPosFloat
withCamBoolTrue
Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetLocalY (wordYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the device Y position of a virtual Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
wordYPosFloat
withCamBoolTrue
Method GetObjCount:Int(type:Int = 0)

Syntax:


Int = ftEngine.GetObjCount (type:Int = 0)
Description:Returns the number of objects.
Return type:Int
Parameters:
NameTypeValue
typeInt0
Details:Type=0 >>> All objects are counted
Type=1 >>> Only active objects are counted
Type=2 >>> Only visible objects are counted
Method GetPause:Bool()

Syntax:


Bool = ftEngine.GetPause ()
Changes:Depreciated in version 1.51. Use GetPaused instead.
Description:Returns the isPaused flag of the engine.
Return type:Bool
Method GetPaused:Bool()

Syntax:


Bool = ftEngine.GetPaused ()
Description:Returns the isPaused flag of the engine.
Return type:Bool
Method GetScaleX:Float()

Syntax:


Float = ftEngine.GetScaleX ()
Description:Returns the X scale factor of the engine, which is set through SetCanvasSize.
Return type:Float
Details:Depending on which mode you used with SetCanvasSize, the scale factor for the canvas will be set. With GetScaleX you can retrieve this factor. To retrieve the Y-scale factor, use GetScaleY.
Example:
Method OnCreate:Int()
         ' Create an instance your engine class
         eng = New engine
         eng.SetCanvasSize(800, 600)
         sx = eng.GetScaleX()
         sy = eng.GetScaleY()
         Return 0
-End
Method GetScaleY:Float()

Syntax:


Float = ftEngine.GetScaleY ()
Description:Returns the Y scale factor of the engine, which is set through SetCanvasSize.
Return type:Float
Details:Depending on which mode you used with SetCanvasSize, the scale factor for the canvas will be set. With GetScaleY you can retrieve this factor. To retrieve the X-scale factor, use GetScaleX.
Method GetTime:Int()

Syntax:


Int = ftEngine.GetTime ()
Description:Returns engines own time.
Return type:Int
Details:By default it is based on Millisecs and the timeScale factor. Overwrite this method to implement your own timer algorithym.
Method GetTimeScale:Float()

Syntax:


Float = ftEngine.GetTimeScale ()
Description:Returns engines own timeScale.
Return type:Float
Method GetTouchX:Float(index:Int=0)

Syntax:


Float = ftEngine.GetTouchX (index:Int=0)
Description:Returns the X touch coordinate scaled by the engines X scale factor.
Return type:Float
Parameters:
NameTypeValue
indexInt0
Details:The x-position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly. To retrieve the Y-position, use GetTouchY.
Example:
Method OnUpdate:Int()
+End
Method GetScaleY:Float()

Syntax:


Float = ftEngine.GetScaleY ()
Description:Returns the Y scale factor of the engine, which is set through SetCanvasSize.
Return type:Float
Details:Depending on which mode you used with SetCanvasSize, the scale factor for the canvas will be set. With GetScaleY you can retrieve this factor. To retrieve the X-scale factor, use GetScaleX.
Method GetTime:Int()

Syntax:


Int = ftEngine.GetTime ()
Description:Returns engines own time.
Return type:Int
Details:By default it is based on Millisecs and the timeScale factor. Overwrite this method to implement your own timer algorithym.
Method GetTimeScale:Float()

Syntax:


Float = ftEngine.GetTimeScale ()
Description:Returns engines own timeScale.
Return type:Float
Method GetTouchX:Float(index:Int=0)

Syntax:


Float = ftEngine.GetTouchX (index:Int=0)
Description:Returns the X touch coordinate scaled by the engines X scale factor.
Return type:Float
Parameters:
NameTypeValue
indexInt0
Details:The x-position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly. To retrieve the Y-position, use GetTouchY.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -250,7 +250,7 @@ 

Module fantomEngine.cftEngine

Method GetTouchXY:Float[](index:Int=0)

Syntax:


Float[] = ftEngine.GetTouchXY (index:Int=0)
Description:Returns the X/Y touch coordinate scaled by the engines scale factors.
Return type:Float[]
Parameters:
NameTypeValue
indexInt0
Details:The return the position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly.
Method GetTouchY:Float(index:Int=0)

Syntax:


Float = ftEngine.GetTouchY (index:Int=0)
Description:Returns the Y touch coordinate scaled by the engines Y scale factor.
Return type:Float
Parameters:
NameTypeValue
indexInt0
Details:The y-position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly. To retrieve the X-position, use GetTouchX.
Method GetVolumeMUS:Float()

Syntax:


Float = ftEngine.GetVolumeMUS ()
Description:Returns the general volume of music. Ranges from 0.0 to 1.0.
Return type:Float
Method GetVolumeSFX:Float()

Syntax:


Float = ftEngine.GetVolumeSFX ()
Description:Returns the general volume of sound effects. Ranges from 0.0 to 1.0.
Return type:Float
Method GetWorldX:Float(localXPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldX (localXPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world X position from a local X coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
localXPosFloat
withCamBoolTrue
Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetWorldXY (localXPos:Float, localYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world X/Y position from a local X/Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float[]
Parameters:
NameTypeValue
localXPosFloat
localYPosFloat
withCamBoolTrue
Method GetWorldY:Float(localYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldY (localYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world Y position from a local Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
localYPosFloat
withCamBoolTrue
Method LoadFont:ftFont(filename:String)

Syntax:


ftFont = ftEngine.LoadFont (filename:String)
Changes:Added support for FontMachine in v1.54.
Description:Loads an EZGui compatible font or a packed FontMachine font. The filename has to end with a .txt extension.
Return type:ftFont
Parameters:
NameTypeValue
filenameString
Method LoadImage:Image(path:String, frameCount:Int=1, flags:Int=Image.MidHandle)

Syntax:


Image = ftEngine.LoadImage (path:String, frameCount:Int=1, flags:Int=Image.MidHandle)
Changes:Changed in v1.55 to use Image.MidHandle as the default flag.
Description:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager.
Return type:Image
Parameters:
NameTypeValue
pathString
frameCountInt1
flagsIntImage.MidHandle
Method LoadImage:Image(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle)

Syntax:


Image = ftEngine.LoadImage (path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle)
Changes:Changed in v1.55 to use Image.MidHandle as the default flag.
Description:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager.
Return type:Image
Parameters:
NameTypeValue
pathString
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.MidHandle
Method LoadMusic:ftSound(filename:String, loopFlag:Bool=False)

Syntax:


ftSound = ftEngine.LoadMusic (filename:String, loopFlag:Bool=False)
Description:Load a music file with the given filename.
Return type:ftSound
Parameters:
NameTypeValue
filenameString
loopFlagBoolFalse
Method LoadSound:ftSound(filename:String, loopFlag:Bool=False)

Syntax:


ftSound = ftEngine.LoadSound (filename:String, loopFlag:Bool=False)
Description:Load a sound file with the given filename.
Return type:ftSound
Parameters:
NameTypeValue
filenameString
loopFlagBoolFalse
Details:If you don't add a fileformat to the file name, then the default file format ist used.
The current default file formats are:
  • GLFW = .wav
  • HTML5 = .ogg
  • FLASH = .mp3
  • Android = .ogg
  • XNA = .wav
  • IOS = .m4a
  • all the rest = .wav

Method New()

Syntax:


none = ftEngine.New ()
Changes:Fixed in version 1.57
Description:Creates an instance of the fantomEngine.
Return type:none
Method OnLayerTransition:Int(transId:Int, layer:ftLayer)

Syntax:


Int = ftEngine.OnLayerTransition (transId:Int, layer:ftLayer)
Description:This method is called when a layer finishes its update.
Return type:Int
Parameters:
NameTypeValue
transIdInt
layerftLayer
Method OnLayerUpdate:Int(layer:ftLayer)

Syntax:


Int = ftEngine.OnLayerUpdate (layer:ftLayer)
Description:Callback method which is called when a layer is updated.
Return type:Int
Parameters:
NameTypeValue
layerftLayer
Method OnMarkerBounce:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerBounce (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to bounce backwards.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerCircle:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerCircle (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to do another circle.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerStop:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerStop (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and stops there.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerWP:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerWP (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches a waypoint of its path.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerWarp:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerWarp (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to warp to the start to go on.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnObjectAnim:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectAnim (obj:ftObject)
Changes:New in version 1.54
Description:This method is called when an animation of an object (obj) has finished one loop.
Return type:Int
Parameters:
NameTypeValue
objftObject
Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject)

Syntax:


Int = ftEngine.OnObjectCollision (obj:ftObject, obj2:ftObject)
Description:This method is called when an object (obj) collided with another object (obj2).
Return type:Int
Parameters:
NameTypeValue
objftObject
obj2ftObject
Method OnObjectDelete:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectDelete (obj:ftObject)
Description:This method is called when an object is removed.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:You need to activate this callback via the ftObject.ActivateDeleteEvent method. The given parameter holds the instance of the object.
Method OnObjectRender:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectRender (obj:ftObject)
Description:This method is called when an object was being rendered.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:The OnObjectRender method is called, when an object got rendered via a call to ftEngine.Render, ftLayer.Render or ftObject.Render. The given parameter holds the instance of the object.
You need to activate this callback via the ftObject.ActivateRenderEvent method.
Example:
' The engine class extends the ftEngine class to override the On... methods
+End
Method GetTouchXY:Float[](index:Int=0)

Syntax:


Float[] = ftEngine.GetTouchXY (index:Int=0)
Description:Returns the X/Y touch coordinate scaled by the engines scale factors.
Return type:Float[]
Parameters:
NameTypeValue
indexInt0
Details:The return the position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly.
Method GetTouchY:Float(index:Int=0)

Syntax:


Float = ftEngine.GetTouchY (index:Int=0)
Description:Returns the Y touch coordinate scaled by the engines Y scale factor.
Return type:Float
Parameters:
NameTypeValue
indexInt0
Details:The y-position of the finger with the given touch index. If you use a virtual canvas, the return value is scaled accordingly. To retrieve the X-position, use GetTouchX.
Method GetVolumeMUS:Float()

Syntax:


Float = ftEngine.GetVolumeMUS ()
Description:Returns the general volume of music. Ranges from 0.0 to 1.0.
Return type:Float
Method GetVolumeSFX:Float()

Syntax:


Float = ftEngine.GetVolumeSFX ()
Description:Returns the general volume of sound effects. Ranges from 0.0 to 1.0.
Return type:Float
Method GetWorldX:Float(localXPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldX (localXPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world X position from a local X coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
localXPosFloat
withCamBoolTrue
Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetWorldXY (localXPos:Float, localYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world X/Y position from a local X/Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float[]
Parameters:
NameTypeValue
localXPosFloat
localYPosFloat
withCamBoolTrue
Method GetWorldY:Float(localYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldY (localYPos:Float, withCam:Bool = True)
Changes:New in v1.55
Description:Returns the world Y position from a local Y coordinate. It takes the virtual canvas size and camera position into its calculation.
Return type:Float
Parameters:
NameTypeValue
localYPosFloat
withCamBoolTrue
Method LoadFont:ftFont(filename:String)

Syntax:


ftFont = ftEngine.LoadFont (filename:String)
Changes:Added support for FontMachine in v1.54.
Description:Loads an EZGui compatible font or a packed FontMachine font. The filename has to end with a .txt extension.
Return type:ftFont
Parameters:
NameTypeValue
filenameString
Method LoadImage:Image(path:String, frameCount:Int=1, flags:Int=Image.MidHandle)

Syntax:


Image = ftEngine.LoadImage (path:String, frameCount:Int=1, flags:Int=Image.MidHandle)
Changes:Changed in v1.55 to use Image.MidHandle as the default flag.
Description:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager.
Return type:Image
Parameters:
NameTypeValue
pathString
frameCountInt1
flagsIntImage.MidHandle
Method LoadImage:Image(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle)

Syntax:


Image = ftEngine.LoadImage (path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle)
Changes:Changed in v1.55 to use Image.MidHandle as the default flag.
Description:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager.
Return type:Image
Parameters:
NameTypeValue
pathString
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.MidHandle
Method LoadMusic:ftSound(filename:String, loopFlag:Bool=False)

Syntax:


ftSound = ftEngine.LoadMusic (filename:String, loopFlag:Bool=False)
Description:Load a music file with the given filename.
Return type:ftSound
Parameters:
NameTypeValue
filenameString
loopFlagBoolFalse
Method LoadSound:ftSound(filename:String, loopFlag:Bool=False)

Syntax:


ftSound = ftEngine.LoadSound (filename:String, loopFlag:Bool=False)
Description:Load a sound file with the given filename.
Return type:ftSound
Parameters:
NameTypeValue
filenameString
loopFlagBoolFalse
Details:If you don't add a fileformat to the file name, then the default file format ist used.
The current default file formats are:
  • GLFW = .wav
  • HTML5 = .ogg
  • FLASH = .mp3
  • Android = .ogg
  • XNA = .wav
  • IOS = .m4a
  • all the rest = .wav

Method New()

Syntax:


none = ftEngine.New ()
Changes:Fixed in version 1.57
Description:Creates an instance of the fantomEngine.
Return type:none
Method OnLayerTransition:Int(transId:Int, layer:ftLayer)

Syntax:


Int = ftEngine.OnLayerTransition (transId:Int, layer:ftLayer)
Description:This method is called when a layer finishes its update.
Return type:Int
Parameters:
NameTypeValue
transIdInt
layerftLayer
Method OnLayerUpdate:Int(layer:ftLayer)

Syntax:


Int = ftEngine.OnLayerUpdate (layer:ftLayer)
Description:Callback method which is called when a layer is updated.
Return type:Int
Parameters:
NameTypeValue
layerftLayer
Method OnMarkerBounce:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerBounce (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to bounce backwards.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerCircle:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerCircle (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to do another circle.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerStop:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerStop (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and stops there.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerWP:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerWP (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches a waypoint of its path.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnMarkerWarp:Int(marker:ftMarker, obj:ftObject)

Syntax:


Int = ftEngine.OnMarkerWarp (marker:ftMarker, obj:ftObject)
Description:This method is called, when a path marker reaches the end of the path and is about to warp to the start to go on.
Return type:Int
Parameters:
NameTypeValue
markerftMarker
objftObject
Method OnObjectAnim:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectAnim (obj:ftObject)
Changes:New in version 1.54
Description:This method is called when an animation of an object (obj) has finished one loop.
Return type:Int
Parameters:
NameTypeValue
objftObject
Method OnObjectCollision:Int(obj:ftObject, obj2:ftObject)

Syntax:


Int = ftEngine.OnObjectCollision (obj:ftObject, obj2:ftObject)
Description:This method is called when an object (obj) collided with another object (obj2).
Return type:Int
Parameters:
NameTypeValue
objftObject
obj2ftObject
Method OnObjectDelete:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectDelete (obj:ftObject)
Description:This method is called when an object is removed.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:You need to activate this callback via the ftObject.ActivateDeleteEvent method. The given parameter holds the instance of the object.
Method OnObjectRender:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectRender (obj:ftObject)
Description:This method is called when an object was being rendered.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:The OnObjectRender method is called, when an object got rendered via a call to ftEngine.Render, ftLayer.Render or ftObject.Render. The given parameter holds the instance of the object.
You need to activate this callback via the ftObject.ActivateRenderEvent method.
Example:
' The engine class extends the ftEngine class to override the On... methods
 Class engine Extends ftEngine
 	Method OnObjectRender:Int(obj:ftObject)
 	        ' Check if the group ID of the object is 222
@@ -269,7 +269,7 @@ 

Module fantomEngine.cftEngine

Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject)

Syntax:


Int = ftEngine.OnObjectSort (obj1:ftObject, obj2:ftObject)
Description:This method is called when objects are compared during a sort of its layer list.
Return type:Int
Parameters:
NameTypeValue
obj1ftObject
obj2ftObject
Details:By default, objects are sorted ascending by the Z position.
Overwrite this method with your own logic if you need something else.
Return TRUE if you want obj2 sorted infront of obj1.
Example:
' The engine class extends the ftEngine class to override the On... methods
+End
Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject)

Syntax:


Int = ftEngine.OnObjectSort (obj1:ftObject, obj2:ftObject)
Description:This method is called when objects are compared during a sort of its layer list.
Return type:Int
Parameters:
NameTypeValue
obj1ftObject
obj2ftObject
Details:By default, objects are sorted ascending by the Z position.
Overwrite this method with your own logic if you need something else.
Return TRUE if you want obj2 sorted infront of obj1.
Example:
' The engine class extends the ftEngine class to override the On... methods
 Class engine Extends ftEngine
 	Method OnObjectSort:Int(obj1:ftObject, obj2:ftObject)
 		' This method is called when objects are compared during a sort of its layer list
@@ -283,7 +283,7 @@ 

Module fantomEngine.cftEngine

Method OnObjectTimer:Int(timerId:Int, obj:ftObject)

Syntax:


Int = ftEngine.OnObjectTimer (timerId:Int, obj:ftObject)
Description:This method is called when an objects' timer was being fired.
Return type:Int
Parameters:
NameTypeValue
timerIdInt
objftObject
Method OnObjectTouch:Int(obj:ftObject, touchId:Int)

Syntax:


Int = ftEngine.OnObjectTouch (obj:ftObject, touchId:Int)
Description:This method is called when an object was touched.
Return type:Int
Parameters:
NameTypeValue
objftObject
touchIdInt
Method OnObjectTransition:Int(transId:Int, obj:ftObject)

Syntax:


Int = ftEngine.OnObjectTransition (transId:Int, obj:ftObject)
Description:This method is called when an object finishes its transition.
Return type:Int
Parameters:
NameTypeValue
transIdInt
objftObject
Method OnObjectUpdate:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectUpdate (obj:ftObject)
Description:This method is called when an object finishes its update.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:The OnObjectUpdate method is called, when an object got updated via a call to ftEngine.Update, ftLayer.Update or ftObject.Update. The given parameter holds the instance of the object.
You can deactivate this callback via the ftObject.ActivateUpdateEvent method.
Example:
' The engine class extends the ftEngine class to override the On... methods
+
Method OnObjectTimer:Int(timerId:Int, obj:ftObject)

Syntax:


Int = ftEngine.OnObjectTimer (timerId:Int, obj:ftObject)
Description:This method is called when an objects' timer was being fired.
Return type:Int
Parameters:
NameTypeValue
timerIdInt
objftObject
Method OnObjectTouch:Int(obj:ftObject, touchId:Int)

Syntax:


Int = ftEngine.OnObjectTouch (obj:ftObject, touchId:Int)
Description:This method is called when an object was touched.
Return type:Int
Parameters:
NameTypeValue
objftObject
touchIdInt
Method OnObjectTransition:Int(transId:Int, obj:ftObject)

Syntax:


Int = ftEngine.OnObjectTransition (transId:Int, obj:ftObject)
Description:This method is called when an object finishes its transition.
Return type:Int
Parameters:
NameTypeValue
transIdInt
objftObject
Method OnObjectUpdate:Int(obj:ftObject)

Syntax:


Int = ftEngine.OnObjectUpdate (obj:ftObject)
Description:This method is called when an object finishes its update.
Return type:Int
Parameters:
NameTypeValue
objftObject
Details:The OnObjectUpdate method is called, when an object got updated via a call to ftEngine.Update, ftLayer.Update or ftObject.Update. The given parameter holds the instance of the object.
You can deactivate this callback via the ftObject.ActivateUpdateEvent method.
Example:
' The engine class extends the ftEngine class to override the On... methods
 Class engine Extends ftEngine
 	Method OnObjectUpdate:Int(obj:ftObject)
 	        'Move the object 10 pixels to the right
@@ -291,22 +291,22 @@ 

Module fantomEngine.cftEngine

Method OnSwipeDone:Int(touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float)

Syntax:


Int = ftEngine.OnSwipeDone (touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float)
Description:This method is called when a swipe gesture was detected.
Return type:Int
Parameters:
NameTypeValue
touchIndexInt
sAngleFloat
sDistFloat
sSpeedFloat
Method OnTimer:Int(timerId:Int)

Syntax:


Int = ftEngine.OnTimer (timerId:Int)
Description:This method is called when an engine timer was being fired.
Return type:Int
Parameters:
NameTypeValue
timerIdInt
Method ReLoadAllImages:Void()

Syntax:


ftEngine.ReLoadAllImages ()
Description:Reloads all images. This is needed when you change the resolution in your game during runtime.
Method RemoveAllImages:Void(discard:Bool = False)

Syntax:


ftEngine.RemoveAllImages (discard:Bool = False)
Description:Removes all images from the engine.
Parameters:
NameTypeValue
discardBoolFalse
Method RemoveAllLayer:Void()

Syntax:


ftEngine.RemoveAllLayer ()
Description:Remove all existing layer from engine.
Method RemoveAllObjects:Void()

Syntax:


ftEngine.RemoveAllObjects ()
Description:Removes all objects from all layer.
Method RemoveAllScenes:Void()

Syntax:


ftEngine.RemoveAllScenes ()
Description:Remove all existing scenes from engine.
Method RemoveImage:Void(image:Image, discard:Bool = False)

Syntax:


ftEngine.RemoveImage (image:Image, discard:Bool = False)
Description:Removes an image from fantomEngine by the given Image handle.
Parameters:
NameTypeValue
imageImage
discardBoolFalse
Method RemoveImage:Void(filepath:String, discard:Bool = False)

Syntax:


ftEngine.RemoveImage (filepath:String, discard:Bool = False)
Description:Removes an image from fantomEngine by the given filename.
Parameters:
NameTypeValue
filepathString
discardBoolFalse
Method RemoveLayer:Void(layer:ftLayer)

Syntax:


ftEngine.RemoveLayer (layer:ftLayer)
Description:Removes a layer.
Parameters:
NameTypeValue
layerftLayer
Details:Deletes a previously created layer and all the objects that are assigned to it. To create a layer, use CreateLayer.
Example:
Local myEngine:ftEngine = New ftEngine
+End
Method OnSwipeDone:Int(touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float)

Syntax:


Int = ftEngine.OnSwipeDone (touchIndex:Int, sAngle:Float, sDist:Float, sSpeed:Float)
Description:This method is called when a swipe gesture was detected.
Return type:Int
Parameters:
NameTypeValue
touchIndexInt
sAngleFloat
sDistFloat
sSpeedFloat
Method OnTimer:Int(timerId:Int)

Syntax:


Int = ftEngine.OnTimer (timerId:Int)
Description:This method is called when an engine timer was being fired.
Return type:Int
Parameters:
NameTypeValue
timerIdInt
Method ReLoadAllImages:Void()

Syntax:


ftEngine.ReLoadAllImages ()
Description:Reloads all images. This is needed when you change the resolution in your game during runtime.
Method RemoveAllImages:Void(discard:Bool = False)

Syntax:


ftEngine.RemoveAllImages (discard:Bool = False)
Description:Removes all images from the engine.
Parameters:
NameTypeValue
discardBoolFalse
Method RemoveAllLayer:Void()

Syntax:


ftEngine.RemoveAllLayer ()
Description:Remove all existing layer from engine.
Method RemoveAllObjects:Void()

Syntax:


ftEngine.RemoveAllObjects ()
Description:Removes all objects from all layer.
Method RemoveAllScenes:Void()

Syntax:


ftEngine.RemoveAllScenes ()
Description:Remove all existing scenes from engine.
Method RemoveImage:Void(image:Image, discard:Bool = False)

Syntax:


ftEngine.RemoveImage (image:Image, discard:Bool = False)
Description:Removes an image from fantomEngine by the given Image handle.
Parameters:
NameTypeValue
imageImage
discardBoolFalse
Method RemoveImage:Void(filepath:String, discard:Bool = False)

Syntax:


ftEngine.RemoveImage (filepath:String, discard:Bool = False)
Description:Removes an image from fantomEngine by the given filename.
Parameters:
NameTypeValue
filepathString
discardBoolFalse
Method RemoveLayer:Void(layer:ftLayer)

Syntax:


ftEngine.RemoveLayer (layer:ftLayer)
Description:Removes a layer.
Parameters:
NameTypeValue
layerftLayer
Details:Deletes a previously created layer and all the objects that are assigned to it. To create a layer, use CreateLayer.
Example:
Local myEngine:ftEngine = New ftEngine
 Local myLayer:ftLayer = myEngine.CreateLayer()
-myEngine.RemoveLayer(myLayer)
Method RemoveScene:Void(scene:ftScene)

Syntax:


ftEngine.RemoveScene (scene:ftScene)
Description:Removes a scene.
Parameters:
NameTypeValue
sceneftScene
Details:Deletes a previously created scene. To create a scene, use CreateScene.
Method Render:Void()

Syntax:


ftEngine.Render ()
Description:Renders all active and visible layers with their objects.
Details:Renders the objects of all or just one specific layer. The layer have to be active and visible. They are rendered in their order of creation.
Example:
Method OnRender:Int()
+myEngine.RemoveLayer(myLayer)
Method RemoveScene:Void(scene:ftScene)

Syntax:


ftEngine.RemoveScene (scene:ftScene)
Description:Removes a scene.
Parameters:
NameTypeValue
sceneftScene
Details:Deletes a previously created scene. To create a scene, use CreateScene.
Method Render:Void()

Syntax:


ftEngine.Render ()
Description:Renders all active and visible layers with their objects.
Details:Renders the objects of all or just one specific layer. The layer have to be active and visible. They are rendered in their order of creation.
Example:
Method OnRender:Int()
 	Cls
 	eng.Render()
 	Return 0
-End
Method Render:Void(layer:ftLayer)

Syntax:


ftEngine.Render (layer:ftLayer)
Description:Renders all active and visible objects of a given layer.
Parameters:
NameTypeValue
layerftLayer
Example:
Method OnRender:Int()
+End
Method Render:Void(layer:ftLayer)

Syntax:


ftEngine.Render (layer:ftLayer)
Description:Renders all active and visible objects of a given layer.
Parameters:
NameTypeValue
layerftLayer
Example:
Method OnRender:Int()
 	Cls
 	eng.Render()
 	Return 0
-End
Method RenderLoadingBar:Void()

Syntax:


ftEngine.RenderLoadingBar ()
Description:Renders all simple loading screen.
Details:Call it inside mojo's OnLoading event.
Example:
Method OnLoading:Int()
+End
Method RenderLoadingBar:Void()

Syntax:


ftEngine.RenderLoadingBar ()
Description:Renders all simple loading screen.
Details:Call it inside mojo's OnLoading event.
Example:
Method OnLoading:Int()
 	' If loading of assets in OnCreate takes longer, render a simple loading screen
 	fE.RenderLoadingBar()
 	Return 0
 End
-
Method RestoreAlpha:Void()

Syntax:


ftEngine.RestoreAlpha ()
Description:Sets the current alpha to the engines stored alpha value.
Details:Use this when you have changed the alpha value manually via mojo.SetAlpha.
Method RestoreBlendmode:Void()

Syntax:


ftEngine.RestoreBlendmode ()
Description:Sets the current blendmode to the engines stored blendmode.
Details:Use this when you have changed the blendmode manually via mojo.SetBlend.
Method RestoreColor:Void()

Syntax:


ftEngine.RestoreColor ()
Description:Sets the current color to the engines stored color values.
Details:Use this when you have changed the color manually via mojo.SetColor.
Method SetCam:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftEngine.SetCam (x:Float, y:Float, relative:Int = False)
Description:Sets the camera to the given canvas positions.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the X and Y-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the X-Position, use SetCamX. For setting the Y position, use SetCamY.
Example:
Method OnUpdate:Int()
+
Method RestoreAlpha:Void()

Syntax:


ftEngine.RestoreAlpha ()
Description:Sets the current alpha to the engines stored alpha value.
Details:Use this when you have changed the alpha value manually via mojo.SetAlpha.
Method RestoreBlendmode:Void()

Syntax:


ftEngine.RestoreBlendmode ()
Description:Sets the current blendmode to the engines stored blendmode.
Details:Use this when you have changed the blendmode manually via mojo.SetBlend.
Method RestoreColor:Void()

Syntax:


ftEngine.RestoreColor ()
Description:Sets the current color to the engines stored color values.
Details:Use this when you have changed the color manually via mojo.SetColor.
Method SetCam:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftEngine.SetCam (x:Float, y:Float, relative:Int = False)
Description:Sets the camera to the given canvas positions.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the X and Y-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the X-Position, use SetCamX. For setting the Y position, use SetCamY.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -320,7 +320,7 @@ 

Module fantomEngine.cftEngine

Method SetCamX:Void (x:Float, relative:Int = False )

Syntax:


ftEngine.SetCamX (x:Float, relative:Int = False)
Description:Sets the cameras X coordinate to the given canvas position.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the X-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the Y-Position, use SetCamY. For setting the X and Y position together, use SetCam.
Example:
Method OnUpdate:Int()
+End
Method SetCamX:Void (x:Float, relative:Int = False )

Syntax:


ftEngine.SetCamX (x:Float, relative:Int = False)
Description:Sets the cameras X coordinate to the given canvas position.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the X-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the Y-Position, use SetCamY. For setting the X and Y position together, use SetCam.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -334,7 +334,7 @@ 

Module fantomEngine.cftEngine

Method SetCamY:Void (y:Float, relative:Int = False )

Syntax:


ftEngine.SetCamY (y:Float, relative:Int = False)
Description:Sets the cameras Y coordinate to the given canvas position.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the Y-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the X-Position, use SetCamX. For setting the X and Y position together, use SetCam.
Example:
Method OnUpdate:Int()
+End
Method SetCamY:Void (y:Float, relative:Int = False )

Syntax:


ftEngine.SetCamY (y:Float, relative:Int = False)
Description:Sets the cameras Y coordinate to the given canvas position.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Details:The camera in fantomEngine is basically and offset of the view to all visible objects. This command sets the Y-position of the camera.
If you use the relative flag, the cameras position is changed relatively by the given amount.
With positioning the camera, you can move your character freely inside the environment and you don't need to offset its layer anymore.
To set the X-Position, use SetCamX. For setting the X and Y position together, use SetCam.
Example:
Method OnUpdate:Int()
     ' Determine the update factor depending on the delta time
     Local d:Float = Float(myEngine.CalcDeltaTime())/60.0
 
@@ -348,18 +348,18 @@ 

Module fantomEngine.cftEngine

Method SetCanvasSize:Void(width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox)

Syntax:


ftEngine.SetCanvasSize (width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox)
Description:Sets the virtual canvas size to the given width/height.
Parameters:
NameTypeValue
widthInt
heightInt
canvasmodeIntftEngine.cmLetterbox
Details:With this command, you set the virtual dimensions of your canvas. If the size of your devices canvas will differ from your settings, fantomEngine will scale the drawing and touch input accordingly.
You can retrieve the scale factors with GetScaleY and GetScaleX.
If you want to act automatically on device rotations, call SetCanvasSize inside the ftEngine.OnUpdate method.
Canvas scale modes

The canvas scale modes are implemented as constants. Next you see which exist and what they do:
  • ftEngine.cmZoom (Value=0, Old behaviour, canvas will be streched/fitted into the screen. )
  • ftEngine.cmCentered (Value=1, Pixel perfect, canvas will be centered into the screen space. No content scaling. )
  • ftEngine.cmLetterbox (Value=2, Default. Canvas will be scaled to the smaller scale factor of X or Y. )
  • ftEngine.cmPerfect (Value=3, Pixel perfect (Top left). No content/Canvas scaling. )

Example:
Method OnCreate:Int()
+End
Method SetCanvasSize:Void(width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox)

Syntax:


ftEngine.SetCanvasSize (width:Int, height:Int, canvasmode:Int = ftEngine.cmLetterbox)
Description:Sets the virtual canvas size to the given width/height.
Parameters:
NameTypeValue
widthInt
heightInt
canvasmodeIntftEngine.cmLetterbox
Details:With this command, you set the virtual dimensions of your canvas. If the size of your devices canvas will differ from your settings, fantomEngine will scale the drawing and touch input accordingly.
You can retrieve the scale factors with GetScaleY and GetScaleX.
If you want to act automatically on device rotations, call SetCanvasSize inside the ftEngine.OnUpdate method.
Canvas scale modes

The canvas scale modes are implemented as constants. Next you see which exist and what they do:
  • ftEngine.cmZoom (Value=0, Old behaviour, canvas will be streched/fitted into the screen. )
  • ftEngine.cmCentered (Value=1, Pixel perfect, canvas will be centered into the screen space. No content scaling. )
  • ftEngine.cmLetterbox (Value=2, Default. Canvas will be scaled to the smaller scale factor of X or Y. )
  • ftEngine.cmPerfect (Value=3, Pixel perfect (Top left). No content/Canvas scaling. )

Example:
Method OnCreate:Int()
         ' Create an instance your engine class
         eng = New engine
 
         ' Set the virtual size to 800x600 and let the engine do letterbox scaling if needed
         eng.SetCanvasSize(800, 600, eng.cmLetterbox)
         Return 0
-End
Method SetDefaultActive:Void(active:Bool)

Syntax:


ftEngine.SetDefaultActive (active:Bool)
Description:Sets the default active flag for newly created objects.
Parameters:
NameTypeValue
activeBool
Details:All newly created objects are active by default. Use SetDefaultActive to set the default behaviour of the fantomEngine.
Example:
Local myEngine:ftEngine = New ftEngine
-myEngine.SetDefaultActive(False)
Method SetDefaultLayer:Void(layer:ftLayer)

Syntax:


ftEngine.SetDefaultLayer (layer:ftLayer)
Description:Sets the default layer which is assigned to all newly created objects.
Parameters:
NameTypeValue
layerftLayer
Details:If you need to set the default layer where new objects are assigned to, then use SetDefaultLayer. To get the default layer, use GetDefaultLayer.
Example:
Local myEngine:ftEngine = New ftEngine
+End
Method SetDefaultActive:Void(active:Bool)

Syntax:


ftEngine.SetDefaultActive (active:Bool)
Description:Sets the default active flag for newly created objects.
Parameters:
NameTypeValue
activeBool
Details:All newly created objects are active by default. Use SetDefaultActive to set the default behaviour of the fantomEngine.
Example:
Local myEngine:ftEngine = New ftEngine
+myEngine.SetDefaultActive(False)
Method SetDefaultLayer:Void(layer:ftLayer)

Syntax:


ftEngine.SetDefaultLayer (layer:ftLayer)
Description:Sets the default layer which is assigned to all newly created objects.
Parameters:
NameTypeValue
layerftLayer
Details:If you need to set the default layer where new objects are assigned to, then use SetDefaultLayer. To get the default layer, use GetDefaultLayer.
Example:
Local myEngine:ftEngine = New ftEngine
 Local myLayer:ftLayer = myEngine.CreateLayer()
-myEngine.SetDefaultLayer(myLayer)
Method SetDefaultScene:Void(scene:ftScene)

Syntax:


ftEngine.SetDefaultScene (scene:ftScene)
Description:Sets the default scene which is assigned to all newly created layers.
Parameters:
NameTypeValue
sceneftScene
Details:If you need to set the default scene where new layers are assigned to, then use SetDefaultScene. To get the default layer, use GetDefaultScene.
Method SetDefaultVisible:Void(visible:Bool)

Syntax:


ftEngine.SetDefaultVisible (visible:Bool)
Description:Sets the default visible flag for newly created objects.
Parameters:
NameTypeValue
visibleBool
Details:All newly created objects are visible by default. Use SetDefaultVisible to set the default behaviour of the fantomEngine.
Example:
Local myEngine:ftEngine = New ftEngine
-myEngine.SetDefaultVisible(False)
Method SetFirstSoundChannel:Void(firstChannel:Int = 0)

Syntax:


ftEngine.SetFirstSoundChannel (firstChannel:Int = 0)
Description:Sets the index of the first sound channel to be used. Ranges from 0 to 31.
Parameters:
NameTypeValue
firstChannelInt0
Method SetMaxSoundChannel:Void(maxChannel:Int = 32)

Syntax:


ftEngine.SetMaxSoundChannel (maxChannel:Int = 32)
Description:Sets the maximum number of sound channels to be used. Ranges from 1 to 32.
Parameters:
NameTypeValue
maxChannelInt32
Details:If a low end device device has performance problems, lower this setting.
Method SetPause:Void(pauseFlag:Bool)

Syntax:


ftEngine.SetPause (pauseFlag:Bool)
Changes:Depreciated in version 1.51. Use SetPaused instead.
Description:With this method, you can pause the engine or resume it.
Parameters:
NameTypeValue
pauseFlagBool
Details:If the engine is paused, objects, timers and transitions won't be updated.
Method SetPaused:Void(pauseFlag:Bool)

Syntax:


ftEngine.SetPaused (pauseFlag:Bool)
Description:With this method, you can pause the engine or resume it.
Parameters:
NameTypeValue
pauseFlagBool
Details:If the engine is paused, objects, timers and transitions won't be updated.
Method SetSwipeDeadDist:Void(deadDist:Float = 20.0)

Syntax:


ftEngine.SetSwipeDeadDist (deadDist:Float = 20.0)
Description:Only swipes that are longer than the dead distance are detected.
Parameters:
NameTypeValue
deadDistFloat20.0
Method SetSwipeSnap:Void(degrees:Int=1)

Syntax:


ftEngine.SetSwipeSnap (degrees:Int=1)
Description:You can let the swipe angle snap to a fraction of a given degree.
Parameters:
NameTypeValue
degreesInt1
Method SetTimeScale:Void(timescale:Float = 1.0)

Syntax:


ftEngine.SetTimeScale (timescale:Float = 1.0)
Description:The time scale influences the update methods of objects, timers and transitions.
Parameters:
NameTypeValue
timescaleFloat1.0
Details:Lower values than 1.0 slow down the engine, bigger values speed it up.
Method SetVolumeMUS:Void(volume:Float = 1.0)

Syntax:


ftEngine.SetVolumeMUS (volume:Float = 1.0)
Description:Sets the general volume of music. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volumeFloat1.0
Method SetVolumeSFX:Void(volume:Float = 1.0)

Syntax:


ftEngine.SetVolumeSFX (volume:Float = 1.0)
Description:Sets the general volume of sound effects. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volumeFloat1.0
Method SortObjects:Void()

Syntax:


ftEngine.SortObjects ()
Description:Sort the objects of all layer.
Details:Internally it will call the ftEngine.OnObjectSort method. Override this method with your on comparison algorythm.
Method SortObjects:Void(layer:ftLayer)

Syntax:


ftEngine.SortObjects (layer:ftLayer)
Description:Sort the objects inside a layer.
Parameters:
NameTypeValue
layerftLayer
Details:Internally it will call the ftEngine.OnObjectSort method. Override this method with your on comparison algorythm.
Method SwipeUpdate:Void(index:Int = 0)

Syntax:


ftEngine.SwipeUpdate (index:Int = 0)
Description:Call SwipeUpdate in every mojo.OnUpdate event after the regular ftEngine.Update method.
Parameters:
NameTypeValue
indexInt0
Details:If a swipe was detected, it will call the ftEngine.OnSwipeDone method.
Method TouchCheck:Void(touchID:Int=0)

Syntax:


ftEngine.TouchCheck (touchID:Int=0)
Changes:Changed in v1.56
Description:Do a touch check over all layers and their active objects which have a touch method assigned to them.
Parameters:
NameTypeValue
touchIDInt0
Details:If a touch was detected, it will call the ftEngine.OnObjectTouch method.
Method TouchCheck:Void(layer:ftLayer, touchID:Int=0)

Syntax:


ftEngine.TouchCheck (layer:ftLayer, touchID:Int=0)
Description:Do a touch check over all active objects of a given layer which have a touch method assigned to them.
Parameters:
NameTypeValue
layerftLayer
touchIDInt0
Details:If a touch was detected, it will call the ftEngine.OnObjectTouch method.
Method Update:Void(speed:Float=1.0)

Syntax:


ftEngine.Update (speed:Float=1.0)
Description:Updates all general timers and active layers with their transitions and objects.
Parameters:
NameTypeValue
speedFloat1.0
Details:Update all objects of the engine which are not children of another object. That means that the objects move and turn according to their speed, speed angle and spin properties.
After an object was updated, the ftEngine.OnObjectUpdate method will be called. Child objects are updated together with and right after their parent objects.
Example:
Method OnUpdate:Int()
+myEngine.SetDefaultLayer(myLayer)
Method SetDefaultScene:Void(scene:ftScene)

Syntax:


ftEngine.SetDefaultScene (scene:ftScene)
Description:Sets the default scene which is assigned to all newly created layers.
Parameters:
NameTypeValue
sceneftScene
Details:If you need to set the default scene where new layers are assigned to, then use SetDefaultScene. To get the default layer, use GetDefaultScene.
Method SetDefaultVisible:Void(visible:Bool)

Syntax:


ftEngine.SetDefaultVisible (visible:Bool)
Description:Sets the default visible flag for newly created objects.
Parameters:
NameTypeValue
visibleBool
Details:All newly created objects are visible by default. Use SetDefaultVisible to set the default behaviour of the fantomEngine.
Example:
Local myEngine:ftEngine = New ftEngine
+myEngine.SetDefaultVisible(False)
Method SetFirstSoundChannel:Void(firstChannel:Int = 0)

Syntax:


ftEngine.SetFirstSoundChannel (firstChannel:Int = 0)
Description:Sets the index of the first sound channel to be used. Ranges from 0 to 31.
Parameters:
NameTypeValue
firstChannelInt0
Method SetMaxSoundChannel:Void(maxChannel:Int = 32)

Syntax:


ftEngine.SetMaxSoundChannel (maxChannel:Int = 32)
Description:Sets the maximum number of sound channels to be used. Ranges from 1 to 32.
Parameters:
NameTypeValue
maxChannelInt32
Details:If a low end device device has performance problems, lower this setting.
Method SetPause:Void(pauseFlag:Bool)

Syntax:


ftEngine.SetPause (pauseFlag:Bool)
Changes:Depreciated in version 1.51. Use SetPaused instead.
Description:With this method, you can pause the engine or resume it.
Parameters:
NameTypeValue
pauseFlagBool
Details:If the engine is paused, objects, timers and transitions won't be updated.
Method SetPaused:Void(pauseFlag:Bool)

Syntax:


ftEngine.SetPaused (pauseFlag:Bool)
Description:With this method, you can pause the engine or resume it.
Parameters:
NameTypeValue
pauseFlagBool
Details:If the engine is paused, objects, timers and transitions won't be updated.
Method SetSwipeDeadDist:Void(deadDist:Float = 20.0)

Syntax:


ftEngine.SetSwipeDeadDist (deadDist:Float = 20.0)
Description:Only swipes that are longer than the dead distance are detected.
Parameters:
NameTypeValue
deadDistFloat20.0
Method SetSwipeSnap:Void(degrees:Int=1)

Syntax:


ftEngine.SetSwipeSnap (degrees:Int=1)
Description:You can let the swipe angle snap to a fraction of a given degree.
Parameters:
NameTypeValue
degreesInt1
Method SetTimeScale:Void(timescale:Float = 1.0)

Syntax:


ftEngine.SetTimeScale (timescale:Float = 1.0)
Description:The time scale influences the update methods of objects, timers and transitions.
Parameters:
NameTypeValue
timescaleFloat1.0
Details:Lower values than 1.0 slow down the engine, bigger values speed it up.
Method SetVolumeMUS:Void(volume:Float = 1.0)

Syntax:


ftEngine.SetVolumeMUS (volume:Float = 1.0)
Description:Sets the general volume of music. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volumeFloat1.0
Method SetVolumeSFX:Void(volume:Float = 1.0)

Syntax:


ftEngine.SetVolumeSFX (volume:Float = 1.0)
Description:Sets the general volume of sound effects. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volumeFloat1.0
Method SortObjects:Void()

Syntax:


ftEngine.SortObjects ()
Description:Sort the objects of all layer.
Details:Internally it will call the ftEngine.OnObjectSort method. Override this method with your on comparison algorythm.
Method SortObjects:Void(layer:ftLayer)

Syntax:


ftEngine.SortObjects (layer:ftLayer)
Description:Sort the objects inside a layer.
Parameters:
NameTypeValue
layerftLayer
Details:Internally it will call the ftEngine.OnObjectSort method. Override this method with your on comparison algorythm.
Method SwipeUpdate:Void(index:Int = 0)

Syntax:


ftEngine.SwipeUpdate (index:Int = 0)
Description:Call SwipeUpdate in every mojo.OnUpdate event after the regular ftEngine.Update method.
Parameters:
NameTypeValue
indexInt0
Details:If a swipe was detected, it will call the ftEngine.OnSwipeDone method.
Method TouchCheck:Void(touchID:Int=0)

Syntax:


ftEngine.TouchCheck (touchID:Int=0)
Changes:Changed in v1.56
Description:Do a touch check over all layers and their active objects which have a touch method assigned to them.
Parameters:
NameTypeValue
touchIDInt0
Details:If a touch was detected, it will call the ftEngine.OnObjectTouch method.
Method TouchCheck:Void(layer:ftLayer, touchID:Int=0)

Syntax:


ftEngine.TouchCheck (layer:ftLayer, touchID:Int=0)
Description:Do a touch check over all active objects of a given layer which have a touch method assigned to them.
Parameters:
NameTypeValue
layerftLayer
touchIDInt0
Details:If a touch was detected, it will call the ftEngine.OnObjectTouch method.
Method Update:Void(speed:Float=1.0)

Syntax:


ftEngine.Update (speed:Float=1.0)
Description:Updates all general timers and active layers with their transitions and objects.
Parameters:
NameTypeValue
speedFloat1.0
Details:Update all objects of the engine which are not children of another object. That means that the objects move and turn according to their speed, speed angle and spin properties.
After an object was updated, the ftEngine.OnObjectUpdate method will be called. Child objects are updated together with and right after their parent objects.
Example:
Method OnUpdate:Int()
         ' Calculate the time (in milliseconds) since the last update and devide it by 60.0
         Local mySpeed:Float = Float(eng.CalcDeltaTime())/60.0
 
@@ -367,7 +367,7 @@ 

Module fantomEngine.cftEngine

Method Update:Void(layer:ftLayer, speed:Float=1.0)

Syntax:


ftEngine.Update (layer:ftLayer, speed:Float=1.0)
Description:Updates all general timer and a given layer with its transitions and active objects.
Parameters:
NameTypeValue
layerftLayer
speedFloat1.0
Details:Update all objects of the specified layer which are not children of another object. That means that the objects move and turn according to their speed, speed angle and spin properties.
After an object was updated, the ftEngine.OnObjectUpdate method will be called. Child objects are updated together with and right after their parent objects.
Example:
Method OnUpdate:Int()
+End
Method Update:Void(layer:ftLayer, speed:Float=1.0)

Syntax:


ftEngine.Update (layer:ftLayer, speed:Float=1.0)
Description:Updates all general timer and a given layer with its transitions and active objects.
Parameters:
NameTypeValue
layerftLayer
speedFloat1.0
Details:Update all objects of the specified layer which are not children of another object. That means that the objects move and turn according to their speed, speed angle and spin properties.
After an object was updated, the ftEngine.OnObjectUpdate method will be called. Child objects are updated together with and right after their parent objects.
Example:
Method OnUpdate:Int()
         ' Calculate the time (in milliseconds) since the last update and devide it by 60.0
         Local mySpeed:Float = Float(eng.CalcDeltaTime())/60.0
 
@@ -375,5 +375,5 @@ 

Module fantomEngine.cftEngine

Const cmCentered% = 1
Type:none
Const cmLetterbox% = 2
Type:none
Const cmPerfect% = 3
Type:none
Const cmZoom% = 0
Type:none
Const ctBound% = 2
Type:none
Const ctBox% = 1
Type:none
Const ctCircle% = 0
Type:none
Const ctLine% = 3
Type:none
Const oedBottom% = 1
Type:none
Const oedLeft% = 3
Type:none
Const oedRight% = 4
Type:none
Const oedTop% = 2
Type:none
Const otBox% = 3
Type:none
Const otCircle% = 2
Type:none
Const otGUI% = 100
Type:none
Const otImage% = 0
Type:none
Const otLine% = 11
Type:none
Const otOval% = 10
Type:none
Const otPivot% = 13
Type:none
Const otPoint% = 8
Type:none
Const otPoly% = 12
Type:none
Const otStickMan% = 9
Type:none
Const otText% = 1
Type:none
Const otTextMulti% = 7
Type:none
Const otTileMap% = 6
Type:none
Const otZoneBox% = 4
Type:none
Const otZoneCircle% = 5
Type:none
Const taBottomCenter% = 5
Type:none
Const taBottomLeft% = 8
Type:none
Const taBottomRight% = 6
Type:none
Const taCenterCenter% = 3
Type:none
Const taCenterLeft% = 7
Type:none
Const taCenterRight% = 4
Type:none
Const taTopCenter% = 1
Type:none
Const taTopLeft% = 0
Type:none
Const taTopRight% = 2
Type:none
Const tmBound% = 2
Type:none
Const tmBox% = 3
Type:none
Const tmCircle% = 1
Type:none
Const twmBounceEaseIn% = 1
Type:none
Const twmBounceEaseInOut% = 2
Type:none
Const twmBounceEaseOut% = 3
Type:none
Const twmCircleEaseIn% = 4
Type:none
Const twmCircleEaseInOut% = 5
Type:none
Const twmCircleEaseOut% = 6
Type:none
Const twmCubicEaseIn% = 7
Type:none
Const twmCubicEaseInOut% = 8
Type:none
Const twmCubicEaseOut% = 9
Type:none
Const twmEaseIn% = 10
Type:none
Const twmEaseInOut% = 11
Type:none
Const twmEaseOut% = 12
Type:none
Const twmElasticEaseIn% = 13
Type:none
Const twmElasticEaseInOut% = 14
Type:none
Const twmElasticEaseOut% = 15
Type:none
Const twmExpoEaseIn% = 16
Type:none
Const twmExpoEaseInOut% = 17
Type:none
Const twmExpoEaseOut% = 18
Type:none
Const twmLinear% = 0
Type:none
Const twmQuadEaseIn% = 22
Type:none
Const twmQuadEaseInOut% = 23
Type:none
Const twmQuadEaseOut% = 24
Type:none
Const twmQuartEaseIn% = 25
Type:none
Const twmQuartEaseInOut% = 26
Type:none
Const twmQuartEaseOut% = 27
Type:none
Const twmQuintEaseIn% = 28
Type:none
Const twmQuintEaseInOut% = 29
Type:none
Const twmQuintEaseOut% = 30
Type:none
Const twmSineEaseIn% = 19
Type:none
Const twmSineEaseInOut% = 20
Type:none
Const twmSineEaseOut% = 21
Type:none
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+End
Const cmCentered% = 1
Type:none
Const cmLetterbox% = 2
Type:none
Const cmPerfect% = 3
Type:none
Const cmZoom% = 0
Type:none
Const ctBound% = 2
Type:none
Const ctBox% = 1
Type:none
Const ctCircle% = 0
Type:none
Const ctLine% = 3
Type:none
Const oedBottom% = 1
Type:none
Const oedLeft% = 3
Type:none
Const oedRight% = 4
Type:none
Const oedTop% = 2
Type:none
Const otBox% = 3
Type:none
Const otCircle% = 2
Type:none
Const otGUI% = 100
Type:none
Const otImage% = 0
Type:none
Const otLine% = 11
Type:none
Const otOval% = 10
Type:none
Const otPivot% = 13
Type:none
Const otPoint% = 8
Type:none
Const otPoly% = 12
Type:none
Const otStickMan% = 9
Type:none
Const otText% = 1
Type:none
Const otTextMulti% = 7
Type:none
Const otTileMap% = 6
Type:none
Const otZoneBox% = 4
Type:none
Const otZoneCircle% = 5
Type:none
Const taBottomCenter% = 5
Type:none
Const taBottomLeft% = 8
Type:none
Const taBottomRight% = 6
Type:none
Const taCenterCenter% = 3
Type:none
Const taCenterLeft% = 7
Type:none
Const taCenterRight% = 4
Type:none
Const taTopCenter% = 1
Type:none
Const taTopLeft% = 0
Type:none
Const taTopRight% = 2
Type:none
Const tmBound% = 2
Type:none
Const tmBox% = 3
Type:none
Const tmCircle% = 1
Type:none
Const twmBounceEaseIn% = 1
Type:none
Const twmBounceEaseInOut% = 2
Type:none
Const twmBounceEaseOut% = 3
Type:none
Const twmCircleEaseIn% = 4
Type:none
Const twmCircleEaseInOut% = 5
Type:none
Const twmCircleEaseOut% = 6
Type:none
Const twmCubicEaseIn% = 7
Type:none
Const twmCubicEaseInOut% = 8
Type:none
Const twmCubicEaseOut% = 9
Type:none
Const twmEaseIn% = 10
Type:none
Const twmEaseInOut% = 11
Type:none
Const twmEaseOut% = 12
Type:none
Const twmElasticEaseIn% = 13
Type:none
Const twmElasticEaseInOut% = 14
Type:none
Const twmElasticEaseOut% = 15
Type:none
Const twmExpoEaseIn% = 16
Type:none
Const twmExpoEaseInOut% = 17
Type:none
Const twmExpoEaseOut% = 18
Type:none
Const twmLinear% = 0
Type:none
Const twmQuadEaseIn% = 22
Type:none
Const twmQuadEaseInOut% = 23
Type:none
Const twmQuadEaseOut% = 24
Type:none
Const twmQuartEaseIn% = 25
Type:none
Const twmQuartEaseInOut% = 26
Type:none
Const twmQuartEaseOut% = 27
Type:none
Const twmQuintEaseIn% = 28
Type:none
Const twmQuintEaseInOut% = 29
Type:none
Const twmQuintEaseOut% = 30
Type:none
Const twmSineEaseIn% = 19
Type:none
Const twmSineEaseInOut% = 20
Type:none
Const twmSineEaseOut% = 21
Type:none
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftFont.monkey.html b/docs/cftFont.monkey.html index 143904f..c9d71c5 100644 --- a/docs/cftFont.monkey.html +++ b/docs/cftFont.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftFont -

Module fantomEngine.cftFont


The module cftFont hosts several classes which add bitmap font drawing to fantomEngine. Bitmap fonts are important if you need to show text information inside your game fast and easy.

Table of contents:

Classes:

Class ftFont
Changes:Added fontMachine support in version 1.54
Description:The class ftFont provides a few methods regarding the definition of a loaded font.
Table of contents:Methods:
  • Height   ( Method Height:Int() )
  • Length   ( Method Length:Int(t:String) )

Method Height:Int()

Syntax:


Int = ftFont.Height ()
Description:Returns the maximum height of the font.
Return type:Int
Method Length:Int(t:String)

Syntax:


Int = ftFont.Length (t:String)
Description:Returns the length in pixel of the given text string.
Return type:Int
Parameters:
NameTypeValue
tString
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftFont


The module cftFont hosts several classes which add bitmap font drawing to fantomEngine. Bitmap fonts are important if you need to show text information inside your game fast and easy.

Table of contents:

Classes:

Class ftFont
Changes:Added fontMachine support in version 1.54
Description:The class ftFont provides a few methods regarding the definition of a loaded font.
Table of contents:Methods:
  • Height   ( Method Height:Int() )
  • Length   ( Method Length:Int(t:String) )

Method Height:Int()

Syntax:


Int = ftFont.Height ()
Description:Returns the maximum height of the font.
Return type:Int
Method Length:Int(t:String)

Syntax:


Int = ftFont.Length (t:String)
Description:Returns the length in pixel of the given text string.
Return type:Int
Parameters:
NameTypeValue
tString
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftFunctions.monkey.html b/docs/cftFunctions.monkey.html index 98d3c6c..d8ec178 100644 --- a/docs/cftFunctions.monkey.html +++ b/docs/cftFunctions.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftFunctions -

Module fantomEngine.cftFunctions


The module cftFunctions is a collection of several functions for IOS, ANDROID and HTML5 targets to retrieve some device and browser informations.

Table of contents:

Functions:

Function GetBrowserName:String()

Syntax:

String = GetBrowserName ()
Description:Returns the name of the HTML5 browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetBrowserPlatform:String()

Syntax:

String = GetBrowserPlatform ()
Description:Returns the platform the HTML5 browser is running on.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetBrowserVersion:String()

Syntax:

String = GetBrowserVersion ()
Description:Returns the version of the HTML5 browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetDeviceName:String()

Syntax:

String = GetDeviceName ()
Description:Returns the name of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetHardware:String()

Syntax:

String = GetHardware ()
Description:Returns the hardware of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetLanguage:String()

Syntax:

String = GetLanguage ()
Description:Returns the language of a browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetProduct:String()

Syntax:

String = GetProduct ()
Description:Return the product of the device.
Return type:String
Details:Returns valid information on Android only.
Function GetSerial:String()

Syntax:

String = GetSerial ()
Description:Return the serial number of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetUser:String()

Syntax:

String = GetUser ()
Description:Returns the name of the device user.
Return type:String
Details:Returns valid information on Android/iOS only.
Function HideConsole:Void()

Syntax:

HideConsole ()
Changes:Changed help text in v1.54.
Description:Hides the HTML5 console.
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function IsMobileBrowser:Bool()

Syntax:

Bool = IsMobileBrowser ()
Description:Returns TRUE, if your HTML5 runs on a mobile browser.
Return type:Bool
Details:Returns valid information on HTML5 only.
Function MaximizeCanvas:Void()

Syntax:

MaximizeCanvas ()
Changes:Changed help text in v1.54.
Description:Maximizes the HTML5 canvas.
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function ResizeCanvas:Void(x:Int, y:Int)

Syntax:

ResizeCanvas (x:Int, y:Int)
Changes:Changed help text in v1.54.
Description:Resizes the HTML5 canvas to the given proportions.
Parameters:
NameTypeValue
xInt
yInt
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function ResizeConsole:Void(x:Int, y:Int)

Syntax:

ResizeConsole (x:Int, y:Int)
Changes:Changed help text in v1.54.
Description:Resizes the HTML5 console to the given proportions.
Parameters:
NameTypeValue
xInt
yInt
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftFunctions


The module cftFunctions is a collection of several functions for IOS, ANDROID and HTML5 targets to retrieve some device and browser informations.

Table of contents:

Functions:

Function GetBrowserName:String()

Syntax:

String = GetBrowserName ()
Description:Returns the name of the HTML5 browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetBrowserPlatform:String()

Syntax:

String = GetBrowserPlatform ()
Description:Returns the platform the HTML5 browser is running on.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetBrowserVersion:String()

Syntax:

String = GetBrowserVersion ()
Description:Returns the version of the HTML5 browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetDeviceName:String()

Syntax:

String = GetDeviceName ()
Description:Returns the name of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetHardware:String()

Syntax:

String = GetHardware ()
Description:Returns the hardware of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetLanguage:String()

Syntax:

String = GetLanguage ()
Description:Returns the language of a browser.
Return type:String
Details:Returns valid information on HTML5 only.
Function GetProduct:String()

Syntax:

String = GetProduct ()
Description:Return the product of the device.
Return type:String
Details:Returns valid information on Android only.
Function GetSerial:String()

Syntax:

String = GetSerial ()
Description:Return the serial number of the device.
Return type:String
Details:Returns valid information on Android/iOS only.
Function GetUser:String()

Syntax:

String = GetUser ()
Description:Returns the name of the device user.
Return type:String
Details:Returns valid information on Android/iOS only.
Function HideConsole:Void()

Syntax:

HideConsole ()
Changes:Changed help text in v1.54.
Description:Hides the HTML5 console.
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function IsMobileBrowser:Bool()

Syntax:

Bool = IsMobileBrowser ()
Description:Returns TRUE, if your HTML5 runs on a mobile browser.
Return type:Bool
Details:Returns valid information on HTML5 only.
Function MaximizeCanvas:Void()

Syntax:

MaximizeCanvas ()
Changes:Changed help text in v1.54.
Description:Maximizes the HTML5 canvas.
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function ResizeCanvas:Void(x:Int, y:Int)

Syntax:

ResizeCanvas (x:Int, y:Int)
Changes:Changed help text in v1.54.
Description:Resizes the HTML5 canvas to the given proportions.
Parameters:
NameTypeValue
xInt
yInt
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
Function ResizeConsole:Void(x:Int, y:Int)

Syntax:

ResizeConsole (x:Int, y:Int)
Changes:Changed help text in v1.54.
Description:Resizes the HTML5 console to the given proportions.
Parameters:
NameTypeValue
xInt
yInt
Details:HTML5 only.
Attention: You need to set the variable CANVAS_RESIZE_MODE to 0 in your exported MonkeyGame.html file to make this work correctly!
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftGui.monkey.html b/docs/cftGui.monkey.html index dd7e189..db0a5c7 100644 --- a/docs/cftGui.monkey.html +++ b/docs/cftGui.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftGui -

Module fantomEngine.cftGui


The class ftGuiGadget is the base class for each gui object/gadget.

Table of contents:

Classes:

Class ftGuiButton Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiButton.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetPressed:Bool()

Syntax:


Bool = ftGuiButton.GetPressed ()
Description:Returns TRUE if the button just got pressed.
Return type:Bool
Class ftGuiCheckbox Extends ftGuiGadget
Changes:New in version 1.57
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • SetState   ( Method SetState:Void(checkState:Bool) )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiCheckbox.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method SetState:Void(checkState:Bool)

Syntax:


ftGuiCheckbox.SetState (checkState:Bool)
Description:Sets the check state of the checkbox. TRUE means it is checked.
Parameters:
NameTypeValue
checkStateBool
Class ftGuiGadget Extends ftObject
Changes:New in version 1.57.
Table of contents:Methods:
  • GetState   ( Method GetState:Bool() )
  • SetSmoothness   ( Method SetSmoothness:Void(smoothFactor:Float = 0.9) )
  • SetState   ( Method SetState:Void(newState:Bool) )

Method GetState:Bool()

Syntax:


Bool = ftGuiGadget.GetState ()
Description:Returns the state of the control.
Return type:Bool
Method SetSmoothness:Void(smoothFactor:Float = 0.9)

Syntax:


ftGuiGadget.SetSmoothness (smoothFactor:Float = 0.9)
Description:Sets the smoothness factor for the control.
Parameters:
NameTypeValue
smoothFactorFloat0.9
Method SetState:Void(newState:Bool)

Syntax:


ftGuiGadget.SetState (newState:Bool)
Description:Sets the state of the control.
Parameters:
NameTypeValue
newStateBool
Class ftGuiJoystick Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetJoyX   ( Method GetJoyX:Float(raw:Bool = False) )
  • GetJoyY   ( Method GetJoyY:Float(raw:Bool = False) )
  • SetDeadZone   ( Method SetDeadZone:Void(deadZone:Float = 0.1) )
  • SetMaxZone   ( Method SetMaxZone:Void(maxZone:Float = 0.9) )
  • isHit   ( Method isHit:Bool() )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiJoystick.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetJoyX:Float(raw:Bool = False)

Syntax:


Float = ftGuiJoystick.GetJoyX (raw:Bool = False)
Description:Returns the X offset of the joystick
Return type:Float
Parameters:
NameTypeValue
rawBoolFalse
Method GetJoyY:Float(raw:Bool = False)

Syntax:


Float = ftGuiJoystick.GetJoyY (raw:Bool = False)
Description:Returns the Y offset of the joystick
Return type:Float
Parameters:
NameTypeValue
rawBoolFalse
Method SetDeadZone:Void(deadZone:Float = 0.1)

Syntax:


ftGuiJoystick.SetDeadZone (deadZone:Float = 0.1)
Description:Sets the deadzone of the joystick. Affects relative values less or equal the deadzone value.
Parameters:
NameTypeValue
deadZoneFloat0.1
Method SetMaxZone:Void(maxZone:Float = 0.9)

Syntax:


ftGuiJoystick.SetMaxZone (maxZone:Float = 0.9)
Description:Sets the deadzone of the joystick. Affects relative values less or equal the deadzone value.
Parameters:
NameTypeValue
maxZoneFloat0.9
Method isHit:Bool()

Syntax:


Bool = ftGuiJoystick.isHit ()
Description:Returns the hit state of the joystick
Return type:Bool
Class ftGuiLabel Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetShadowOffset   ( Method SetShadowOffset:Void(xOff:Float, yOff:Float) )

Fields:
  • hasShadow ( Field hasShadow:Bool = False )
  • shadowX ( Field shadowX:Float = 2.0 )
  • shadowY ( Field shadowY:Float = 2.0 )

Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiLabel.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetShadowOffset:Void(xOff:Float, yOff:Float)

Syntax:


ftGuiLabel.SetShadowOffset (xOff:Float, yOff:Float)
Parameters:
NameTypeValue
xOffFloat
yOffFloat
Field hasShadow:Bool = False
Type:Bool
Value:False
Field shadowX:Float = 2.0
Type:Float
Value:2.0
Field shadowY:Float = 2.0
Type:Float
Value:2.0
Class ftGuiListview Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • AddItem   ( Method AddItem:ftGuiListviewItem(t:string) )
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetItem   ( Method GetItem:ftGuiListviewItem(index:Int = 0) )
  • GetItemText   ( Method GetItemText:String(index:Int) )
  • GetSelected   ( Method GetSelected:Int() )
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetLines   ( Method SetLines:Void(newLines:String) )
  • SetLines   ( Method SetLines:Void(newLines:String[]) )
  • SetScrollXY   ( Method SetScrollXY:Void (sx:Float, sy:Float, relative:Int = False ) )
  • SetSelected   ( Method SetSelected:Void(selectedID:Int = -1) )

Fields:
  • font ( Field font:ftFont = Null )
  • itemList ( Field itemList:= New List )
  • scrollX ( Field scrollX:Float = 0.0 )
  • scrollY ( Field scrollY:Float = 0.0 )
  • selItem ( Field selItem:Int = -1 )

Method AddItem:ftGuiListviewItem(t:string)

Syntax:


ftGuiListviewItem = ftGuiListview.AddItem (t:string)
Return type:ftGuiListviewItem
Parameters:
NameTypeValue
tstring
Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiListview.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetItem:ftGuiListviewItem(index:Int = 0)

Syntax:


ftGuiListviewItem = ftGuiListview.GetItem (index:Int = 0)
Return type:ftGuiListviewItem
Parameters:
NameTypeValue
indexInt0
Method GetItemText:String(index:Int)

Syntax:


String = ftGuiListview.GetItemText (index:Int)
Return type:String
Parameters:
NameTypeValue
indexInt
Method GetSelected:Int()

Syntax:


Int = ftGuiListview.GetSelected ()
Return type:Int
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiListview.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetLines:Void(newLines:String)

Syntax:


ftGuiListview.SetLines (newLines:String)
Parameters:
NameTypeValue
newLinesString
Method SetLines:Void(newLines:String[])

Syntax:


ftGuiListview.SetLines (newLines:String[])
Parameters:
NameTypeValue
newLinesString[]
Method SetScrollXY:Void (sx:Float, sy:Float, relative:Int = False )

Syntax:


ftGuiListview.SetScrollXY (sx:Float, sy:Float, relative:Int = False)
Description:Set the X/Y offset position of the list items.
Parameters:
NameTypeValue
sxFloat
syFloat
relativeIntFalse
Method SetSelected:Void(selectedID:Int = -1)

Syntax:


ftGuiListview.SetSelected (selectedID:Int = -1)
Parameters:
NameTypeValue
selectedIDInt-1
Field font:ftFont = Null
Type:ftFont
Value:Null
Field itemList:= New List
Type:= New List
Field scrollX:Float = 0.0
Type:Float
Value:0.0
Field scrollY:Float = 0.0
Type:Float
Value:0.0
Field selItem:Int = -1
Type:Int
Value:-1
Class ftGuiListviewItem
Changes:New in version 1.57.
Table of contents:Methods:
  • GetImage   ( Method GetImage:ftImage() )
  • GetText   ( Method GetText:String() )
  • SetImage   ( Method SetImage:Void(lviImage:ftImage) )
  • SetText   ( Method SetText:Void(lviText:String) )

Fields:
  • img ( Field img:ftImage = Null )
  • text ( Field text:String = "" )

Method GetImage:ftImage()

Syntax:


ftImage = ftGuiListviewItem.GetImage ()
Return type:ftImage
Method GetText:String()

Syntax:


String = ftGuiListviewItem.GetText ()
Return type:String
Method SetImage:Void(lviImage:ftImage)

Syntax:


ftGuiListviewItem.SetImage (lviImage:ftImage)
Parameters:
NameTypeValue
lviImageftImage
Method SetText:Void(lviText:String)

Syntax:


ftGuiListviewItem.SetText (lviText:String)
Parameters:
NameTypeValue
lviTextString
Field img:ftImage = Null
Type:ftImage
Value:Null
Field text:String = ""
Type:String
Value:""
Class ftGuiMng Extends ftObject
Changes:New in version 1.57.
Table of contents:Methods:
  • CreateButton   ( Method CreateButton:ftGuiButton(imgBtn:String) )
  • CreateCheckbox   ( Method CreateCheckbox:ftGuiCheckbox(imgChecked:String,imgUnchecked:String, checkState:Bool = True) )
  • CreateJoyStick   ( Method CreateJoyStick:ftGuiJoystick(imgRing:String, imgStick:String) )
  • CreateLabel   ( Method CreateLabel:ftGuiLabel(txt:String, shadowed:Bool = False) )
  • CreateListview   ( Method CreateListview:ftGuiListview(x:Float, y:Float, w:Float, h:Float, newLines:String) )
  • CreateSlider   ( Method CreateSlider:ftGuiSlider(imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal) )
  • CreateSwitch   ( Method CreateSwitch:ftGuiSwitch(imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True) )
  • CreateTextfield   ( Method CreateTextfield:ftGuiTextfield(txt:String, shadowed:Bool = False) )
  • New   ( Method New(eng:ftEngine) )
  • Update   ( Method Update:Void(delta:Float=1.0) )

Constants:

Fields:
  • font1 ( Field font1:ftFont = Null )
  • objList ( Field objList := New List )

Method CreateButton:ftGuiButton(imgBtn:String)

Syntax:


ftGuiButton = ftGuiMng.CreateButton (imgBtn:String)
Description:Creates a new joypad button.
Return type:ftGuiButton
Parameters:
NameTypeValue
imgBtnString
Method CreateCheckbox:ftGuiCheckbox(imgChecked:String,imgUnchecked:String, checkState:Bool = True)

Syntax:


ftGuiCheckbox = ftGuiMng.CreateCheckbox (imgChecked:String,imgUnchecked:String, checkState:Bool = True)
Description:Creates a new checkbox.
Return type:ftGuiCheckbox
Parameters:
NameTypeValue
imgCheckedString
imgUncheckedString
checkStateBoolTrue
Method CreateJoyStick:ftGuiJoystick(imgRing:String, imgStick:String)

Syntax:


ftGuiJoystick = ftGuiMng.CreateJoyStick (imgRing:String, imgStick:String)
Description:Creates a new analog joystick.
Return type:ftGuiJoystick
Parameters:
NameTypeValue
imgRingString
imgStickString
Method CreateLabel:ftGuiLabel(txt:String, shadowed:Bool = False)

Syntax:


ftGuiLabel = ftGuiMng.CreateLabel (txt:String, shadowed:Bool = False)
Description:Creates a new label.
Return type:ftGuiLabel
Parameters:
NameTypeValue
txtString
shadowedBoolFalse
Method CreateListview:ftGuiListview(x:Float, y:Float, w:Float, h:Float, newLines:String)

Syntax:


ftGuiListview = ftGuiMng.CreateListview (x:Float, y:Float, w:Float, h:Float, newLines:String)
Description:Creates a new listview.
Return type:ftGuiListview
Parameters:
NameTypeValue
xFloat
yFloat
wFloat
hFloat
newLinesString
Method CreateSlider:ftGuiSlider(imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal)

Syntax:


ftGuiSlider = ftGuiMng.CreateSlider (imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal)
Description:Creates a slider.
Return type:ftGuiSlider
Parameters:
NameTypeValue
imgSliderBarString
imgSliderKnobString
startValFloat
rangeValFloat
orientationIntftGuiMng.slHorizontal
Method CreateSwitch:ftGuiSwitch(imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True)

Syntax:


ftGuiSwitch = ftGuiMng.CreateSwitch (imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True)
Description:Creates a new switch.
Return type:ftGuiSwitch
Parameters:
NameTypeValue
imgSwitchOnString
imgSwitchOffString
switchStateBoolTrue
Method CreateTextfield:ftGuiTextfield(txt:String, shadowed:Bool = False)

Syntax:


ftGuiTextfield = ftGuiMng.CreateTextfield (txt:String, shadowed:Bool = False)
Description:Creates a new textfield.
Return type:ftGuiTextfield
Parameters:
NameTypeValue
txtString
shadowedBoolFalse
Method New(eng:ftEngine)

Syntax:


none = ftGuiMng.New (eng:ftEngine)
Description:Creates a new joypad manager.
Return type:none
Parameters:
NameTypeValue
engftEngine
Method Update:Void(delta:Float=1.0)

Syntax:


ftGuiMng.Update (delta:Float=1.0)
Description:Updates all states of gui elements.
Parameters:
NameTypeValue
deltaFloat1.0
Const idButton:Int = 1112
Type:Int
Value:1112
Const idChkBox:Int = 1114
Type:Int
Value:1114
Const idJoyStick:Int = 1111
Type:Int
Value:1111
Const idLabel:Int = 1116
Type:Int
Value:1116
Const idListview:Int = 1115
Type:Int
Value:1115
Const idSlider:Int = 1119
Type:Int
Value:1119
Const idSwitch:Int = 1113
Type:Int
Value:1113
Const idTextfield:Int = 1121
Type:Int
Value:1121
Const slHorizontal:Int = 1
Type:Int
Value:1
Const slVertical:Int = 2
Type:Int
Value:2
Field font1:ftFont = Null
Type:ftFont
Value:Null
Field objList := New List
Type:= New List
Class ftGuiSlider Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetValue   ( Method GetValue:Float() )
  • SetRange   ( Method SetRange:Void(startVal:Float, rangeVal:Float) )
  • isHit   ( Method isHit:Bool() )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiSlider.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetValue:Float()

Syntax:


Float = ftGuiSlider.GetValue ()
Description:Returns the current value of the slider
Return type:Float
Method SetRange:Void(startVal:Float, rangeVal:Float)

Syntax:


ftGuiSlider.SetRange (startVal:Float, rangeVal:Float)
Description:Sets the range of the slider.
Parameters:
NameTypeValue
startValFloat
rangeValFloat
Method isHit:Bool()

Syntax:


Bool = ftGuiSlider.isHit ()
Description:Returns the hit state of the slider
Return type:Bool
Class ftGuiSwitch Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • SetState   ( Method SetState:Void(switchState:Bool) )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiSwitch.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method SetState:Void(switchState:Bool)

Syntax:


ftGuiSwitch.SetState (switchState:Bool)
Description:Sets the switch state of the switch. TRUE means it is ON.
Parameters:
NameTypeValue
switchStateBool
Class ftGuiTextfield Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • GetFocus   ( Method GetFocus:bool() )
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetFocus   ( Method SetFocus:Void(focus:Bool = True) )
  • SetShadowOffset   ( Method SetShadowOffset:Void(xOff:Float, yOff:Float) )
  • Update   ( Method Update:Void(delta:Float=1.0) )

Fields:
  • hasFocus ( Field hasFocus:Bool = True )
  • hasShadow ( Field hasShadow:Bool = False )
  • shadowX ( Field shadowX:Float = 2.0 )
  • shadowY ( Field shadowY:Float = 2.0 )

Method GetFocus:bool()

Syntax:


bool = ftGuiTextfield.GetFocus ()
Return type:bool
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiTextfield.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetFocus:Void(focus:Bool = True)

Syntax:


ftGuiTextfield.SetFocus (focus:Bool = True)
Parameters:
NameTypeValue
focusBoolTrue
Method SetShadowOffset:Void(xOff:Float, yOff:Float)

Syntax:


ftGuiTextfield.SetShadowOffset (xOff:Float, yOff:Float)
Parameters:
NameTypeValue
xOffFloat
yOffFloat
Method Update:Void(delta:Float=1.0)

Syntax:


ftGuiTextfield.Update (delta:Float=1.0)
Parameters:
NameTypeValue
deltaFloat1.0
Field hasFocus:Bool = True
Type:Bool
Value:True
Field hasShadow:Bool = False
Type:Bool
Value:False
Field shadowX:Float = 2.0
Type:Float
Value:2.0
Field shadowY:Float = 2.0
Type:Float
Value:2.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftGui


The class ftGuiGadget is the base class for each gui object/gadget.

Table of contents:

Classes:

Class ftGuiButton Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiButton.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetPressed:Bool()

Syntax:


Bool = ftGuiButton.GetPressed ()
Description:Returns TRUE if the button just got pressed.
Return type:Bool
Class ftGuiCheckbox Extends ftGuiGadget
Changes:New in version 1.57
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • SetState   ( Method SetState:Void(checkState:Bool) )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiCheckbox.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method SetState:Void(checkState:Bool)

Syntax:


ftGuiCheckbox.SetState (checkState:Bool)
Description:Sets the check state of the checkbox. TRUE means it is checked.
Parameters:
NameTypeValue
checkStateBool
Class ftGuiGadget Extends ftObject
Changes:New in version 1.57.
Table of contents:Methods:
  • GetState   ( Method GetState:Bool() )
  • SetSmoothness   ( Method SetSmoothness:Void(smoothFactor:Float = 0.9) )
  • SetState   ( Method SetState:Void(newState:Bool) )

Method GetState:Bool()

Syntax:


Bool = ftGuiGadget.GetState ()
Description:Returns the state of the control.
Return type:Bool
Method SetSmoothness:Void(smoothFactor:Float = 0.9)

Syntax:


ftGuiGadget.SetSmoothness (smoothFactor:Float = 0.9)
Description:Sets the smoothness factor for the control.
Parameters:
NameTypeValue
smoothFactorFloat0.9
Method SetState:Void(newState:Bool)

Syntax:


ftGuiGadget.SetState (newState:Bool)
Description:Sets the state of the control.
Parameters:
NameTypeValue
newStateBool
Class ftGuiJoystick Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetJoyX   ( Method GetJoyX:Float(raw:Bool = False) )
  • GetJoyY   ( Method GetJoyY:Float(raw:Bool = False) )
  • SetDeadZone   ( Method SetDeadZone:Void(deadZone:Float = 0.1) )
  • SetMaxZone   ( Method SetMaxZone:Void(maxZone:Float = 0.9) )
  • isHit   ( Method isHit:Bool() )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiJoystick.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetJoyX:Float(raw:Bool = False)

Syntax:


Float = ftGuiJoystick.GetJoyX (raw:Bool = False)
Description:Returns the X offset of the joystick
Return type:Float
Parameters:
NameTypeValue
rawBoolFalse
Method GetJoyY:Float(raw:Bool = False)

Syntax:


Float = ftGuiJoystick.GetJoyY (raw:Bool = False)
Description:Returns the Y offset of the joystick
Return type:Float
Parameters:
NameTypeValue
rawBoolFalse
Method SetDeadZone:Void(deadZone:Float = 0.1)

Syntax:


ftGuiJoystick.SetDeadZone (deadZone:Float = 0.1)
Description:Sets the deadzone of the joystick. Affects relative values less or equal the deadzone value.
Parameters:
NameTypeValue
deadZoneFloat0.1
Method SetMaxZone:Void(maxZone:Float = 0.9)

Syntax:


ftGuiJoystick.SetMaxZone (maxZone:Float = 0.9)
Description:Sets the deadzone of the joystick. Affects relative values less or equal the deadzone value.
Parameters:
NameTypeValue
maxZoneFloat0.9
Method isHit:Bool()

Syntax:


Bool = ftGuiJoystick.isHit ()
Description:Returns the hit state of the joystick
Return type:Bool
Class ftGuiLabel Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetShadowOffset   ( Method SetShadowOffset:Void(xOff:Float, yOff:Float) )

Fields:
  • hasShadow ( Field hasShadow:Bool = False )
  • shadowX ( Field shadowX:Float = 2.0 )
  • shadowY ( Field shadowY:Float = 2.0 )

Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiLabel.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetShadowOffset:Void(xOff:Float, yOff:Float)

Syntax:


ftGuiLabel.SetShadowOffset (xOff:Float, yOff:Float)
Parameters:
NameTypeValue
xOffFloat
yOffFloat
Field hasShadow:Bool = False
Type:Bool
Value:False
Field shadowX:Float = 2.0
Type:Float
Value:2.0
Field shadowY:Float = 2.0
Type:Float
Value:2.0
Class ftGuiListview Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • AddItem   ( Method AddItem:ftGuiListviewItem(t:string) )
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetItem   ( Method GetItem:ftGuiListviewItem(index:Int = 0) )
  • GetItemText   ( Method GetItemText:String(index:Int) )
  • GetSelected   ( Method GetSelected:Int() )
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetLines   ( Method SetLines:Void(newLines:String) )
  • SetLines   ( Method SetLines:Void(newLines:String[]) )
  • SetScrollXY   ( Method SetScrollXY:Void (sx:Float, sy:Float, relative:Int = False ) )
  • SetSelected   ( Method SetSelected:Void(selectedID:Int = -1) )

Fields:
  • font ( Field font:ftFont = Null )
  • itemList ( Field itemList:= New List )
  • scrollX ( Field scrollX:Float = 0.0 )
  • scrollY ( Field scrollY:Float = 0.0 )
  • selItem ( Field selItem:Int = -1 )

Method AddItem:ftGuiListviewItem(t:string)

Syntax:


ftGuiListviewItem = ftGuiListview.AddItem (t:string)
Return type:ftGuiListviewItem
Parameters:
NameTypeValue
tstring
Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiListview.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetItem:ftGuiListviewItem(index:Int = 0)

Syntax:


ftGuiListviewItem = ftGuiListview.GetItem (index:Int = 0)
Return type:ftGuiListviewItem
Parameters:
NameTypeValue
indexInt0
Method GetItemText:String(index:Int)

Syntax:


String = ftGuiListview.GetItemText (index:Int)
Return type:String
Parameters:
NameTypeValue
indexInt
Method GetSelected:Int()

Syntax:


Int = ftGuiListview.GetSelected ()
Return type:Int
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiListview.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetLines:Void(newLines:String)

Syntax:


ftGuiListview.SetLines (newLines:String)
Parameters:
NameTypeValue
newLinesString
Method SetLines:Void(newLines:String[])

Syntax:


ftGuiListview.SetLines (newLines:String[])
Parameters:
NameTypeValue
newLinesString[]
Method SetScrollXY:Void (sx:Float, sy:Float, relative:Int = False )

Syntax:


ftGuiListview.SetScrollXY (sx:Float, sy:Float, relative:Int = False)
Description:Set the X/Y offset position of the list items.
Parameters:
NameTypeValue
sxFloat
syFloat
relativeIntFalse
Method SetSelected:Void(selectedID:Int = -1)

Syntax:


ftGuiListview.SetSelected (selectedID:Int = -1)
Parameters:
NameTypeValue
selectedIDInt-1
Field font:ftFont = Null
Type:ftFont
Value:Null
Field itemList:= New List
Type:= New List
Field scrollX:Float = 0.0
Type:Float
Value:0.0
Field scrollY:Float = 0.0
Type:Float
Value:0.0
Field selItem:Int = -1
Type:Int
Value:-1
Class ftGuiListviewItem
Changes:New in version 1.57.
Table of contents:Methods:
  • GetImage   ( Method GetImage:ftImage() )
  • GetText   ( Method GetText:String() )
  • SetImage   ( Method SetImage:Void(lviImage:ftImage) )
  • SetText   ( Method SetText:Void(lviText:String) )

Fields:
  • img ( Field img:ftImage = Null )
  • text ( Field text:String = "" )

Method GetImage:ftImage()

Syntax:


ftImage = ftGuiListviewItem.GetImage ()
Return type:ftImage
Method GetText:String()

Syntax:


String = ftGuiListviewItem.GetText ()
Return type:String
Method SetImage:Void(lviImage:ftImage)

Syntax:


ftGuiListviewItem.SetImage (lviImage:ftImage)
Parameters:
NameTypeValue
lviImageftImage
Method SetText:Void(lviText:String)

Syntax:


ftGuiListviewItem.SetText (lviText:String)
Parameters:
NameTypeValue
lviTextString
Field img:ftImage = Null
Type:ftImage
Value:Null
Field text:String = ""
Type:String
Value:""
Class ftGuiMng Extends ftObject
Changes:New in version 1.57.
Table of contents:Methods:
  • CreateButton   ( Method CreateButton:ftGuiButton(imgBtn:String) )
  • CreateCheckbox   ( Method CreateCheckbox:ftGuiCheckbox(imgChecked:String,imgUnchecked:String, checkState:Bool = True) )
  • CreateJoyStick   ( Method CreateJoyStick:ftGuiJoystick(imgRing:String, imgStick:String) )
  • CreateLabel   ( Method CreateLabel:ftGuiLabel(txt:String, shadowed:Bool = False) )
  • CreateListview   ( Method CreateListview:ftGuiListview(x:Float, y:Float, w:Float, h:Float, newLines:String) )
  • CreateSlider   ( Method CreateSlider:ftGuiSlider(imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal) )
  • CreateSwitch   ( Method CreateSwitch:ftGuiSwitch(imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True) )
  • CreateTextfield   ( Method CreateTextfield:ftGuiTextfield(txt:String, shadowed:Bool = False) )
  • New   ( Method New(eng:ftEngine) )
  • Update   ( Method Update:Void(delta:Float=1.0) )

Constants:

Fields:
  • font1 ( Field font1:ftFont = Null )
  • objList ( Field objList := New List )

Method CreateButton:ftGuiButton(imgBtn:String)

Syntax:


ftGuiButton = ftGuiMng.CreateButton (imgBtn:String)
Description:Creates a new joypad button.
Return type:ftGuiButton
Parameters:
NameTypeValue
imgBtnString
Method CreateCheckbox:ftGuiCheckbox(imgChecked:String,imgUnchecked:String, checkState:Bool = True)

Syntax:


ftGuiCheckbox = ftGuiMng.CreateCheckbox (imgChecked:String,imgUnchecked:String, checkState:Bool = True)
Description:Creates a new checkbox.
Return type:ftGuiCheckbox
Parameters:
NameTypeValue
imgCheckedString
imgUncheckedString
checkStateBoolTrue
Method CreateJoyStick:ftGuiJoystick(imgRing:String, imgStick:String)

Syntax:


ftGuiJoystick = ftGuiMng.CreateJoyStick (imgRing:String, imgStick:String)
Description:Creates a new analog joystick.
Return type:ftGuiJoystick
Parameters:
NameTypeValue
imgRingString
imgStickString
Method CreateLabel:ftGuiLabel(txt:String, shadowed:Bool = False)

Syntax:


ftGuiLabel = ftGuiMng.CreateLabel (txt:String, shadowed:Bool = False)
Description:Creates a new label.
Return type:ftGuiLabel
Parameters:
NameTypeValue
txtString
shadowedBoolFalse
Method CreateListview:ftGuiListview(x:Float, y:Float, w:Float, h:Float, newLines:String)

Syntax:


ftGuiListview = ftGuiMng.CreateListview (x:Float, y:Float, w:Float, h:Float, newLines:String)
Description:Creates a new listview.
Return type:ftGuiListview
Parameters:
NameTypeValue
xFloat
yFloat
wFloat
hFloat
newLinesString
Method CreateSlider:ftGuiSlider(imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal)

Syntax:


ftGuiSlider = ftGuiMng.CreateSlider (imgSliderBar:String, imgSliderKnob:String, startVal:Float, rangeVal:Float, orientation:Int = ftGuiMng.slHorizontal)
Description:Creates a slider.
Return type:ftGuiSlider
Parameters:
NameTypeValue
imgSliderBarString
imgSliderKnobString
startValFloat
rangeValFloat
orientationIntftGuiMng.slHorizontal
Method CreateSwitch:ftGuiSwitch(imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True)

Syntax:


ftGuiSwitch = ftGuiMng.CreateSwitch (imgSwitchOn:String,imgSwitchOff:String, switchState:Bool = True)
Description:Creates a new switch.
Return type:ftGuiSwitch
Parameters:
NameTypeValue
imgSwitchOnString
imgSwitchOffString
switchStateBoolTrue
Method CreateTextfield:ftGuiTextfield(txt:String, shadowed:Bool = False)

Syntax:


ftGuiTextfield = ftGuiMng.CreateTextfield (txt:String, shadowed:Bool = False)
Description:Creates a new textfield.
Return type:ftGuiTextfield
Parameters:
NameTypeValue
txtString
shadowedBoolFalse
Method New(eng:ftEngine)

Syntax:


none = ftGuiMng.New (eng:ftEngine)
Description:Creates a new joypad manager.
Return type:none
Parameters:
NameTypeValue
engftEngine
Method Update:Void(delta:Float=1.0)

Syntax:


ftGuiMng.Update (delta:Float=1.0)
Description:Updates all states of gui elements.
Parameters:
NameTypeValue
deltaFloat1.0
Const idButton:Int = 1112
Type:Int
Value:1112
Const idChkBox:Int = 1114
Type:Int
Value:1114
Const idJoyStick:Int = 1111
Type:Int
Value:1111
Const idLabel:Int = 1116
Type:Int
Value:1116
Const idListview:Int = 1115
Type:Int
Value:1115
Const idSlider:Int = 1119
Type:Int
Value:1119
Const idSwitch:Int = 1113
Type:Int
Value:1113
Const idTextfield:Int = 1121
Type:Int
Value:1121
Const slHorizontal:Int = 1
Type:Int
Value:1
Const slVertical:Int = 2
Type:Int
Value:2
Field font1:ftFont = Null
Type:ftFont
Value:Null
Field objList := New List
Type:= New List
Class ftGuiSlider Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • GetValue   ( Method GetValue:Float() )
  • SetRange   ( Method SetRange:Void(startVal:Float, rangeVal:Float) )
  • isHit   ( Method isHit:Bool() )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiSlider.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method GetValue:Float()

Syntax:


Float = ftGuiSlider.GetValue ()
Description:Returns the current value of the slider
Return type:Float
Method SetRange:Void(startVal:Float, rangeVal:Float)

Syntax:


ftGuiSlider.SetRange (startVal:Float, rangeVal:Float)
Description:Sets the range of the slider.
Parameters:
NameTypeValue
startValFloat
rangeValFloat
Method isHit:Bool()

Syntax:


Bool = ftGuiSlider.isHit ()
Description:Returns the hit state of the slider
Return type:Bool
Class ftGuiSwitch Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • SetState   ( Method SetState:Void(switchState:Bool) )

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftGuiSwitch.CheckTouchHit (px:Float, py:Float)
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Method SetState:Void(switchState:Bool)

Syntax:


ftGuiSwitch.SetState (switchState:Bool)
Description:Sets the switch state of the switch. TRUE means it is ON.
Parameters:
NameTypeValue
switchStateBool
Class ftGuiTextfield Extends ftGuiGadget
Changes:New in version 1.57.
Table of contents:Methods:
  • GetFocus   ( Method GetFocus:bool() )
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )
  • SetFocus   ( Method SetFocus:Void(focus:Bool = True) )
  • SetShadowOffset   ( Method SetShadowOffset:Void(xOff:Float, yOff:Float) )
  • Update   ( Method Update:Void(delta:Float=1.0) )

Fields:
  • hasFocus ( Field hasFocus:Bool = True )
  • hasShadow ( Field hasShadow:Bool = False )
  • shadowX ( Field shadowX:Float = 2.0 )
  • shadowY ( Field shadowY:Float = 2.0 )

Method GetFocus:bool()

Syntax:


bool = ftGuiTextfield.GetFocus ()
Return type:bool
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftGuiTextfield.Render (xoff:Float=0.0, yoff:Float=0.0)
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method SetFocus:Void(focus:Bool = True)

Syntax:


ftGuiTextfield.SetFocus (focus:Bool = True)
Parameters:
NameTypeValue
focusBoolTrue
Method SetShadowOffset:Void(xOff:Float, yOff:Float)

Syntax:


ftGuiTextfield.SetShadowOffset (xOff:Float, yOff:Float)
Parameters:
NameTypeValue
xOffFloat
yOffFloat
Method Update:Void(delta:Float=1.0)

Syntax:


ftGuiTextfield.Update (delta:Float=1.0)
Parameters:
NameTypeValue
deltaFloat1.0
Field hasFocus:Bool = True
Type:Bool
Value:True
Field hasShadow:Bool = False
Type:Bool
Value:False
Field shadowX:Float = 2.0
Type:Float
Value:2.0
Field shadowY:Float = 2.0
Type:Float
Value:2.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftHighscore.monkey.html b/docs/cftHighscore.monkey.html index 7cfcb5e..f87d02c 100644 --- a/docs/cftHighscore.monkey.html +++ b/docs/cftHighscore.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftHighscore -

Module fantomEngine.cftHighscore


The module cftHighScore adds an easy to manage local highscore list to your game.

Table of contents:

Classes:

Class ftHighScoreList
Description:The class ftHighScoreList offers a complete set of methods for storing and retrieving high-score list entries.
Table of contents:Methods:
  • AddScore   ( Method AddScore:Int(value:Int, n:String="") )
  • Clear   ( Method Clear:Void() )
  • Count   ( Method Count:Int() )
  • GetName   ( Method GetName:String(i:Int) )
  • GetValue   ( Method GetValue:Int(i:Int) )
  • LoadFromString   ( Method LoadFromString:Void(hs:String) )
  • SaveToString   ( Method SaveToString:String() )
  • SetCount   ( Method SetCount:Void(count:Int = 10) )

Method AddScore:Int(value:Int, n:String="")

Syntax:


Int = ftHighScoreList.AddScore (value:Int, n:String="")
Description:Tries to add a new entry to the list. Returns the new rank if it is in the list. Returns 0 if not.
Return type:Int
Parameters:
NameTypeValue
valueInt
nString""
Method Clear:Void()

Syntax:


ftHighScoreList.Clear ()
Description:Clears the complete high-score list.
Method Count:Int()

Syntax:


Int = ftHighScoreList.Count ()
Description:Get the numbers of entries.
Return type:Int
Method GetName:String(i:Int)

Syntax:


String = ftHighScoreList.GetName (i:Int)
Description:Get the name of an entry.
Return type:String
Parameters:
NameTypeValue
iInt
Method GetValue:Int(i:Int)

Syntax:


Int = ftHighScoreList.GetValue (i:Int)
Description:Get the value of an entry.
Return type:Int
Parameters:
NameTypeValue
iInt
Method LoadFromString:Void(hs:String)

Syntax:


ftHighScoreList.LoadFromString (hs:String)
Description:Load a high-score list from a string.
Parameters:
NameTypeValue
hsString
Method SaveToString:String()

Syntax:


String = ftHighScoreList.SaveToString ()
Description:Save the high-score list to a string.
Return type:String
Method SetCount:Void(count:Int = 10)

Syntax:


ftHighScoreList.SetCount (count:Int = 10)
Description:Set the number of highscore entries.
Parameters:
NameTypeValue
countInt10
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftHighscore


The module cftHighScore adds an easy to manage local highscore list to your game.

Table of contents:

Classes:

Class ftHighScoreList
Description:The class ftHighScoreList offers a complete set of methods for storing and retrieving high-score list entries.
Table of contents:Methods:
  • AddScore   ( Method AddScore:Int(value:Int, n:String="") )
  • Clear   ( Method Clear:Void() )
  • Count   ( Method Count:Int() )
  • GetName   ( Method GetName:String(i:Int) )
  • GetValue   ( Method GetValue:Int(i:Int) )
  • LoadFromString   ( Method LoadFromString:Void(hs:String) )
  • SaveToString   ( Method SaveToString:String() )
  • SetCount   ( Method SetCount:Void(count:Int = 10) )

Method AddScore:Int(value:Int, n:String="")

Syntax:


Int = ftHighScoreList.AddScore (value:Int, n:String="")
Description:Tries to add a new entry to the list. Returns the new rank if it is in the list. Returns 0 if not.
Return type:Int
Parameters:
NameTypeValue
valueInt
nString""
Method Clear:Void()

Syntax:


ftHighScoreList.Clear ()
Description:Clears the complete high-score list.
Method Count:Int()

Syntax:


Int = ftHighScoreList.Count ()
Description:Get the numbers of entries.
Return type:Int
Method GetName:String(i:Int)

Syntax:


String = ftHighScoreList.GetName (i:Int)
Description:Get the name of an entry.
Return type:String
Parameters:
NameTypeValue
iInt
Method GetValue:Int(i:Int)

Syntax:


Int = ftHighScoreList.GetValue (i:Int)
Description:Get the value of an entry.
Return type:Int
Parameters:
NameTypeValue
iInt
Method LoadFromString:Void(hs:String)

Syntax:


ftHighScoreList.LoadFromString (hs:String)
Description:Load a high-score list from a string.
Parameters:
NameTypeValue
hsString
Method SaveToString:String()

Syntax:


String = ftHighScoreList.SaveToString ()
Description:Save the high-score list to a string.
Return type:String
Method SetCount:Void(count:Int = 10)

Syntax:


ftHighScoreList.SetCount (count:Int = 10)
Description:Set the number of highscore entries.
Parameters:
NameTypeValue
countInt10
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftImageMng.monkey.html b/docs/cftImageMng.monkey.html index 96c5414..c3d4bd0 100644 --- a/docs/cftImageMng.monkey.html +++ b/docs/cftImageMng.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftImageMng -

Module fantomEngine.cftImageMng


The module cftImageMng contains several classes to manage loaded images inside your game.

Table of contents:

Classes:

Class ftImage
Description:The ftImage class contains a mojo image and some information about.
Table of contents:Methods:
  • GetFrameCount   ( Method GetFrameCount:Int() )
  • GetFrameHeight   ( Method GetFrameHeight:Int() )
  • GetFrameWidth   ( Method GetFrameWidth:Int() )
  • GetImage   ( Method GetImage:Image() )
  • GetPath   ( Method GetPath:String() )
  • ReLoad   ( Method ReLoad:Void() )
  • Remove   ( Method Remove:Void(discard:Bool = False) )
  • SetPath   ( Method SetPath:String(filePath:String) )   New in version 1.54.

Method GetFrameCount:Int()

Syntax:


Int = ftImage.GetFrameCount ()
Description:Returns the frame count of a ftImage.
Return type:Int
Method GetFrameHeight:Int()

Syntax:


Int = ftImage.GetFrameHeight ()
Description:Returns the frame height of a ftImage.
Return type:Int
Method GetFrameWidth:Int()

Syntax:


Int = ftImage.GetFrameWidth ()
Description:Returns the frame width of a ftImage.
Return type:Int
Method GetImage:Image()

Syntax:


Image = ftImage.GetImage ()
Return type:Image
Method GetPath:String()

Syntax:


String = ftImage.GetPath ()
Description:Returns the path (filename) of a ftImage.
Return type:String
Method ReLoad:Void()

Syntax:


ftImage.ReLoad ()
Description:Reloads an image.
Method Remove:Void(discard:Bool = False)

Syntax:


ftImage.Remove (discard:Bool = False)
Description:Removes an ftImage.
Parameters:
NameTypeValue
discardBoolFalse
Method SetPath:String(filePath:String)

Syntax:


String = ftImage.SetPath (filePath:String)
Changes:New in version 1.54.
Description:Sets the path (filename) of a ftImage.
Return type:String
Parameters:
NameTypeValue
filePathString
Class ftImageManager
Description:The ftImageManager class handles all images for fantomEngine.
Table of contents:Methods:
  • GrabImage   ( Method GrabImage:ftImage(atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags) )
  • GrabImage   ( Method GrabImage:ftImage(atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags) )
  • LoadImage   ( Method LoadImage:ftImage(image:Image) )
  • LoadImage   ( Method LoadImage:ftImage(path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags) )
  • LoadImage   ( Method LoadImage:ftImage(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags) )
  • ReLoadAllImages   ( Method ReLoadAllImages:Void() )
  • RemoveAllImages   ( Method RemoveAllImages:Void(discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(image:Image, discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(filepath:String, discard:Bool = False) )

Method GrabImage:ftImage(atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.GrabImage (atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Creates an ftImage by grabbing it from a ftImage atlas.
Return type:ftImage
Parameters:
NameTypeValue
atlasftImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method GrabImage:ftImage(atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.GrabImage (atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Creates an ftImage by grabbing it from a Image atlas.
Return type:ftImage
Parameters:
NameTypeValue
atlasImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method LoadImage:ftImage(image:Image)

Syntax:


ftImage = ftImageManager.LoadImage (image:Image)
Description:Creates an ftImage from an image.
Return type:ftImage
Parameters:
NameTypeValue
imageImage
Method LoadImage:ftImage(path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.LoadImage (path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags)
Description:Loads an image like mogo.LoadImage.
Return type:ftImage
Parameters:
NameTypeValue
pathString
frameCountInt1
flagsIntImage.DefaultFlags
Method LoadImage:ftImage(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.LoadImage (path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Loads an image like mogo.LoadImage.
Return type:ftImage
Parameters:
NameTypeValue
pathString
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method ReLoadAllImages:Void()

Syntax:


ftImageManager.ReLoadAllImages ()
Description:Reload all images.
Method RemoveAllImages:Void(discard:Bool = False)

Syntax:


ftImageManager.RemoveAllImages (discard:Bool = False)
Description:Removes all images from the image handler.
Parameters:
NameTypeValue
discardBoolFalse
Method RemoveImage:Void(image:Image, discard:Bool = False)

Syntax:


ftImageManager.RemoveImage (image:Image, discard:Bool = False)
Description:Removes an image from the image handler by the given Image handle.
Parameters:
NameTypeValue
imageImage
discardBoolFalse
Method RemoveImage:Void(filepath:String, discard:Bool = False)

Syntax:


ftImageManager.RemoveImage (filepath:String, discard:Bool = False)
Description:Removes an image from the image handler by the given filename.
Parameters:
NameTypeValue
filepathString
discardBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftImageMng


The module cftImageMng contains several classes to manage loaded images inside your game.

Table of contents:

Classes:

Class ftImage
Description:The ftImage class contains a mojo image and some information about.
Table of contents:Methods:
  • GetFrameCount   ( Method GetFrameCount:Int() )
  • GetFrameHeight   ( Method GetFrameHeight:Int() )
  • GetFrameWidth   ( Method GetFrameWidth:Int() )
  • GetImage   ( Method GetImage:Image() )
  • GetPath   ( Method GetPath:String() )
  • ReLoad   ( Method ReLoad:Void() )
  • Remove   ( Method Remove:Void(discard:Bool = False) )
  • SetPath   ( Method SetPath:String(filePath:String) )   New in version 1.54.

Method GetFrameCount:Int()

Syntax:


Int = ftImage.GetFrameCount ()
Description:Returns the frame count of a ftImage.
Return type:Int
Method GetFrameHeight:Int()

Syntax:


Int = ftImage.GetFrameHeight ()
Description:Returns the frame height of a ftImage.
Return type:Int
Method GetFrameWidth:Int()

Syntax:


Int = ftImage.GetFrameWidth ()
Description:Returns the frame width of a ftImage.
Return type:Int
Method GetImage:Image()

Syntax:


Image = ftImage.GetImage ()
Return type:Image
Method GetPath:String()

Syntax:


String = ftImage.GetPath ()
Description:Returns the path (filename) of a ftImage.
Return type:String
Method ReLoad:Void()

Syntax:


ftImage.ReLoad ()
Description:Reloads an image.
Method Remove:Void(discard:Bool = False)

Syntax:


ftImage.Remove (discard:Bool = False)
Description:Removes an ftImage.
Parameters:
NameTypeValue
discardBoolFalse
Method SetPath:String(filePath:String)

Syntax:


String = ftImage.SetPath (filePath:String)
Changes:New in version 1.54.
Description:Sets the path (filename) of a ftImage.
Return type:String
Parameters:
NameTypeValue
filePathString
Class ftImageManager
Description:The ftImageManager class handles all images for fantomEngine.
Table of contents:Methods:
  • GrabImage   ( Method GrabImage:ftImage(atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags) )
  • GrabImage   ( Method GrabImage:ftImage(atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags) )
  • LoadImage   ( Method LoadImage:ftImage(image:Image) )
  • LoadImage   ( Method LoadImage:ftImage(path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags) )
  • LoadImage   ( Method LoadImage:ftImage(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags) )
  • ReLoadAllImages   ( Method ReLoadAllImages:Void() )
  • RemoveAllImages   ( Method RemoveAllImages:Void(discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(image:Image, discard:Bool = False) )
  • RemoveImage   ( Method RemoveImage:Void(filepath:String, discard:Bool = False) )

Method GrabImage:ftImage(atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.GrabImage (atlas:ftImage, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Creates an ftImage by grabbing it from a ftImage atlas.
Return type:ftImage
Parameters:
NameTypeValue
atlasftImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method GrabImage:ftImage(atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.GrabImage (atlas:Image, frameStartX:Int,frameStartY:Int,frameWidth:Int,frameHeight:Int,frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Creates an ftImage by grabbing it from a Image atlas.
Return type:ftImage
Parameters:
NameTypeValue
atlasImage
frameStartXInt
frameStartYInt
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method LoadImage:ftImage(image:Image)

Syntax:


ftImage = ftImageManager.LoadImage (image:Image)
Description:Creates an ftImage from an image.
Return type:ftImage
Parameters:
NameTypeValue
imageImage
Method LoadImage:ftImage(path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.LoadImage (path:String, frameCount:Int=1, flags:Int=Image.DefaultFlags)
Description:Loads an image like mogo.LoadImage.
Return type:ftImage
Parameters:
NameTypeValue
pathString
frameCountInt1
flagsIntImage.DefaultFlags
Method LoadImage:ftImage(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags)

Syntax:


ftImage = ftImageManager.LoadImage (path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.DefaultFlags)
Description:Loads an image like mogo.LoadImage.
Return type:ftImage
Parameters:
NameTypeValue
pathString
frameWidthInt
frameHeightInt
frameCountInt
flagsIntImage.DefaultFlags
Method ReLoadAllImages:Void()

Syntax:


ftImageManager.ReLoadAllImages ()
Description:Reload all images.
Method RemoveAllImages:Void(discard:Bool = False)

Syntax:


ftImageManager.RemoveAllImages (discard:Bool = False)
Description:Removes all images from the image handler.
Parameters:
NameTypeValue
discardBoolFalse
Method RemoveImage:Void(image:Image, discard:Bool = False)

Syntax:


ftImageManager.RemoveImage (image:Image, discard:Bool = False)
Description:Removes an image from the image handler by the given Image handle.
Parameters:
NameTypeValue
imageImage
discardBoolFalse
Method RemoveImage:Void(filepath:String, discard:Bool = False)

Syntax:


ftImageManager.RemoveImage (filepath:String, discard:Bool = False)
Description:Removes an image from the image handler by the given filename.
Parameters:
NameTypeValue
filepathString
discardBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftKeyMapping.monkey.html b/docs/cftKeyMapping.monkey.html index 69eecdb..7a9b61e 100644 --- a/docs/cftKeyMapping.monkey.html +++ b/docs/cftKeyMapping.monkey.html @@ -8,7 +8,7 @@ fantomEngine.cftKeyMapping -

Module fantomEngine.cftKeyMapping


The module cftKeyMapping contains ...

Table of contents:

Classes:

Class ftKeyMapping
Description:The class ftKeyMapping is an object which helps you supporting different key maps in your app.
Table of contents:Methods:
  • Clear   ( Method Clear:Void() )
  • GetKey   ( Method GetKey:Int(keyCode:Int) )
  • LoadFromString   ( Method LoadFromString:Void(mapStr:String) )
  • SaveToString   ( Method SaveToString:String() )
  • SetKey   ( Method SetKey:Void(keyCode:Int, mapCode:Int) )

Method Clear:Void()

Syntax:


ftKeyMapping.Clear ()
Description:This method clears all the mapping data.
Method GetKey:Int(keyCode:Int)

Syntax:


Int = ftKeyMapping.GetKey (keyCode:Int)
Description:This method returns the mapped key code.
Return type:Int
Parameters:
NameTypeValue
keyCodeInt
Details:If no mapping is found, it will return the given key code.
Method LoadFromString:Void(mapStr:String)

Syntax:


ftKeyMapping.LoadFromString (mapStr:String)
Description:This method loads the keymapping class via a string
Parameters:
NameTypeValue
mapStrString
Details:The format of the string has to be (key;mappedKey~nkey;mappedKey...):
65;32
67;33
Example:
Strict
+

Module fantomEngine.cftKeyMapping


The module cftKeyMapping contains ...

Table of contents:

Classes:

Class ftKeyMapping
Description:The class ftKeyMapping is an object which helps you supporting different key maps in your app.
Table of contents:Methods:
  • Clear   ( Method Clear:Void() )
  • GetKey   ( Method GetKey:Int(keyCode:Int) )
  • LoadFromString   ( Method LoadFromString:Void(mapStr:String) )
  • SaveToString   ( Method SaveToString:String() )
  • SetKey   ( Method SetKey:Void(keyCode:Int, mapCode:Int) )

Method Clear:Void()

Syntax:


ftKeyMapping.Clear ()
Description:This method clears all the mapping data.
Method GetKey:Int(keyCode:Int)

Syntax:


Int = ftKeyMapping.GetKey (keyCode:Int)
Description:This method returns the mapped key code.
Return type:Int
Parameters:
NameTypeValue
keyCodeInt
Details:If no mapping is found, it will return the given key code.
Method LoadFromString:Void(mapStr:String)

Syntax:


ftKeyMapping.LoadFromString (mapStr:String)
Description:This method loads the keymapping class via a string
Parameters:
NameTypeValue
mapStrString
Details:The format of the string has to be (key;mappedKey~nkey;mappedKey...):
65;32
67;33
Example:
Strict
 
 #rem
 	Script:			KeyMapping.monkey
@@ -129,5 +129,5 @@ 

Module fantomEngine.cftKeyMapping

Method SaveToString:String()

Syntax:


String = ftKeyMapping.SaveToString ()
Description:This method saves the key mapping data to a string.
Return type:String
Method SetKey:Void(keyCode:Int, mapCode:Int)

Syntax:


ftKeyMapping.SetKey (keyCode:Int, mapCode:Int)
Description:This method sets the mapping of a key code.
Parameters:
NameTypeValue
keyCodeInt
mapCodeInt
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+
Method SaveToString:String()

Syntax:


String = ftKeyMapping.SaveToString ()
Description:This method saves the key mapping data to a string.
Return type:String
Method SetKey:Void(keyCode:Int, mapCode:Int)

Syntax:


ftKeyMapping.SetKey (keyCode:Int, mapCode:Int)
Description:This method sets the mapping of a key code.
Parameters:
NameTypeValue
keyCodeInt
mapCodeInt
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftLayer.monkey.html b/docs/cftLayer.monkey.html index cbf52cf..bf5bd3a 100644 --- a/docs/cftLayer.monkey.html +++ b/docs/cftLayer.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftLayer -

Module fantomEngine.cftLayer


The module cftLayer contains the ftLayer class and the lObjList class with is a sub object for the ftLayer class.

Table of contents:

Classes:

Class ftLayer
Description:The class ftLayer groups assigned objects. A layer then will update, render, touch and collision check all its objects together in one batch.
Table of contents:Methods:
  • CollisionCheck   ( Method CollisionCheck:Void() )   changed in v1.56
  • CollisionCheck   ( Method CollisionCheck:Void(obj:ftObject) )   changed in v1.56
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • GetActive   ( Method GetActive:Bool() )
  • GetAlpha   ( Method GetAlpha:Float() )
  • GetID   ( Method GetID:Int () )
  • GetObj   ( Method GetObj:ftObject(index:Int) )
  • GetObjAt   ( Method GetObjAt:ftObject(x:Float, y:Float) )
  • GetObjCount   ( Method GetObjCount:Int(countType:Int=0) )
  • GetObjTransCount   ( Method GetObjTransCount:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • GetScale   ( Method GetScale:Float() )
  • GetTag   ( Method GetTag:Int () )
  • GetTransitionCount   ( Method GetTransitionCount:Int () )   New in version 1.55
  • GetVisible   ( Method GetVisible:Bool() )
  • Remove   ( Method Remove:Void(delObjects:Bool = False) )   Fixed in version 1.57
  • RemoveAllObjects   ( Method RemoveAllObjects:Void() )
  • RemoveAllObjectsByID   ( Method RemoveAllObjectsByID:Void(objID:Int) )
  • Render   ( Method Render:Void() )   Changed in v1.55.
  • SetActive   ( Method SetActive:Void(activeFlag:Bool) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Int=False) )
  • SetGUI   ( Method SetGUI:Void (guiFlag:Bool ) )
  • SetID   ( Method SetID:Void (layerID:Int ) )
  • SetLayerScissor   ( Method SetLayerScissor:Void(offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0) )   New in v1.55.
  • SetPos   ( Method SetPos:Void (x:Float, y:Float, relative:Int = False ) )
  • SetPosX   ( Method SetPosX:Void (x:Float, relative:Int = False ) )
  • SetPosY   ( Method SetPosY:Void (y:Float, relative:Int = False ) )
  • SetScale   ( Method SetScale:Void (scaleFactor:Float, relative:Int = False ) )
  • SetTag   ( Method SetTag:Void (newTag:Int ) )
  • SetVisible   ( Method SetVisible:Void(visibleFlag:Bool) )
  • SortObjects   ( Method SortObjects:Void() )
  • TouchCheck   ( Method TouchCheck:Void(x:Float, y:Float, touchID:Int) )   Changed in v1.56
  • Update   ( Method Update:Void(speed:Float=1.0) )

Method CollisionCheck:Void()

Syntax:


ftLayer.CollisionCheck ()
Changes:changed in v1.56
Description:Does a collision check on all active objects of this layer with a assigned collision group.
Details:If a collision appears, ftEngine.OnObjectCollision is called.
Method CollisionCheck:Void(obj:ftObject)

Syntax:


ftLayer.CollisionCheck (obj:ftObject)
Changes:changed in v1.56
Description:Does a collision check on the given object.
Parameters:
NameTypeValue
objftObject
Details:The object needs to be active. If a collision appears, ftEngine.OnObjectCollision is called.
Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftLayer.CreateTransAlpha (alpha:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create an alpha transition for the layer.
Return type:ftTrans
Parameters:
NameTypeValue
alphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftLayer.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a position transition.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method.
Method GetActive:Bool()

Syntax:


Bool = ftLayer.GetActive ()
Description:Returns if a layer is active or not.
Return type:Bool
Method GetAlpha:Float()

Syntax:


Float = ftLayer.GetAlpha ()
Description:Returns the alpha value of a given layer, ranging from 0.0 to 1.0.
Return type:Float
Method GetID:Int ()

Syntax:


Int = ftLayer.GetID ()
Description:Returns the layer ID value.
Return type:Int
Method GetObj:ftObject(index:Int)

Syntax:


ftObject = ftLayer.GetObj (index:Int)
Description:Returns the object with the given index of a layer. Index starts with 1.
Return type:ftObject
Parameters:
NameTypeValue
indexInt
Method GetObjAt:ftObject(x:Float, y:Float)

Syntax:


ftObject = ftLayer.GetObjAt (x:Float, y:Float)
Description:Returns the first active object found at the given coordinates.
Return type:ftObject
Parameters:
NameTypeValue
xFloat
yFloat
Method GetObjCount:Int(countType:Int=0)

Syntax:


Int = ftLayer.GetObjCount (countType:Int=0)
Description:Returns the number of objects in a layer.
Return type:Int
Parameters:
NameTypeValue
countTypeInt0
Details:Type=0 >>> All objects are counted
Type=1 >>> Only active objects are counted
Type=2 >>> Only active and visible objects are counted
Method GetObjTransCount:Int()

Syntax:


Int = ftLayer.GetObjTransCount ()
Description:Returns the number of active transitions from all objects in a layer.
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftLayer.GetPos ()
Description:Returns the position of a layer in a 2D Float array.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftLayer.GetPosX ()
Description:Returns the X position of a layer.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftLayer.GetPosY ()
Description:Returns the Y position of a layer.
Return type:Float
Method GetScale:Float()

Syntax:


Float = ftLayer.GetScale ()
Description:Returns the scale factor of a layer.
Return type:Float
Method GetTag:Int ()

Syntax:


Int = ftLayer.GetTag ()
Description:Returns the layer tag value.
Return type:Int
Method GetTransitionCount:Int ()

Syntax:


Int = ftLayer.GetTransitionCount ()
Changes:New in version 1.55
Description:Returns the amount of active transitions of the layer.
Return type:Int
Method GetVisible:Bool()

Syntax:


Bool = ftLayer.GetVisible ()
Description:Returns if a given layer is visible or not.
Return type:Bool
Method Remove:Void(delObjects:Bool = False)

Syntax:


ftLayer.Remove (delObjects:Bool = False)
Changes:Fixed in version 1.57
Description:Removes this layer from the engine. If the delObjects flag is set to TRUE, then it will remove all attached objects too.
Parameters:
NameTypeValue
delObjectsBoolFalse
Method RemoveAllObjects:Void()

Syntax:


ftLayer.RemoveAllObjects ()
Description:Removes all objects assigned to a layer.
Method RemoveAllObjectsByID:Void(objID:Int)

Syntax:


ftLayer.RemoveAllObjectsByID (objID:Int)
Description:Removes all objects with the given ID and assigned to the layer.
Parameters:
NameTypeValue
objIDInt
Method Render:Void()

Syntax:


ftLayer.Render ()
Changes:Changed in v1.55.
Description:Render all visible and active objects of a layer.
Details:Objects are normally rendered in their order of creation, unless you have sorted the objects of a layer via the ftLayer.SortObjects method.
Child objects are rendered right after their parent.
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftLayer.SetActive (activeFlag:Bool)
Description:Set the active flag of a layer.
Parameters:
NameTypeValue
activeFlagBool
Method SetAlpha:Void(newAlpha:Float, relative:Int=False)

Syntax:


ftLayer.SetAlpha (newAlpha:Float, relative:Int=False)
Description:Set the alpha value of a layer, ranging from 0.0 (invisible) to 1.0 (fully visible).
Parameters:
NameTypeValue
newAlphaFloat
relativeIntFalse
Method SetGUI:Void (guiFlag:Bool )

Syntax:


ftLayer.SetGUI (guiFlag:Bool)
Description:Sets the layer GUI flag. When rendering a GUI layer, camera positions are not taken into a calculation of the position of this layer.
Parameters:
NameTypeValue
guiFlagBool
Method SetID:Void (layerID:Int )

Syntax:


ftLayer.SetID (layerID:Int)
Description:Sets the layer ID field with any value.
Parameters:
NameTypeValue
layerIDInt
Method SetLayerScissor:Void(offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0)

Syntax:


ftLayer.SetLayerScissor (offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0)
Changes:New in v1.55.
Description:Sets the offset of the scissor for this layer.
Parameters:
NameTypeValue
offXFloat0.0
offYFloat0.0
offWidthFloat0.0
offHeightFloat0.0
Method SetPos:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftLayer.SetPos (x:Float, y:Float, relative:Int = False)
Description:Set the X and Y position of a layer.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Method SetPosX:Void (x:Float, relative:Int = False )

Syntax:


ftLayer.SetPosX (x:Float, relative:Int = False)
Description:Set the X position of a layer.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Method SetPosY:Void (y:Float, relative:Int = False )

Syntax:


ftLayer.SetPosY (y:Float, relative:Int = False)
Description:Set the Y position of a layer.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Method SetScale:Void (scaleFactor:Float, relative:Int = False )

Syntax:


ftLayer.SetScale (scaleFactor:Float, relative:Int = False)
Description:Set the scale factor of a layer.
Parameters:
NameTypeValue
scaleFactorFloat
relativeIntFalse
Method SetTag:Void (newTag:Int )

Syntax:


ftLayer.SetTag (newTag:Int)
Description:Sets the layer tag field with any value.
Parameters:
NameTypeValue
newTagInt
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftLayer.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of a layer.
Parameters:
NameTypeValue
visibleFlagBool
Method SortObjects:Void()

Syntax:


ftLayer.SortObjects ()
Description:Sorts the object list of a layer.
Details:Internally it will call the ftEngine.OnObjectSort method.
Overwrite that method to get a different sorting. The default sorting will sort objects by their Z coordinate.
Method TouchCheck:Void(x:Float, y:Float, touchID:Int)

Syntax:


ftLayer.TouchCheck (x:Float, y:Float, touchID:Int)
Changes:Changed in v1.56
Description:Executes a touch check to each object at the given position.
Parameters:
NameTypeValue
xFloat
yFloat
touchIDInt
Details:The object has to have a touchmode > 0 and needs to be active.
If a touch of an object was detected, then the ftEngine.OnObjectTouch method is called with the object and the touchID as a parameter.
Method Update:Void(speed:Float=1.0)

Syntax:


ftLayer.Update (speed:Float=1.0)
Description:Updates all transitions and objects of a layer.
Parameters:
NameTypeValue
speedFloat1.0
Details:The speed parameter will be used to automatically update the objects.
After the layer was updated and the engine is not paused, the ftEngine.OnLayerUpdate method is called.
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftLayer


The module cftLayer contains the ftLayer class and the lObjList class with is a sub object for the ftLayer class.

Table of contents:

Classes:

Class ftLayer
Description:The class ftLayer groups assigned objects. A layer then will update, render, touch and collision check all its objects together in one batch.
Table of contents:Methods:
  • CollisionCheck   ( Method CollisionCheck:Void() )   changed in v1.56
  • CollisionCheck   ( Method CollisionCheck:Void(obj:ftObject) )   changed in v1.56
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • GetActive   ( Method GetActive:Bool() )
  • GetAlpha   ( Method GetAlpha:Float() )
  • GetID   ( Method GetID:Int () )
  • GetObj   ( Method GetObj:ftObject(index:Int) )
  • GetObjAt   ( Method GetObjAt:ftObject(x:Float, y:Float) )
  • GetObjCount   ( Method GetObjCount:Int(countType:Int=0) )
  • GetObjTransCount   ( Method GetObjTransCount:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • GetScale   ( Method GetScale:Float() )
  • GetTag   ( Method GetTag:Int () )
  • GetTransitionCount   ( Method GetTransitionCount:Int () )   New in version 1.55
  • GetVisible   ( Method GetVisible:Bool() )
  • Remove   ( Method Remove:Void(delObjects:Bool = False) )   Fixed in version 1.57
  • RemoveAllObjects   ( Method RemoveAllObjects:Void() )
  • RemoveAllObjectsByID   ( Method RemoveAllObjectsByID:Void(objID:Int) )
  • Render   ( Method Render:Void() )   Changed in v1.55.
  • SetActive   ( Method SetActive:Void(activeFlag:Bool) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Int=False) )
  • SetGUI   ( Method SetGUI:Void (guiFlag:Bool ) )
  • SetID   ( Method SetID:Void (layerID:Int ) )
  • SetLayerScissor   ( Method SetLayerScissor:Void(offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0) )   New in v1.55.
  • SetPos   ( Method SetPos:Void (x:Float, y:Float, relative:Int = False ) )
  • SetPosX   ( Method SetPosX:Void (x:Float, relative:Int = False ) )
  • SetPosY   ( Method SetPosY:Void (y:Float, relative:Int = False ) )
  • SetScale   ( Method SetScale:Void (scaleFactor:Float, relative:Int = False ) )
  • SetTag   ( Method SetTag:Void (newTag:Int ) )
  • SetVisible   ( Method SetVisible:Void(visibleFlag:Bool) )
  • SortObjects   ( Method SortObjects:Void() )
  • TouchCheck   ( Method TouchCheck:Void(x:Float, y:Float, touchID:Int) )   Changed in v1.56
  • Update   ( Method Update:Void(speed:Float=1.0) )

Method CollisionCheck:Void()

Syntax:


ftLayer.CollisionCheck ()
Changes:changed in v1.56
Description:Does a collision check on all active objects of this layer with a assigned collision group.
Details:If a collision appears, ftEngine.OnObjectCollision is called.
Method CollisionCheck:Void(obj:ftObject)

Syntax:


ftLayer.CollisionCheck (obj:ftObject)
Changes:changed in v1.56
Description:Does a collision check on the given object.
Parameters:
NameTypeValue
objftObject
Details:The object needs to be active. If a collision appears, ftEngine.OnObjectCollision is called.
Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftLayer.CreateTransAlpha (alpha:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create an alpha transition for the layer.
Return type:ftTrans
Parameters:
NameTypeValue
alphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftLayer.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a position transition.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method.
Method GetActive:Bool()

Syntax:


Bool = ftLayer.GetActive ()
Description:Returns if a layer is active or not.
Return type:Bool
Method GetAlpha:Float()

Syntax:


Float = ftLayer.GetAlpha ()
Description:Returns the alpha value of a given layer, ranging from 0.0 to 1.0.
Return type:Float
Method GetID:Int ()

Syntax:


Int = ftLayer.GetID ()
Description:Returns the layer ID value.
Return type:Int
Method GetObj:ftObject(index:Int)

Syntax:


ftObject = ftLayer.GetObj (index:Int)
Description:Returns the object with the given index of a layer. Index starts with 1.
Return type:ftObject
Parameters:
NameTypeValue
indexInt
Method GetObjAt:ftObject(x:Float, y:Float)

Syntax:


ftObject = ftLayer.GetObjAt (x:Float, y:Float)
Description:Returns the first active object found at the given coordinates.
Return type:ftObject
Parameters:
NameTypeValue
xFloat
yFloat
Method GetObjCount:Int(countType:Int=0)

Syntax:


Int = ftLayer.GetObjCount (countType:Int=0)
Description:Returns the number of objects in a layer.
Return type:Int
Parameters:
NameTypeValue
countTypeInt0
Details:Type=0 >>> All objects are counted
Type=1 >>> Only active objects are counted
Type=2 >>> Only active and visible objects are counted
Method GetObjTransCount:Int()

Syntax:


Int = ftLayer.GetObjTransCount ()
Description:Returns the number of active transitions from all objects in a layer.
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftLayer.GetPos ()
Description:Returns the position of a layer in a 2D Float array.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftLayer.GetPosX ()
Description:Returns the X position of a layer.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftLayer.GetPosY ()
Description:Returns the Y position of a layer.
Return type:Float
Method GetScale:Float()

Syntax:


Float = ftLayer.GetScale ()
Description:Returns the scale factor of a layer.
Return type:Float
Method GetTag:Int ()

Syntax:


Int = ftLayer.GetTag ()
Description:Returns the layer tag value.
Return type:Int
Method GetTransitionCount:Int ()

Syntax:


Int = ftLayer.GetTransitionCount ()
Changes:New in version 1.55
Description:Returns the amount of active transitions of the layer.
Return type:Int
Method GetVisible:Bool()

Syntax:


Bool = ftLayer.GetVisible ()
Description:Returns if a given layer is visible or not.
Return type:Bool
Method Remove:Void(delObjects:Bool = False)

Syntax:


ftLayer.Remove (delObjects:Bool = False)
Changes:Fixed in version 1.57
Description:Removes this layer from the engine. If the delObjects flag is set to TRUE, then it will remove all attached objects too.
Parameters:
NameTypeValue
delObjectsBoolFalse
Method RemoveAllObjects:Void()

Syntax:


ftLayer.RemoveAllObjects ()
Description:Removes all objects assigned to a layer.
Method RemoveAllObjectsByID:Void(objID:Int)

Syntax:


ftLayer.RemoveAllObjectsByID (objID:Int)
Description:Removes all objects with the given ID and assigned to the layer.
Parameters:
NameTypeValue
objIDInt
Method Render:Void()

Syntax:


ftLayer.Render ()
Changes:Changed in v1.55.
Description:Render all visible and active objects of a layer.
Details:Objects are normally rendered in their order of creation, unless you have sorted the objects of a layer via the ftLayer.SortObjects method.
Child objects are rendered right after their parent.
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftLayer.SetActive (activeFlag:Bool)
Description:Set the active flag of a layer.
Parameters:
NameTypeValue
activeFlagBool
Method SetAlpha:Void(newAlpha:Float, relative:Int=False)

Syntax:


ftLayer.SetAlpha (newAlpha:Float, relative:Int=False)
Description:Set the alpha value of a layer, ranging from 0.0 (invisible) to 1.0 (fully visible).
Parameters:
NameTypeValue
newAlphaFloat
relativeIntFalse
Method SetGUI:Void (guiFlag:Bool )

Syntax:


ftLayer.SetGUI (guiFlag:Bool)
Description:Sets the layer GUI flag. When rendering a GUI layer, camera positions are not taken into a calculation of the position of this layer.
Parameters:
NameTypeValue
guiFlagBool
Method SetID:Void (layerID:Int )

Syntax:


ftLayer.SetID (layerID:Int)
Description:Sets the layer ID field with any value.
Parameters:
NameTypeValue
layerIDInt
Method SetLayerScissor:Void(offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0)

Syntax:


ftLayer.SetLayerScissor (offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0)
Changes:New in v1.55.
Description:Sets the offset of the scissor for this layer.
Parameters:
NameTypeValue
offXFloat0.0
offYFloat0.0
offWidthFloat0.0
offHeightFloat0.0
Method SetPos:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftLayer.SetPos (x:Float, y:Float, relative:Int = False)
Description:Set the X and Y position of a layer.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Method SetPosX:Void (x:Float, relative:Int = False )

Syntax:


ftLayer.SetPosX (x:Float, relative:Int = False)
Description:Set the X position of a layer.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Method SetPosY:Void (y:Float, relative:Int = False )

Syntax:


ftLayer.SetPosY (y:Float, relative:Int = False)
Description:Set the Y position of a layer.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Method SetScale:Void (scaleFactor:Float, relative:Int = False )

Syntax:


ftLayer.SetScale (scaleFactor:Float, relative:Int = False)
Description:Set the scale factor of a layer.
Parameters:
NameTypeValue
scaleFactorFloat
relativeIntFalse
Method SetTag:Void (newTag:Int )

Syntax:


ftLayer.SetTag (newTag:Int)
Description:Sets the layer tag field with any value.
Parameters:
NameTypeValue
newTagInt
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftLayer.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of a layer.
Parameters:
NameTypeValue
visibleFlagBool
Method SortObjects:Void()

Syntax:


ftLayer.SortObjects ()
Description:Sorts the object list of a layer.
Details:Internally it will call the ftEngine.OnObjectSort method.
Overwrite that method to get a different sorting. The default sorting will sort objects by their Z coordinate.
Method TouchCheck:Void(x:Float, y:Float, touchID:Int)

Syntax:


ftLayer.TouchCheck (x:Float, y:Float, touchID:Int)
Changes:Changed in v1.56
Description:Executes a touch check to each object at the given position.
Parameters:
NameTypeValue
xFloat
yFloat
touchIDInt
Details:The object has to have a touchmode > 0 and needs to be active.
If a touch of an object was detected, then the ftEngine.OnObjectTouch method is called with the object and the touchID as a parameter.
Method Update:Void(speed:Float=1.0)

Syntax:


ftLayer.Update (speed:Float=1.0)
Description:Updates all transitions and objects of a layer.
Parameters:
NameTypeValue
speedFloat1.0
Details:The speed parameter will be used to automatically update the objects.
After the layer was updated and the engine is not paused, the ftEngine.OnLayerUpdate method is called.
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftLocalization.monkey.html b/docs/cftLocalization.monkey.html index 8934152..d32f71b 100644 --- a/docs/cftLocalization.monkey.html +++ b/docs/cftLocalization.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftLocalization -

Module fantomEngine.cftLocalization


The module cftLocalization contains...

Table of contents:

Classes:

Class ftLocalization
Description:The class ftLocalization is an object which helps you supporting multiple languages in your app.
Table of contents:Methods:
  • Clear   ( Method Clear:Void() )
  • GetDefaultLanguage   ( Method GetDefaultLanguage:String() )
  • GetString   ( Method GetString:String(text:String, langStr:String="") )
  • LoadFromString   ( Method LoadFromString:Void(locStr:String) )
  • SetDefaultLanguage   ( Method SetDefaultLanguage:Void(defLang:String ="EN") )

Method Clear:Void()

Syntax:


ftLocalization.Clear ()
Description:This method clears all the mapping data.
Method GetDefaultLanguage:String()

Syntax:


String = ftLocalization.GetDefaultLanguage ()
Description:This method returns the default language.
Return type:String
Method GetString:String(text:String, langStr:String="")

Syntax:


String = ftLocalization.GetString (text:String, langStr:String="")
Description:This method returns the translated string.
Return type:String
Parameters:
NameTypeValue
textString
langStrString""
Details:If no langStr is given, it will use the default language.
Method LoadFromString:Void(locStr:String)

Syntax:


ftLocalization.LoadFromString (locStr:String)
Description:This method loads the localization class via a string
Parameters:
NameTypeValue
locStrString
Details:The format of the string has to be (key%;%LanguageShortCut1%:%Translation1%;%...):
Play%;%DE%:%Spielen
Options%;%DE%:%Optionen
Help%;%DE%:%Hilfe
MultiLine%;%DE%:%Dieser Text%LF%erscheint in 2 Zeilen
Method SetDefaultLanguage:Void(defLang:String ="EN")

Syntax:


ftLocalization.SetDefaultLanguage (defLang:String ="EN")
Description:This method sets the default language.
Parameters:
NameTypeValue
defLangString"EN"
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftLocalization


The module cftLocalization contains...

Table of contents:

Classes:

Class ftLocalization
Description:The class ftLocalization is an object which helps you supporting multiple languages in your app.
Table of contents:Methods:
  • Clear   ( Method Clear:Void() )
  • GetDefaultLanguage   ( Method GetDefaultLanguage:String() )
  • GetString   ( Method GetString:String(text:String, langStr:String="") )
  • LoadFromString   ( Method LoadFromString:Void(locStr:String) )
  • SetDefaultLanguage   ( Method SetDefaultLanguage:Void(defLang:String ="EN") )

Method Clear:Void()

Syntax:


ftLocalization.Clear ()
Description:This method clears all the mapping data.
Method GetDefaultLanguage:String()

Syntax:


String = ftLocalization.GetDefaultLanguage ()
Description:This method returns the default language.
Return type:String
Method GetString:String(text:String, langStr:String="")

Syntax:


String = ftLocalization.GetString (text:String, langStr:String="")
Description:This method returns the translated string.
Return type:String
Parameters:
NameTypeValue
textString
langStrString""
Details:If no langStr is given, it will use the default language.
Method LoadFromString:Void(locStr:String)

Syntax:


ftLocalization.LoadFromString (locStr:String)
Description:This method loads the localization class via a string
Parameters:
NameTypeValue
locStrString
Details:The format of the string has to be (key%;%LanguageShortCut1%:%Translation1%;%...):
Play%;%DE%:%Spielen
Options%;%DE%:%Optionen
Help%;%DE%:%Hilfe
MultiLine%;%DE%:%Dieser Text%LF%erscheint in 2 Zeilen
Method SetDefaultLanguage:Void(defLang:String ="EN")

Syntax:


ftLocalization.SetDefaultLanguage (defLang:String ="EN")
Description:This method sets the default language.
Parameters:
NameTypeValue
defLangString"EN"
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftMisc.monkey.html b/docs/cftMisc.monkey.html index dda8a0f..b51313b 100644 --- a/docs/cftMisc.monkey.html +++ b/docs/cftMisc.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftMisc -

Module fantomEngine.cftMisc


Table of contents:

Functions:

Function GetPitchRate:Float(halfStep:Float, base:Float=1.0)

Syntax:

Float = GetPitchRate (halfStep:Float, base:Float=1.0)
Description:Calculates the pitchrate for the amount of given halfsteps.
Return type:Float
Parameters:
NameTypeValue
halfStepFloat
baseFloat1.0
Details:The default base note is 'A4'
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftMisc


Table of contents:

Functions:

Function GetPitchRate:Float(halfStep:Float, base:Float=1.0)

Syntax:

Float = GetPitchRate (halfStep:Float, base:Float=1.0)
Description:Calculates the pitchrate for the amount of given halfsteps.
Return type:Float
Parameters:
NameTypeValue
halfStepFloat
baseFloat1.0
Details:The default base note is 'A4'
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftObjAnimMng.monkey.html b/docs/cftObjAnimMng.monkey.html index e9d112d..c514350 100644 --- a/docs/cftObjAnimMng.monkey.html +++ b/docs/cftObjAnimMng.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftObjAnimMng -

Module fantomEngine.cftObjAnimMng


The module cftObjAnimMng contains several classes to manage animated objects inside your game.

Table of contents:

Classes:

Class ftAnim
Description:The ftAnim class represents one animation of an object.
Table of contents:Methods:
  • AddFrame   ( Method AddFrame:Void (_imgIndex:Int, _frameIndex:Int) )
  • Update   ( Method Update:Void (delta:Float = 1.0) )

Method AddFrame:Void (_imgIndex:Int, _frameIndex:Int)

Syntax:


ftAnim.AddFrame (_imgIndex:Int, _frameIndex:Int)
Description:Adds a frame to an animated object.
Parameters:
NameTypeValue
_imgIndexInt
_frameIndexInt
Method Update:Void (delta:Float = 1.0)

Syntax:


ftAnim.Update (delta:Float = 1.0)
Description:Updates the animation of an object.
Parameters:
NameTypeValue
deltaFloat1.0
Class ftObjAnimMng
Description:The ftObjAnimMng class manages the animations of an object.
Table of contents:Methods:
  • AddAnim   ( Method AddAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • CreateAnim   ( Method CreateAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • GetCurrAnimCount   ( Method GetCurrAnimCount:Int () )
  • GetCurrAnimFrame   ( Method GetCurrAnimFrame:Float() )
  • GetCurrAnimName   ( Method GetCurrAnimName:String () )
  • GetCurrAnimTime   ( Method GetCurrAnimTime:Float () )
  • RemoveAll   ( Method RemoveAll:Void() )
  • SetActiveAnim   ( Method SetActiveAnim:Void (animName:String) )
  • SetCurrAnimFrame   ( Method SetCurrAnimFrame:Void (frame:Float ) )
  • SetCurrAnimRepeatCount   ( Method SetCurrAnimRepeatCount:Void (repeatCount:Int = -1 ) )   New in version 1.54.
  • SetCurrAnimTime   ( Method SetCurrAnimTime:Void (time:Float = 10.0 ) )
  • UpdateCurrAnim   ( Method UpdateCurrAnim:Void (delta:Float = 1.0 ) )

Method AddAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObjAnimMng.AddAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method CreateAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObjAnimMng.CreateAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Creates a new animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method GetCurrAnimCount:Int ()

Syntax:


Int = ftObjAnimMng.GetCurrAnimCount ()
Description:Get the number of frames from the active animation.
Return type:Int
Method GetCurrAnimFrame:Float()

Syntax:


Float = ftObjAnimMng.GetCurrAnimFrame ()
Description:Get the current frame of the active animation.
Return type:Float
Method GetCurrAnimName:String ()

Syntax:


String = ftObjAnimMng.GetCurrAnimName ()
Description:Get the animation name.
Return type:String
Method GetCurrAnimTime:Float ()

Syntax:


Float = ftObjAnimMng.GetCurrAnimTime ()
Description:Get the animation frame time.
Return type:Float
Method RemoveAll:Void()

Syntax:


ftObjAnimMng.RemoveAll ()
Description:Remove all animations.
Method SetActiveAnim:Void (animName:String)

Syntax:


ftObjAnimMng.SetActiveAnim (animName:String)
Description:Set the current active anim
Parameters:
NameTypeValue
animNameString
Method SetCurrAnimFrame:Void (frame:Float )

Syntax:


ftObjAnimMng.SetCurrAnimFrame (frame:Float)
Description:Set the frame of the current animation. The frame number starts with 1.
Parameters:
NameTypeValue
frameFloat
Method SetCurrAnimRepeatCount:Void (repeatCount:Int = -1 )

Syntax:


ftObjAnimMng.SetCurrAnimRepeatCount (repeatCount:Int = -1)
Changes:New in version 1.54.
Description:Set the repeat count of the current animation.
Parameters:
NameTypeValue
repeatCountInt-1
Details:The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself.
Method SetCurrAnimTime:Void (time:Float = 10.0 )

Syntax:


ftObjAnimMng.SetCurrAnimTime (time:Float = 10.0)
Description:Set the factor for the frame time of the current animation.
Parameters:
NameTypeValue
timeFloat10.0
Details:The default value is 10.0. The higher the value is, the longer a frame is displayed.
Method UpdateCurrAnim:Void (delta:Float = 1.0 )

Syntax:


ftObjAnimMng.UpdateCurrAnim (delta:Float = 1.0)
Parameters:
NameTypeValue
deltaFloat1.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftObjAnimMng


The module cftObjAnimMng contains several classes to manage animated objects inside your game.

Table of contents:

Classes:

Class ftAnim
Description:The ftAnim class represents one animation of an object.
Table of contents:Methods:
  • AddFrame   ( Method AddFrame:Void (_imgIndex:Int, _frameIndex:Int) )
  • Update   ( Method Update:Void (delta:Float = 1.0) )

Method AddFrame:Void (_imgIndex:Int, _frameIndex:Int)

Syntax:


ftAnim.AddFrame (_imgIndex:Int, _frameIndex:Int)
Description:Adds a frame to an animated object.
Parameters:
NameTypeValue
_imgIndexInt
_frameIndexInt
Method Update:Void (delta:Float = 1.0)

Syntax:


ftAnim.Update (delta:Float = 1.0)
Description:Updates the animation of an object.
Parameters:
NameTypeValue
deltaFloat1.0
Class ftObjAnimMng
Description:The ftObjAnimMng class manages the animations of an object.
Table of contents:Methods:
  • AddAnim   ( Method AddAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • CreateAnim   ( Method CreateAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • GetCurrAnimCount   ( Method GetCurrAnimCount:Int () )
  • GetCurrAnimFrame   ( Method GetCurrAnimFrame:Float() )
  • GetCurrAnimName   ( Method GetCurrAnimName:String () )
  • GetCurrAnimTime   ( Method GetCurrAnimTime:Float () )
  • RemoveAll   ( Method RemoveAll:Void() )
  • SetActiveAnim   ( Method SetActiveAnim:Void (animName:String) )
  • SetCurrAnimFrame   ( Method SetCurrAnimFrame:Void (frame:Float ) )
  • SetCurrAnimRepeatCount   ( Method SetCurrAnimRepeatCount:Void (repeatCount:Int = -1 ) )   New in version 1.54.
  • SetCurrAnimTime   ( Method SetCurrAnimTime:Void (time:Float = 10.0 ) )
  • UpdateCurrAnim   ( Method UpdateCurrAnim:Void (delta:Float = 1.0 ) )

Method AddAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObjAnimMng.AddAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method CreateAnim:Void (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObjAnimMng.CreateAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Creates a new animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method GetCurrAnimCount:Int ()

Syntax:


Int = ftObjAnimMng.GetCurrAnimCount ()
Description:Get the number of frames from the active animation.
Return type:Int
Method GetCurrAnimFrame:Float()

Syntax:


Float = ftObjAnimMng.GetCurrAnimFrame ()
Description:Get the current frame of the active animation.
Return type:Float
Method GetCurrAnimName:String ()

Syntax:


String = ftObjAnimMng.GetCurrAnimName ()
Description:Get the animation name.
Return type:String
Method GetCurrAnimTime:Float ()

Syntax:


Float = ftObjAnimMng.GetCurrAnimTime ()
Description:Get the animation frame time.
Return type:Float
Method RemoveAll:Void()

Syntax:


ftObjAnimMng.RemoveAll ()
Description:Remove all animations.
Method SetActiveAnim:Void (animName:String)

Syntax:


ftObjAnimMng.SetActiveAnim (animName:String)
Description:Set the current active anim
Parameters:
NameTypeValue
animNameString
Method SetCurrAnimFrame:Void (frame:Float )

Syntax:


ftObjAnimMng.SetCurrAnimFrame (frame:Float)
Description:Set the frame of the current animation. The frame number starts with 1.
Parameters:
NameTypeValue
frameFloat
Method SetCurrAnimRepeatCount:Void (repeatCount:Int = -1 )

Syntax:


ftObjAnimMng.SetCurrAnimRepeatCount (repeatCount:Int = -1)
Changes:New in version 1.54.
Description:Set the repeat count of the current animation.
Parameters:
NameTypeValue
repeatCountInt-1
Details:The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself.
Method SetCurrAnimTime:Void (time:Float = 10.0 )

Syntax:


ftObjAnimMng.SetCurrAnimTime (time:Float = 10.0)
Description:Set the factor for the frame time of the current animation.
Parameters:
NameTypeValue
timeFloat10.0
Details:The default value is 10.0. The higher the value is, the longer a frame is displayed.
Method UpdateCurrAnim:Void (delta:Float = 1.0 )

Syntax:


ftObjAnimMng.UpdateCurrAnim (delta:Float = 1.0)
Parameters:
NameTypeValue
deltaFloat1.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftObject.monkey.html b/docs/cftObject.monkey.html index 7c13d01..de92468 100644 --- a/docs/cftObject.monkey.html +++ b/docs/cftObject.monkey.html @@ -8,7 +8,7 @@ fantomEngine.cftObject -

Module fantomEngine.cftObject


The class ftObject offers you a huge set of methods to deal with its object. And object can either be an (animated) image, a bitmap font text, a tile map, a primitive (circle, rectangle) or a zone (circle, rectangle).

Table of contents:

Classes:

Class ftObject
Table of contents:Methods:
  • ActivateDeleteEvent   ( Method ActivateDeleteEvent:Void (onOff:Bool = True ) )
  • ActivateRenderEvent   ( Method ActivateRenderEvent:Void (onOff:Bool = True ) )
  • ActivateUpdateEvent   ( Method ActivateUpdateEvent:Void (onOff:Bool = True ) )
  • AddAnim   ( Method AddAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • AddAnim   ( Method AddAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • AddImage   ( Method AddImage:Void(filename:String) )
  • AddImage   ( Method AddImage:Void(image:Image) )
  • AddImageObj   ( Method AddImageObj:Void(imageObj:ftImage) )
  • AddSpeed   ( Method AddSpeed:Void (sp:Float, ang:Float=9876.5) )
  • AddTransAlpha   ( Method AddTransAlpha:Void(trans:ftTrans, alpha:Float, relative:Int) )
  • AddTransPos   ( Method AddTransPos:Void(trans:ftTrans, xt:Float, yt:Float, relative:Int) )
  • AddTransRot   ( Method AddTransRot:Void(trans:ftTrans, rot:Float, relative:Int) )
  • AddTransScale   ( Method AddTransScale:Void(trans:ftTrans, sca:Float, relative:Int) )
  • CancelTimerAll   ( Method CancelTimerAll:Void() )
  • CancelTransAll   ( Method CancelTransAll:Void() )
  • CheckCollision   ( Method CheckCollision:Bool(sp2:ftObject) )
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • CreateAnim   ( Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) )   Changed in version 1.54
  • CreateAnim   ( Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) )   Changed in version 1.54
  • CreateTimer   ( Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(transAlpha:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransRot   ( Method CreateTransRot:ftTrans(transRotation:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransScale   ( Method CreateTransScale:ftTrans(transScale:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • GetActive   ( Method GetActive:Bool() )
  • GetAlpha   ( Method GetAlpha:Float() )
  • GetAngle   ( Method GetAngle:Float() )
  • GetAnimCount   ( Method GetAnimCount:Int () )
  • GetAnimFrame   ( Method GetAnimFrame:Float () )
  • GetAnimName   ( Method GetAnimName:String () )
  • GetAnimPaused   ( Method GetAnimPaused:Bool () )
  • GetAnimTime   ( Method GetAnimTime:Float () )
  • GetAnimated   ( Method GetAnimated:Bool () )
  • GetBlendMode   ( Method GetBlendMode:Int () )
  • GetChild   ( Method GetChild:ftObject (index:Int) )
  • GetChildCount   ( Method GetChildCount:Int () )
  • GetClosestObj   ( Method GetClosestObj:ftObject (useRadius:Bool = True) )
  • GetColGroup   ( Method GetColGroup:Int () )
  • GetColType   ( Method GetColType:Int () )
  • GetColor   ( Method GetColor:Float[]() )   New in vesion 1.56.
  • GetDataObj   ( Method GetDataObj:Object () )
  • GetEdge   ( Method GetEdge:Float(edge:Int=1, relative:Int = False ) )
  • GetFlip   ( Method GetFlip:Bool[]() )
  • GetFlipH   ( Method GetFlipH:Bool() )
  • GetFlipV   ( Method GetFlipV:Bool() )
  • GetFriction   ( Method GetFriction:Float() )
  • GetGroupID   ( Method GetGroupID:Int () )
  • GetHeight   ( Method GetHeight:Float() )
  • GetID   ( Method GetID:Int () )
  • GetImage   ( Method GetImage:Image(index:Int = 1) )
  • GetImageCount   ( Method GetImageCount:Int() )
  • GetImageFrameCount   ( Method GetImageFrameCount:Int(index:Int = 1) )
  • GetImageIndex   ( Method GetImageIndex:Int(imgPath:String) )
  • GetImageObj   ( Method GetImageObj:ftImage(index:Int = 1) )
  • GetImagePath   ( Method GetImagePath:String(index:Int = 1) )
  • GetLayer   ( Method GetLayer:ftLayer() )
  • GetMapObj   ( Method GetMapObj:ftMapObj (index:Int) )
  • GetMapObjCount   ( Method GetMapObjCount:Int () )
  • GetName   ( Method GetName:String () )
  • GetParent   ( Method GetParent:ftObject() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • GetPosZ   ( Method GetPosZ:Float() )
  • GetRadius   ( Method GetRadius:Float() )
  • GetScale   ( Method GetScale:Float() )
  • GetScaleX   ( Method GetScaleX:Float() )
  • GetScaleY   ( Method GetScaleY:Float() )
  • GetSpeed   ( Method GetSpeed:Float() )
  • GetSpeedAngle   ( Method GetSpeedAngle:Float() )
  • GetSpeedMax   ( Method GetSpeedMax:Float() )
  • GetSpeedMin   ( Method GetSpeedMin:Float() )
  • GetSpeedX   ( Method GetSpeedX:Float() )
  • GetSpeedXY   ( Method GetSpeedXY:Float[]() )
  • GetSpeedY   ( Method GetSpeedY:Float() )
  • GetSpin   ( Method GetSpin:Float() )
  • GetTag   ( Method GetTag:Int () )
  • GetTargetAngle   ( Method GetTargetAngle:Float(targetObj:ftObject, relative:Int=False) )
  • GetTargetDist   ( Method GetTargetDist:Float(targetObj:ftObject, useRadius:Bool = False) )
  • GetText   ( Method GetText:String () )
  • GetTileAt   ( Method GetTileAt:Int(xp:Int,yp:Int) )
  • GetTileCount   ( Method GetTileCount:Int() )
  • GetTileCountX   ( Method GetTileCountX:Int() )
  • GetTileCountY   ( Method GetTileCountY:Int() )
  • GetTileHeight   ( Method GetTileHeight:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(column:Int, row:Int) )
  • GetTileIDAt   ( Method GetTileIDAt:Int(xp:Int,yp:Int) )
  • GetTileMap   ( Method GetTileMap:ftTileMap() )   New in v1.56
  • GetTilePosX   ( Method GetTilePosX:Float(index:Int) )
  • GetTilePosY   ( Method GetTilePosY:Float(index:Int) )
  • GetTileWidth   ( Method GetTileWidth:Int(index:Int) )
  • GetTouchMode   ( Method GetTouchMode:Int() )
  • GetTransitionCount   ( Method GetTransitionCount:Int () )
  • GetType   ( Method GetType:Int () )   Docs changed in v1.56
  • GetVector   ( Method GetVector:Float[](vecDistance:Float, vecAngle:Float, relative:Bool=False) )
  • GetVectorAngle   ( Method GetVectorAngle:Float(vecXPos:Float, vecYPos:Float, relative:Int=False) )
  • GetVectorDist   ( Method GetVectorDist:Float(vecXPos:Float, vecYPos:Float) )
  • GetVisible   ( Method GetVisible:Bool() )
  • GetWidth   ( Method GetWidth:Float() )
  • PauseTimerAll   ( Method PauseTimerAll:Void() )
  • PauseTransAll   ( Method PauseTransAll:Void() )
  • Remove   ( Method Remove:Void(directFlag:Bool = False) )   Changed in v1.56 so it removes an attached animation and an attached tilemap too.
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )   Changed in v1.55.
  • ResumeTimerAll   ( Method ResumeTimerAll:Void() )
  • ResumeTransAll   ( Method ResumeTransAll:Void() )
  • SetActive   ( Method SetActive:Void (activeFlag:Bool = True ) )
  • SetActiveAnim   ( Method SetActiveAnim:Void (animName:String) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Int=False) )
  • SetAngle   ( Method SetAngle:Void (newAngle:Float, relative:Int = False ) )
  • SetAngleOffset   ( Method SetAngleOffset:Void (angleOffset:Float ) )   Changed in version 1.54.
  • SetAnimFrame   ( Method SetAnimFrame:Void (frame:Float ) )
  • SetAnimPaused   ( Method SetAnimPaused:Void (pauseFlag:Bool = False ) )
  • SetAnimRepeatCount   ( Method SetAnimRepeatCount:Void (repeatCount:Int = -1) )   New in version 1.54.
  • SetAnimTime   ( Method SetAnimTime:Void (time:Float = 10.0 ) )
  • SetAnimated   ( Method SetAnimated:Void (animFlag:Bool = True ) )
  • SetBlendMode   ( Method SetBlendMode:Void (blendmode:Int = 0) )
  • SetColGroup   ( Method SetColGroup:Void (collisionGroup:Int) )
  • SetColScale   ( Method SetColScale:Void (colScale:Float = 1.0) )   Fixed in v1.54
  • SetColType   ( Method SetColType:Void (colltype:Int) )
  • SetColWith   ( Method SetColWith:Void (startIndex:Int, endIndex:Int, boolFlag:Bool) )
  • SetColWith   ( Method SetColWith:Void (index:Int,boolFlag:Int) )
  • SetColor   ( Method SetColor:Void(cRed:Float, cGreen:Float, cBlue:Float) )
  • SetCurrImage   ( Method SetCurrImage:Void(index:Int, _frameIndex:Int) )
  • SetDataObj   ( Method SetDataObj:Void (obj:Object) )
  • SetFlip   ( Method SetFlip:Void (vf:Bool,hf:Bool) )
  • SetFlipH   ( Method SetFlipH:Void (hf:Bool) )
  • SetFlipV   ( Method SetFlipV:Void (vf:Bool) )
  • SetFriction   ( Method SetFriction:Void (newFriction:Float, relative:Int = False ) )
  • SetGroupID   ( Method SetGroupID:Void (groupId:Int) )
  • SetHandle   ( Method SetHandle:Void (hx:Float, hy:Float ) )
  • SetHeight   ( Method SetHeight:Void (height:Float ) )
  • SetID   ( Method SetID:Void (i:Int ) )
  • SetImage   ( Method SetImage:Void(index:Int, filename:String) )
  • SetImage   ( Method SetImage:Void(index:Int, image:Image) )
  • SetImageObj   ( Method SetImageObj:Void(index:Int, imageObj:ftImage) )
  • SetLayer   ( Method SetLayer:Void(newLayer:ftLayer) )
  • SetMaxSpeed   ( Method SetMaxSpeed:Void (maxSpeed:Float ) )
  • SetMinSpeed   ( Method SetMinSpeed:Void (minSpeed:Float ) )
  • SetName   ( Method SetName:Void (newName:String ) )
  • SetParent   ( Method SetParent:Void(newParent:ftObject) )
  • SetPos   ( Method SetPos:Void (x:Float, y:Float, relative:Int = False ) )
  • SetPosX   ( Method SetPosX:Void (x:Float, relative:Int = False ) )
  • SetPosY   ( Method SetPosY:Void (y:Float, relative:Int = False ) )
  • SetPosZ   ( Method SetPosZ:Void (z:Float, relative:Int = False ) )
  • SetRadius   ( Method SetRadius:Void (newRadius:Float, relative:Int = False ) )
  • SetRenderArea   ( Method SetRenderArea:Void (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float) )
  • SetScale   ( Method SetScale:Void (newScale:Float, relative:Int = False ) )
  • SetScaleX   ( Method SetScaleX:Void (newScale:Float, relative:Int = False ) )
  • SetScaleY   ( Method SetScaleY:Void (newScale:Float, relative:Int = False ) )
  • SetSpeed   ( Method SetSpeed:Void (newSpeed:Float, ang:Float=9876.5) )
  • SetSpeedAngle   ( Method SetSpeedAngle:Void (newAngle:Float) )
  • SetSpeedX   ( Method SetSpeedX:Void (newSpeed:Float) )
  • SetSpeedY   ( Method SetSpeedY:Void (newSpeed:Float) )
  • SetSpin   ( Method SetSpin:Void (newSpin:Float, relative:Int = False ) )
  • SetTag   ( Method SetTag:Void (t:Int ) )
  • SetText   ( Method SetText:Void (t:String ) )
  • SetTileID   ( Method SetTileID:Void(column:Int, row:Int, id:Int) )
  • SetTileIDAt   ( Method SetTileIDAt:Void(xp:Int,yp:Int, id:Int=-1) )
  • SetTileSModXY   ( Method SetTileSModXY:Void(xMod:Float, yMod:Float) )
  • SetTouchMode   ( Method SetTouchMode:Void (touch:Int) )
  • SetVisible   ( Method SetVisible:Void (visible:Bool = True ) )
  • SetWidth   ( Method SetWidth:Void (width:Float ) )
  • SetWrapScreen   ( Method SetWrapScreen:Void (ws:Bool ) )
  • SetWrapScreenX   ( Method SetWrapScreenX:Void (wsx:Bool ) )
  • SetWrapScreenY   ( Method SetWrapScreenY:Void (wsy:Bool ) )
  • Update   ( Method Update:Void(delta:Float=1.0) )   Changed in v1.54

Method ActivateDeleteEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateDeleteEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectDelete method to be called for an object when it will be removed through the Remove method with the direct flag.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set OFF.
Method ActivateRenderEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateRenderEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectRender method to be called for a visible object during the execution of the ftEngine.Render() method.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set OFF.
Method ActivateUpdateEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateUpdateEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectUpdate? method to be called for an active object during ftEngine.Update.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set ON.
Method AddAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObject.AddAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method AddAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObject.AddAnim (animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgNameString
_frameStartInt1
_frameEndInt1
Method AddImage:Void(filename:String)

Syntax:


ftObject.AddImage (filename:String)
Description:Adds a single image (frame) to an object.
Parameters:
NameTypeValue
filenameString
Method AddImage:Void(image:Image)

Syntax:


ftObject.AddImage (image:Image)
Description:Adds a single image (frame) to an object.
Parameters:
NameTypeValue
imageImage
Method AddImageObj:Void(imageObj:ftImage)

Syntax:


ftObject.AddImageObj (imageObj:ftImage)
Description:Adds a single image object (frame) to an object.
Parameters:
NameTypeValue
imageObjftImage
Method AddSpeed:Void (sp:Float, ang:Float=9876.5)

Syntax:


ftObject.AddSpeed (sp:Float, ang:Float=9876.5)
Description:Adds speed to the object. If an angle is given, the speed will be added in that direction. If not, then in the objects angle.
Parameters:
NameTypeValue
spFloat
angFloat9876.5
Method AddTransAlpha:Void(trans:ftTrans, alpha:Float, relative:Int)

Syntax:


ftObject.AddTransAlpha (trans:ftTrans, alpha:Float, relative:Int)
Description:Add an alpha transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
alphaFloat
relativeInt
Method AddTransPos:Void(trans:ftTrans, xt:Float, yt:Float, relative:Int)

Syntax:


ftObject.AddTransPos (trans:ftTrans, xt:Float, yt:Float, relative:Int)
Description:Add a position transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
xtFloat
ytFloat
relativeInt
Method AddTransRot:Void(trans:ftTrans, rot:Float, relative:Int)

Syntax:


ftObject.AddTransRot (trans:ftTrans, rot:Float, relative:Int)
Description:Add a rotation transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
rotFloat
relativeInt
Method AddTransScale:Void(trans:ftTrans, sca:Float, relative:Int)

Syntax:


ftObject.AddTransScale (trans:ftTrans, sca:Float, relative:Int)
Description:Add a scaling transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
scaFloat
relativeInt
Method CancelTimerAll:Void()

Syntax:


ftObject.CancelTimerAll ()
Description:Cancels all timers attached to an object.
Method CancelTransAll:Void()

Syntax:


ftObject.CancelTransAll ()
Description:Cancels all transitions attached to an object.
Method CheckCollision:Bool(sp2:ftObject)

Syntax:


Bool = ftObject.CheckCollision (sp2:ftObject)
Description:Check if a collision has happened for this object.
Return type:Bool
Parameters:
NameTypeValue
sp2ftObject
Details:The following collision types are valid at the moment:
    ftEngine.ctCircle (Value = 0)
    ftEngine.ctBox% (Value = 1 -> rotated bounding box)
    ftEngine.ctBound (Value = 2 -> non-rotated bounding box)
    ftEngine.ctLine (Value = 3)

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftObject.CheckTouchHit (px:Float, py:Float)
Description:Check if a touch has happened.
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Details:The following touch types are valid at the moment:
    ftEngine.tmCircle (Value = 1)
    ftEngine.tmBound (Value = 2)
    ftEngine.tmBox (Value = 3)

Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)

Syntax:


ftObject.CreateAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)
Changes:Changed in version 1.54
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)

Syntax:


ftObject.CreateAnim (animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)
Changes:Changed in version 1.54
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgNameString
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftObject.CreateTimer (timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Create a timer for this object.
Return type:ftTimer
Parameters:
NameTypeValue
timerIDInt
durationInt
repeatCountInt0
Details:A repeatCount of -1 will let the timer run forever. The duration is the time in milliseconds, after which the ftEngine.OnObjectTimer method is called.
Method CreateTransAlpha:ftTrans(transAlpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransAlpha (transAlpha:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create an alpha transition.
Return type:ftTrans
Parameters:
NameTypeValue
transAlphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a position transition.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransRot:ftTrans(transRotation:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransRot (transRotation:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a rotation transition.
Return type:ftTrans
Parameters:
NameTypeValue
transRotationFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransScale:ftTrans(transScale:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransScale (transScale:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a scaling transition.
Return type:ftTrans
Parameters:
NameTypeValue
transScaleFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method GetActive:Bool()

Syntax:


Bool = ftObject.GetActive ()
Description:Returns the active flag.
Return type:Bool
Method GetAlpha:Float()

Syntax:


Float = ftObject.GetAlpha ()
Description:Get the alpha value.
Return type:Float
Method GetAngle:Float()

Syntax:


Float = ftObject.GetAngle ()
Description:Get the angle the object is heading.
Return type:Float
Method GetAnimCount:Int ()

Syntax:


Int = ftObject.GetAnimCount ()
Description:Get the number of frame from the active animation.
Return type:Int
Method GetAnimFrame:Float ()

Syntax:


Float = ftObject.GetAnimFrame ()
Description:Get the current frame(time) of the active animation. It starts with 1.
Return type:Float
Method GetAnimName:String ()

Syntax:


String = ftObject.GetAnimName ()
Description:Return the name from the active animation.
Return type:String
Method GetAnimPaused:Bool ()

Syntax:


Bool = ftObject.GetAnimPaused ()
Description:Return the pause flag for the active animation of an animated object.
Return type:Bool
Method GetAnimTime:Float ()

Syntax:


Float = ftObject.GetAnimTime ()
Description:Get the frame time of the current animation.
Return type:Float
Method GetAnimated:Bool ()

Syntax:


Bool = ftObject.GetAnimated ()
Description:Return the isAnimated flag.
Return type:Bool
Method GetBlendMode:Int ()

Syntax:


Int = ftObject.GetBlendMode ()
Description:Get the blend mode of an object.
Return type:Int
Details:Used are the regular mojo blend modes.
Method GetChild:ftObject (index:Int)

Syntax:


ftObject = ftObject.GetChild (index:Int)
Description:Get the child object with the given index (Index starts with 1).
Return type:ftObject
Parameters:
NameTypeValue
indexInt
Method GetChildCount:Int ()

Syntax:


Int = ftObject.GetChildCount ()
Description:Returns the child count of an object.
Return type:Int
Method GetClosestObj:ftObject (useRadius:Bool = True)

Syntax:


ftObject = ftObject.GetClosestObj (useRadius:Bool = True)
Description:Returns the closest active object.
Return type:ftObject
Parameters:
NameTypeValue
useRadiusBoolTrue
Details:If useRadius is set to FALSE, the distance between each object will be calculated from its position,
without taking its radius into the calculation.
Method GetColGroup:Int ()

Syntax:


Int = ftObject.GetColGroup ()
Description:Returns the collision group of an object.
Return type:Int
Details:A value of 0 means that collisions for this object are disabled.
Method GetColType:Int ()

Syntax:


Int = ftObject.GetColType ()
Description:Returns the collision type of an object.
Return type:Int
Details:Collision types can be:
  • Const ctCircle% = 0
  • Const ctBox% = 1 (this will check against the rotated box of the Object)
  • Const ctBound% = 2 (This will check against the bounding box of the Object)
  • Const ctLine% = 3

Method GetColor:Float[]()

Syntax:


Float[] = ftObject.GetColor ()
Changes:New in vesion 1.56.
Description:Returns the color of an object in an array.
Return type:Float[]
Method GetDataObj:Object ()

Syntax:


Object = ftObject.GetDataObj ()
Description:Returns the data object of this object.
Return type:Object
Method GetEdge:Float(edge:Int=1, relative:Int = False )

Syntax:


Float = ftObject.GetEdge (edge:Int=1, relative:Int = False)
Description:Returns an edge position (bottom,top,left,right) of the object.
Return type:Float
Parameters:
NameTypeValue
edgeInt1
relativeIntFalse
Details:The edge parameter can have the following values:
  • 1 = Bottom edge
  • 2 = Top edge
  • 3 = Left edge
  • 4 = Right edge


If the relative flag is set, then you only get the distance in pixel towards that edge
Method GetFlip:Bool[]()

Syntax:


Bool[] = ftObject.GetFlip ()
Description:Returns the horizontal and vertical FLIP flags in a Bool array.
Return type:Bool[]
Details:Index 0 contains the horizontal flag and index 1 of the returned array contains the vertical flag.
Method GetFlipH:Bool()

Syntax:


Bool = ftObject.GetFlipH ()
Description:Returns the horizontal FLIP flag.
Return type:Bool
Method GetFlipV:Bool()

Syntax:


Bool = ftObject.GetFlipV ()
Description:Returns the vetical FLIP flag.
Return type:Bool
Method GetFriction:Float()

Syntax:


Float = ftObject.GetFriction ()
Description:Get the friction value.
Return type:Float
Method GetGroupID:Int ()

Syntax:


Int = ftObject.GetGroupID ()
Description:Returns the group ID of an object.
Return type:Int
Method GetHeight:Float()

Syntax:


Float = ftObject.GetHeight ()
Description:Get the height of an object.
Return type:Float
Details:The returned value is the stored height multiplied by the Y scale factor.
Method GetID:Int ()

Syntax:


Int = ftObject.GetID ()
Description:Returns the ID of an object.
Return type:Int
Method GetImage:Image(index:Int = 1)

Syntax:


Image = ftObject.GetImage (index:Int = 1)
Description:Returns the Image of an object. The index starts with 1.
Return type:Image
Parameters:
NameTypeValue
indexInt1
Method GetImageCount:Int()

Syntax:


Int = ftObject.GetImageCount ()
Description:Returns the number of images of an object.
Return type:Int
Method GetImageFrameCount:Int(index:Int = 1)

Syntax:


Int = ftObject.GetImageFrameCount (index:Int = 1)
Description:Returns the number of subframe from an image of an object. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
indexInt1
Method GetImageIndex:Int(imgPath:String)

Syntax:


Int = ftObject.GetImageIndex (imgPath:String)
Description:Returns the index of an image with a given name. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
imgPathString
Method GetImageObj:ftImage(index:Int = 1)

Syntax:


ftImage = ftObject.GetImageObj (index:Int = 1)
Description:Returns the ftImage of an object. The index starts with 1.
Return type:ftImage
Parameters:
NameTypeValue
indexInt1
Method GetImagePath:String(index:Int = 1)

Syntax:


String = ftObject.GetImagePath (index:Int = 1)
Description:Returns the name from an image of an object. Index starts with 1.
Return type:String
Parameters:
NameTypeValue
indexInt1
Method GetLayer:ftLayer()

Syntax:


ftLayer = ftObject.GetLayer ()
Description:Get the objects layer.
Return type:ftLayer
Method GetMapObj:ftMapObj (index:Int)

Syntax:


ftMapObj = ftObject.GetMapObj (index:Int)
Description:Returns the tile map object with the given index. Index starts with 1.
Return type:ftMapObj
Parameters:
NameTypeValue
indexInt
Example:
' Load the tile map created by Tiled
+

Module fantomEngine.cftObject


The class ftObject offers you a huge set of methods to deal with its object. And object can either be an (animated) image, a bitmap font text, a tile map, a primitive (circle, rectangle) or a zone (circle, rectangle).

Table of contents:

Classes:

Class ftObject
Table of contents:Methods:
  • ActivateDeleteEvent   ( Method ActivateDeleteEvent:Void (onOff:Bool = True ) )
  • ActivateRenderEvent   ( Method ActivateRenderEvent:Void (onOff:Bool = True ) )
  • ActivateUpdateEvent   ( Method ActivateUpdateEvent:Void (onOff:Bool = True ) )
  • AddAnim   ( Method AddAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • AddAnim   ( Method AddAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1) )
  • AddImage   ( Method AddImage:Void(filename:String) )
  • AddImage   ( Method AddImage:Void(image:Image) )
  • AddImageObj   ( Method AddImageObj:Void(imageObj:ftImage) )
  • AddSpeed   ( Method AddSpeed:Void (sp:Float, ang:Float=9876.5) )
  • AddTransAlpha   ( Method AddTransAlpha:Void(trans:ftTrans, alpha:Float, relative:Int) )
  • AddTransPos   ( Method AddTransPos:Void(trans:ftTrans, xt:Float, yt:Float, relative:Int) )
  • AddTransRot   ( Method AddTransRot:Void(trans:ftTrans, rot:Float, relative:Int) )
  • AddTransScale   ( Method AddTransScale:Void(trans:ftTrans, sca:Float, relative:Int) )
  • CancelTimerAll   ( Method CancelTimerAll:Void() )
  • CancelTransAll   ( Method CancelTransAll:Void() )
  • CheckCollision   ( Method CheckCollision:Bool(sp2:ftObject) )
  • CheckTouchHit   ( Method CheckTouchHit:Bool(px:Float, py:Float) )
  • CreateAnim   ( Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) )   Changed in version 1.54
  • CreateAnim   ( Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) )   Changed in version 1.54
  • CreateTimer   ( Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 ) )
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(transAlpha:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransRot   ( Method CreateTransRot:ftTrans(transRotation:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • CreateTransScale   ( Method CreateTransScale:ftTrans(transScale:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • GetActive   ( Method GetActive:Bool() )
  • GetAlpha   ( Method GetAlpha:Float() )
  • GetAngle   ( Method GetAngle:Float() )
  • GetAnimCount   ( Method GetAnimCount:Int () )
  • GetAnimFrame   ( Method GetAnimFrame:Float () )
  • GetAnimName   ( Method GetAnimName:String () )
  • GetAnimPaused   ( Method GetAnimPaused:Bool () )
  • GetAnimTime   ( Method GetAnimTime:Float () )
  • GetAnimated   ( Method GetAnimated:Bool () )
  • GetBlendMode   ( Method GetBlendMode:Int () )
  • GetChild   ( Method GetChild:ftObject (index:Int) )
  • GetChildCount   ( Method GetChildCount:Int () )
  • GetClosestObj   ( Method GetClosestObj:ftObject (useRadius:Bool = True) )
  • GetColGroup   ( Method GetColGroup:Int () )
  • GetColType   ( Method GetColType:Int () )
  • GetColor   ( Method GetColor:Float[]() )   New in vesion 1.56.
  • GetDataObj   ( Method GetDataObj:Object () )
  • GetEdge   ( Method GetEdge:Float(edge:Int=1, relative:Int = False ) )
  • GetFlip   ( Method GetFlip:Bool[]() )
  • GetFlipH   ( Method GetFlipH:Bool() )
  • GetFlipV   ( Method GetFlipV:Bool() )
  • GetFriction   ( Method GetFriction:Float() )
  • GetGroupID   ( Method GetGroupID:Int () )
  • GetHeight   ( Method GetHeight:Float() )
  • GetID   ( Method GetID:Int () )
  • GetImage   ( Method GetImage:Image(index:Int = 1) )
  • GetImageCount   ( Method GetImageCount:Int() )
  • GetImageFrameCount   ( Method GetImageFrameCount:Int(index:Int = 1) )
  • GetImageIndex   ( Method GetImageIndex:Int(imgPath:String) )
  • GetImageObj   ( Method GetImageObj:ftImage(index:Int = 1) )
  • GetImagePath   ( Method GetImagePath:String(index:Int = 1) )
  • GetLayer   ( Method GetLayer:ftLayer() )
  • GetMapObj   ( Method GetMapObj:ftMapObj (index:Int) )
  • GetMapObjCount   ( Method GetMapObjCount:Int () )
  • GetName   ( Method GetName:String () )
  • GetParent   ( Method GetParent:ftObject() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetPosX   ( Method GetPosX:Float() )
  • GetPosY   ( Method GetPosY:Float() )
  • GetPosZ   ( Method GetPosZ:Float() )
  • GetRadius   ( Method GetRadius:Float() )
  • GetScale   ( Method GetScale:Float() )
  • GetScaleX   ( Method GetScaleX:Float() )
  • GetScaleY   ( Method GetScaleY:Float() )
  • GetSpeed   ( Method GetSpeed:Float() )
  • GetSpeedAngle   ( Method GetSpeedAngle:Float() )
  • GetSpeedMax   ( Method GetSpeedMax:Float() )
  • GetSpeedMin   ( Method GetSpeedMin:Float() )
  • GetSpeedX   ( Method GetSpeedX:Float() )
  • GetSpeedXY   ( Method GetSpeedXY:Float[]() )
  • GetSpeedY   ( Method GetSpeedY:Float() )
  • GetSpin   ( Method GetSpin:Float() )
  • GetTag   ( Method GetTag:Int () )
  • GetTargetAngle   ( Method GetTargetAngle:Float(targetObj:ftObject, relative:Int=False) )
  • GetTargetDist   ( Method GetTargetDist:Float(targetObj:ftObject, useRadius:Bool = False) )
  • GetText   ( Method GetText:String () )
  • GetTileAt   ( Method GetTileAt:Int(xp:Int,yp:Int) )
  • GetTileCount   ( Method GetTileCount:Int() )
  • GetTileCountX   ( Method GetTileCountX:Int() )
  • GetTileCountY   ( Method GetTileCountY:Int() )
  • GetTileHeight   ( Method GetTileHeight:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(column:Int, row:Int) )
  • GetTileIDAt   ( Method GetTileIDAt:Int(xp:Int,yp:Int) )
  • GetTileMap   ( Method GetTileMap:ftTileMap() )   New in v1.56
  • GetTilePosX   ( Method GetTilePosX:Float(index:Int) )
  • GetTilePosY   ( Method GetTilePosY:Float(index:Int) )
  • GetTileWidth   ( Method GetTileWidth:Int(index:Int) )
  • GetTouchMode   ( Method GetTouchMode:Int() )
  • GetTransitionCount   ( Method GetTransitionCount:Int () )
  • GetType   ( Method GetType:Int () )   Docs changed in v1.56
  • GetVector   ( Method GetVector:Float[](vecDistance:Float, vecAngle:Float, relative:Bool=False) )
  • GetVectorAngle   ( Method GetVectorAngle:Float(vecXPos:Float, vecYPos:Float, relative:Int=False) )
  • GetVectorDist   ( Method GetVectorDist:Float(vecXPos:Float, vecYPos:Float) )
  • GetVisible   ( Method GetVisible:Bool() )
  • GetWidth   ( Method GetWidth:Float() )
  • PauseTimerAll   ( Method PauseTimerAll:Void() )
  • PauseTransAll   ( Method PauseTransAll:Void() )
  • Remove   ( Method Remove:Void(directFlag:Bool = False) )   Changed in v1.56 so it removes an attached animation and an attached tilemap too.
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )   Changed in v1.55.
  • ResumeTimerAll   ( Method ResumeTimerAll:Void() )
  • ResumeTransAll   ( Method ResumeTransAll:Void() )
  • SetActive   ( Method SetActive:Void (activeFlag:Bool = True ) )
  • SetActiveAnim   ( Method SetActiveAnim:Void (animName:String) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Int=False) )
  • SetAngle   ( Method SetAngle:Void (newAngle:Float, relative:Int = False ) )
  • SetAngleOffset   ( Method SetAngleOffset:Void (angleOffset:Float ) )   Changed in version 1.54.
  • SetAnimFrame   ( Method SetAnimFrame:Void (frame:Float ) )
  • SetAnimPaused   ( Method SetAnimPaused:Void (pauseFlag:Bool = False ) )
  • SetAnimRepeatCount   ( Method SetAnimRepeatCount:Void (repeatCount:Int = -1) )   New in version 1.54.
  • SetAnimTime   ( Method SetAnimTime:Void (time:Float = 10.0 ) )
  • SetAnimated   ( Method SetAnimated:Void (animFlag:Bool = True ) )
  • SetBlendMode   ( Method SetBlendMode:Void (blendmode:Int = 0) )
  • SetColGroup   ( Method SetColGroup:Void (collisionGroup:Int) )
  • SetColScale   ( Method SetColScale:Void (colScale:Float = 1.0) )   Fixed in v1.54
  • SetColType   ( Method SetColType:Void (colltype:Int) )
  • SetColWith   ( Method SetColWith:Void (startIndex:Int, endIndex:Int, boolFlag:Bool) )
  • SetColWith   ( Method SetColWith:Void (index:Int,boolFlag:Int) )
  • SetColor   ( Method SetColor:Void(cRed:Float, cGreen:Float, cBlue:Float) )
  • SetCurrImage   ( Method SetCurrImage:Void(index:Int, _frameIndex:Int) )
  • SetDataObj   ( Method SetDataObj:Void (obj:Object) )
  • SetFlip   ( Method SetFlip:Void (vf:Bool,hf:Bool) )
  • SetFlipH   ( Method SetFlipH:Void (hf:Bool) )
  • SetFlipV   ( Method SetFlipV:Void (vf:Bool) )
  • SetFriction   ( Method SetFriction:Void (newFriction:Float, relative:Int = False ) )
  • SetGroupID   ( Method SetGroupID:Void (groupId:Int) )
  • SetHandle   ( Method SetHandle:Void (hx:Float, hy:Float ) )
  • SetHeight   ( Method SetHeight:Void (height:Float ) )
  • SetID   ( Method SetID:Void (i:Int ) )
  • SetImage   ( Method SetImage:Void(index:Int, filename:String) )
  • SetImage   ( Method SetImage:Void(index:Int, image:Image) )
  • SetImageObj   ( Method SetImageObj:Void(index:Int, imageObj:ftImage) )
  • SetLayer   ( Method SetLayer:Void(newLayer:ftLayer) )
  • SetMaxSpeed   ( Method SetMaxSpeed:Void (maxSpeed:Float ) )
  • SetMinSpeed   ( Method SetMinSpeed:Void (minSpeed:Float ) )
  • SetName   ( Method SetName:Void (newName:String ) )
  • SetParent   ( Method SetParent:Void(newParent:ftObject) )
  • SetPos   ( Method SetPos:Void (x:Float, y:Float, relative:Int = False ) )
  • SetPosX   ( Method SetPosX:Void (x:Float, relative:Int = False ) )
  • SetPosY   ( Method SetPosY:Void (y:Float, relative:Int = False ) )
  • SetPosZ   ( Method SetPosZ:Void (z:Float, relative:Int = False ) )
  • SetRadius   ( Method SetRadius:Void (newRadius:Float, relative:Int = False ) )
  • SetRenderArea   ( Method SetRenderArea:Void (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float) )
  • SetScale   ( Method SetScale:Void (newScale:Float, relative:Int = False ) )
  • SetScaleX   ( Method SetScaleX:Void (newScale:Float, relative:Int = False ) )
  • SetScaleY   ( Method SetScaleY:Void (newScale:Float, relative:Int = False ) )
  • SetSpeed   ( Method SetSpeed:Void (newSpeed:Float, ang:Float=9876.5) )
  • SetSpeedAngle   ( Method SetSpeedAngle:Void (newAngle:Float) )
  • SetSpeedX   ( Method SetSpeedX:Void (newSpeed:Float) )
  • SetSpeedY   ( Method SetSpeedY:Void (newSpeed:Float) )
  • SetSpin   ( Method SetSpin:Void (newSpin:Float, relative:Int = False ) )
  • SetTag   ( Method SetTag:Void (t:Int ) )
  • SetText   ( Method SetText:Void (t:String ) )
  • SetTileID   ( Method SetTileID:Void(column:Int, row:Int, id:Int) )
  • SetTileIDAt   ( Method SetTileIDAt:Void(xp:Int,yp:Int, id:Int=-1) )
  • SetTileSModXY   ( Method SetTileSModXY:Void(xMod:Float, yMod:Float) )
  • SetTouchMode   ( Method SetTouchMode:Void (touch:Int) )
  • SetVisible   ( Method SetVisible:Void (visible:Bool = True ) )
  • SetWidth   ( Method SetWidth:Void (width:Float ) )
  • SetWrapScreen   ( Method SetWrapScreen:Void (ws:Bool ) )
  • SetWrapScreenX   ( Method SetWrapScreenX:Void (wsx:Bool ) )
  • SetWrapScreenY   ( Method SetWrapScreenY:Void (wsy:Bool ) )
  • Update   ( Method Update:Void(delta:Float=1.0) )   Changed in v1.54

Method ActivateDeleteEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateDeleteEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectDelete method to be called for an object when it will be removed through the Remove method with the direct flag.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set OFF.
Method ActivateRenderEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateRenderEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectRender method to be called for a visible object during the execution of the ftEngine.Render() method.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set OFF.
Method ActivateUpdateEvent:Void (onOff:Bool = True )

Syntax:


ftObject.ActivateUpdateEvent (onOff:Bool = True)
Description:Activates the ftEngine.OnObjectUpdate? method to be called for an active object during ftEngine.Update.
Parameters:
NameTypeValue
onOffBoolTrue
Details:By default this flag is set ON.
Method AddAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObject.AddAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
Method AddAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1)

Syntax:


ftObject.AddAnim (animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1)
Description:Add to an existing animation. Image and frame indexes start at 1.
Parameters:
NameTypeValue
animNameString
imgNameString
_frameStartInt1
_frameEndInt1
Method AddImage:Void(filename:String)

Syntax:


ftObject.AddImage (filename:String)
Description:Adds a single image (frame) to an object.
Parameters:
NameTypeValue
filenameString
Method AddImage:Void(image:Image)

Syntax:


ftObject.AddImage (image:Image)
Description:Adds a single image (frame) to an object.
Parameters:
NameTypeValue
imageImage
Method AddImageObj:Void(imageObj:ftImage)

Syntax:


ftObject.AddImageObj (imageObj:ftImage)
Description:Adds a single image object (frame) to an object.
Parameters:
NameTypeValue
imageObjftImage
Method AddSpeed:Void (sp:Float, ang:Float=9876.5)

Syntax:


ftObject.AddSpeed (sp:Float, ang:Float=9876.5)
Description:Adds speed to the object. If an angle is given, the speed will be added in that direction. If not, then in the objects angle.
Parameters:
NameTypeValue
spFloat
angFloat9876.5
Method AddTransAlpha:Void(trans:ftTrans, alpha:Float, relative:Int)

Syntax:


ftObject.AddTransAlpha (trans:ftTrans, alpha:Float, relative:Int)
Description:Add an alpha transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
alphaFloat
relativeInt
Method AddTransPos:Void(trans:ftTrans, xt:Float, yt:Float, relative:Int)

Syntax:


ftObject.AddTransPos (trans:ftTrans, xt:Float, yt:Float, relative:Int)
Description:Add a position transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
xtFloat
ytFloat
relativeInt
Method AddTransRot:Void(trans:ftTrans, rot:Float, relative:Int)

Syntax:


ftObject.AddTransRot (trans:ftTrans, rot:Float, relative:Int)
Description:Add a rotation transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
rotFloat
relativeInt
Method AddTransScale:Void(trans:ftTrans, sca:Float, relative:Int)

Syntax:


ftObject.AddTransScale (trans:ftTrans, sca:Float, relative:Int)
Description:Add a scaling transition to an existing transition.
Parameters:
NameTypeValue
transftTrans
scaFloat
relativeInt
Method CancelTimerAll:Void()

Syntax:


ftObject.CancelTimerAll ()
Description:Cancels all timers attached to an object.
Method CancelTransAll:Void()

Syntax:


ftObject.CancelTransAll ()
Description:Cancels all transitions attached to an object.
Method CheckCollision:Bool(sp2:ftObject)

Syntax:


Bool = ftObject.CheckCollision (sp2:ftObject)
Description:Check if a collision has happened for this object.
Return type:Bool
Parameters:
NameTypeValue
sp2ftObject
Details:The following collision types are valid at the moment:
    ftEngine.ctCircle (Value = 0)
    ftEngine.ctBox% (Value = 1 -> rotated bounding box)
    ftEngine.ctBound (Value = 2 -> non-rotated bounding box)
    ftEngine.ctLine (Value = 3)

Method CheckTouchHit:Bool(px:Float, py:Float)

Syntax:


Bool = ftObject.CheckTouchHit (px:Float, py:Float)
Description:Check if a touch has happened.
Return type:Bool
Parameters:
NameTypeValue
pxFloat
pyFloat
Details:The following touch types are valid at the moment:
    ftEngine.tmCircle (Value = 1)
    ftEngine.tmBound (Value = 2)
    ftEngine.tmBox (Value = 3)

Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)

Syntax:


ftObject.CreateAnim (animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)
Changes:Changed in version 1.54
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)

Syntax:


ftObject.CreateAnim (animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1)
Changes:Changed in version 1.54
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgNameString
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
Method CreateTimer:ftTimer(timerID:Int, duration:Int, repeatCount:Int = 0 )

Syntax:


ftTimer = ftObject.CreateTimer (timerID:Int, duration:Int, repeatCount:Int = 0)
Description:Create a timer for this object.
Return type:ftTimer
Parameters:
NameTypeValue
timerIDInt
durationInt
repeatCountInt0
Details:A repeatCount of -1 will let the timer run forever. The duration is the time in milliseconds, after which the ftEngine.OnObjectTimer method is called.
Method CreateTransAlpha:ftTrans(transAlpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransAlpha (transAlpha:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create an alpha transition.
Return type:ftTrans
Parameters:
NameTypeValue
transAlphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a position transition.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransRot:ftTrans(transRotation:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransRot (transRotation:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a rotation transition.
Return type:ftTrans
Parameters:
NameTypeValue
transRotationFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method CreateTransScale:ftTrans(transScale:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftObject.CreateTransScale (transScale:Float, duration:Float, relative:Int, transId:Int=0)
Description:Create a scaling transition.
Return type:ftTrans
Parameters:
NameTypeValue
transScaleFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnObjectTrans method.
Method GetActive:Bool()

Syntax:


Bool = ftObject.GetActive ()
Description:Returns the active flag.
Return type:Bool
Method GetAlpha:Float()

Syntax:


Float = ftObject.GetAlpha ()
Description:Get the alpha value.
Return type:Float
Method GetAngle:Float()

Syntax:


Float = ftObject.GetAngle ()
Description:Get the angle the object is heading.
Return type:Float
Method GetAnimCount:Int ()

Syntax:


Int = ftObject.GetAnimCount ()
Description:Get the number of frame from the active animation.
Return type:Int
Method GetAnimFrame:Float ()

Syntax:


Float = ftObject.GetAnimFrame ()
Description:Get the current frame(time) of the active animation. It starts with 1.
Return type:Float
Method GetAnimName:String ()

Syntax:


String = ftObject.GetAnimName ()
Description:Return the name from the active animation.
Return type:String
Method GetAnimPaused:Bool ()

Syntax:


Bool = ftObject.GetAnimPaused ()
Description:Return the pause flag for the active animation of an animated object.
Return type:Bool
Method GetAnimTime:Float ()

Syntax:


Float = ftObject.GetAnimTime ()
Description:Get the frame time of the current animation.
Return type:Float
Method GetAnimated:Bool ()

Syntax:


Bool = ftObject.GetAnimated ()
Description:Return the isAnimated flag.
Return type:Bool
Method GetBlendMode:Int ()

Syntax:


Int = ftObject.GetBlendMode ()
Description:Get the blend mode of an object.
Return type:Int
Details:Used are the regular mojo blend modes.
Method GetChild:ftObject (index:Int)

Syntax:


ftObject = ftObject.GetChild (index:Int)
Description:Get the child object with the given index (Index starts with 1).
Return type:ftObject
Parameters:
NameTypeValue
indexInt
Method GetChildCount:Int ()

Syntax:


Int = ftObject.GetChildCount ()
Description:Returns the child count of an object.
Return type:Int
Method GetClosestObj:ftObject (useRadius:Bool = True)

Syntax:


ftObject = ftObject.GetClosestObj (useRadius:Bool = True)
Description:Returns the closest active object.
Return type:ftObject
Parameters:
NameTypeValue
useRadiusBoolTrue
Details:If useRadius is set to FALSE, the distance between each object will be calculated from its position,
without taking its radius into the calculation.
Method GetColGroup:Int ()

Syntax:


Int = ftObject.GetColGroup ()
Description:Returns the collision group of an object.
Return type:Int
Details:A value of 0 means that collisions for this object are disabled.
Method GetColType:Int ()

Syntax:


Int = ftObject.GetColType ()
Description:Returns the collision type of an object.
Return type:Int
Details:Collision types can be:
  • Const ctCircle% = 0
  • Const ctBox% = 1 (this will check against the rotated box of the Object)
  • Const ctBound% = 2 (This will check against the bounding box of the Object)
  • Const ctLine% = 3

Method GetColor:Float[]()

Syntax:


Float[] = ftObject.GetColor ()
Changes:New in vesion 1.56.
Description:Returns the color of an object in an array.
Return type:Float[]
Method GetDataObj:Object ()

Syntax:


Object = ftObject.GetDataObj ()
Description:Returns the data object of this object.
Return type:Object
Method GetEdge:Float(edge:Int=1, relative:Int = False )

Syntax:


Float = ftObject.GetEdge (edge:Int=1, relative:Int = False)
Description:Returns an edge position (bottom,top,left,right) of the object.
Return type:Float
Parameters:
NameTypeValue
edgeInt1
relativeIntFalse
Details:The edge parameter can have the following values:
  • 1 = Bottom edge
  • 2 = Top edge
  • 3 = Left edge
  • 4 = Right edge


If the relative flag is set, then you only get the distance in pixel towards that edge
Method GetFlip:Bool[]()

Syntax:


Bool[] = ftObject.GetFlip ()
Description:Returns the horizontal and vertical FLIP flags in a Bool array.
Return type:Bool[]
Details:Index 0 contains the horizontal flag and index 1 of the returned array contains the vertical flag.
Method GetFlipH:Bool()

Syntax:


Bool = ftObject.GetFlipH ()
Description:Returns the horizontal FLIP flag.
Return type:Bool
Method GetFlipV:Bool()

Syntax:


Bool = ftObject.GetFlipV ()
Description:Returns the vetical FLIP flag.
Return type:Bool
Method GetFriction:Float()

Syntax:


Float = ftObject.GetFriction ()
Description:Get the friction value.
Return type:Float
Method GetGroupID:Int ()

Syntax:


Int = ftObject.GetGroupID ()
Description:Returns the group ID of an object.
Return type:Int
Method GetHeight:Float()

Syntax:


Float = ftObject.GetHeight ()
Description:Get the height of an object.
Return type:Float
Details:The returned value is the stored height multiplied by the Y scale factor.
Method GetID:Int ()

Syntax:


Int = ftObject.GetID ()
Description:Returns the ID of an object.
Return type:Int
Method GetImage:Image(index:Int = 1)

Syntax:


Image = ftObject.GetImage (index:Int = 1)
Description:Returns the Image of an object. The index starts with 1.
Return type:Image
Parameters:
NameTypeValue
indexInt1
Method GetImageCount:Int()

Syntax:


Int = ftObject.GetImageCount ()
Description:Returns the number of images of an object.
Return type:Int
Method GetImageFrameCount:Int(index:Int = 1)

Syntax:


Int = ftObject.GetImageFrameCount (index:Int = 1)
Description:Returns the number of subframe from an image of an object. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
indexInt1
Method GetImageIndex:Int(imgPath:String)

Syntax:


Int = ftObject.GetImageIndex (imgPath:String)
Description:Returns the index of an image with a given name. Index starts with 1.
Return type:Int
Parameters:
NameTypeValue
imgPathString
Method GetImageObj:ftImage(index:Int = 1)

Syntax:


ftImage = ftObject.GetImageObj (index:Int = 1)
Description:Returns the ftImage of an object. The index starts with 1.
Return type:ftImage
Parameters:
NameTypeValue
indexInt1
Method GetImagePath:String(index:Int = 1)

Syntax:


String = ftObject.GetImagePath (index:Int = 1)
Description:Returns the name from an image of an object. Index starts with 1.
Return type:String
Parameters:
NameTypeValue
indexInt1
Method GetLayer:ftLayer()

Syntax:


ftLayer = ftObject.GetLayer ()
Description:Get the objects layer.
Return type:ftLayer
Method GetMapObj:ftMapObj (index:Int)

Syntax:


ftMapObj = ftObject.GetMapObj (index:Int)
Description:Returns the tile map object with the given index. Index starts with 1.
Return type:ftMapObj
Parameters:
NameTypeValue
indexInt
Example:
' Load the tile map created by Tiled
 Local tm := eng.CreateTileMap("yourMap.json", 0, 0 )
 
 ' Determine the number of objects included in the map
@@ -32,7 +32,7 @@ 

Module fantomEngine.cftObject

Method GetMapObjCount:Int ()

Syntax:


Int = ftObject.GetMapObjCount ()
Description:Returns the number of tile map objects.
Return type:Int
Details:The objects were stored when a Tiled compatible map was loaded.
Method GetName:String ()

Syntax:


String = ftObject.GetName ()
Description:Get the name of an object.
Return type:String
Method GetParent:ftObject()

Syntax:


ftObject = ftObject.GetParent ()
Description:Get the parent object.
Return type:ftObject
Method GetPos:Float[]()

Syntax:


Float[] = ftObject.GetPos ()
Description:Returns the objects X and Y position in a 2D Float array.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftObject.GetPosX ()
Description:Get the X position.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftObject.GetPosY ()
Description:Get the Y position.
Return type:Float
Method GetPosZ:Float()

Syntax:


Float = ftObject.GetPosZ ()
Description:Get the Z position.
Return type:Float
Method GetRadius:Float()

Syntax:


Float = ftObject.GetRadius ()
Description:Returns the radius of an object.
Return type:Float
Method GetScale:Float()

Syntax:


Float = ftObject.GetScale ()
Description:Get current scale factor of an object.
Return type:Float
Method GetScaleX:Float()

Syntax:


Float = ftObject.GetScaleX ()
Description:Returns the X scale factor (width) of the object.
Return type:Float
Method GetScaleY:Float()

Syntax:


Float = ftObject.GetScaleY ()
Description:Returns the Y scale factor (height) of the object.
Return type:Float
Method GetSpeed:Float()

Syntax:


Float = ftObject.GetSpeed ()
Description:Get current linear speed of an object.
Return type:Float
Method GetSpeedAngle:Float()

Syntax:


Float = ftObject.GetSpeedAngle ()
Description:Get the current speed angle.
Return type:Float
Method GetSpeedMax:Float()

Syntax:


Float = ftObject.GetSpeedMax ()
Description:Get the max speed of an object.
Return type:Float
Method GetSpeedMin:Float()

Syntax:


Float = ftObject.GetSpeedMin ()
Description:Get the minimum speed of an object.
Return type:Float
Method GetSpeedX:Float()

Syntax:


Float = ftObject.GetSpeedX ()
Description:Get the current X speed.
Return type:Float
Method GetSpeedXY:Float[]()

Syntax:


Float[] = ftObject.GetSpeedXY ()
Description:Get current the X and Y speed of a 2D Float array.
Return type:Float[]
Method GetSpeedY:Float()

Syntax:


Float = ftObject.GetSpeedY ()
Description:Get the current Y speed.
Return type:Float
Method GetSpin:Float()

Syntax:


Float = ftObject.GetSpin ()
Description:Get the spin speed value.
Return type:Float
Method GetTag:Int ()

Syntax:


Int = ftObject.GetTag ()
Description:Get the object tag value.
Return type:Int
Method GetTargetAngle:Float(targetObj:ftObject, relative:Int=False)

Syntax:


Float = ftObject.GetTargetAngle (targetObj:ftObject, relative:Int=False)
Description:Returns the angle to a target object.
Return type:Float
Parameters:
NameTypeValue
targetObjftObject
relativeIntFalse
Details:If the relative flag is set, then the angle takes the object angle into account.
Example:
' Shooting a shot in the direction of an enemy object
+
Method GetMapObjCount:Int ()

Syntax:


Int = ftObject.GetMapObjCount ()
Description:Returns the number of tile map objects.
Return type:Int
Details:The objects were stored when a Tiled compatible map was loaded.
Method GetName:String ()

Syntax:


String = ftObject.GetName ()
Description:Get the name of an object.
Return type:String
Method GetParent:ftObject()

Syntax:


ftObject = ftObject.GetParent ()
Description:Get the parent object.
Return type:ftObject
Method GetPos:Float[]()

Syntax:


Float[] = ftObject.GetPos ()
Description:Returns the objects X and Y position in a 2D Float array.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftObject.GetPosX ()
Description:Get the X position.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftObject.GetPosY ()
Description:Get the Y position.
Return type:Float
Method GetPosZ:Float()

Syntax:


Float = ftObject.GetPosZ ()
Description:Get the Z position.
Return type:Float
Method GetRadius:Float()

Syntax:


Float = ftObject.GetRadius ()
Description:Returns the radius of an object.
Return type:Float
Method GetScale:Float()

Syntax:


Float = ftObject.GetScale ()
Description:Get current scale factor of an object.
Return type:Float
Method GetScaleX:Float()

Syntax:


Float = ftObject.GetScaleX ()
Description:Returns the X scale factor (width) of the object.
Return type:Float
Method GetScaleY:Float()

Syntax:


Float = ftObject.GetScaleY ()
Description:Returns the Y scale factor (height) of the object.
Return type:Float
Method GetSpeed:Float()

Syntax:


Float = ftObject.GetSpeed ()
Description:Get current linear speed of an object.
Return type:Float
Method GetSpeedAngle:Float()

Syntax:


Float = ftObject.GetSpeedAngle ()
Description:Get the current speed angle.
Return type:Float
Method GetSpeedMax:Float()

Syntax:


Float = ftObject.GetSpeedMax ()
Description:Get the max speed of an object.
Return type:Float
Method GetSpeedMin:Float()

Syntax:


Float = ftObject.GetSpeedMin ()
Description:Get the minimum speed of an object.
Return type:Float
Method GetSpeedX:Float()

Syntax:


Float = ftObject.GetSpeedX ()
Description:Get the current X speed.
Return type:Float
Method GetSpeedXY:Float[]()

Syntax:


Float[] = ftObject.GetSpeedXY ()
Description:Get current the X and Y speed of a 2D Float array.
Return type:Float[]
Method GetSpeedY:Float()

Syntax:


Float = ftObject.GetSpeedY ()
Description:Get the current Y speed.
Return type:Float
Method GetSpin:Float()

Syntax:


Float = ftObject.GetSpin ()
Description:Get the spin speed value.
Return type:Float
Method GetTag:Int ()

Syntax:


Int = ftObject.GetTag ()
Description:Get the object tag value.
Return type:Int
Method GetTargetAngle:Float(targetObj:ftObject, relative:Int=False)

Syntax:


Float = ftObject.GetTargetAngle (targetObj:ftObject, relative:Int=False)
Description:Returns the angle to a target object.
Return type:Float
Parameters:
NameTypeValue
targetObjftObject
relativeIntFalse
Details:If the relative flag is set, then the angle takes the object angle into account.
Example:
' Shooting a shot in the direction of an enemy object
 Const shotID:Int = 1234
 Const shotID:Int = 9876
 
@@ -56,7 +56,7 @@ 

Module fantomEngine.cftObject

Method GetTargetDist:Float(targetObj:ftObject, useRadius:Bool = False)

Syntax:


Float = ftObject.GetTargetDist (targetObj:ftObject, useRadius:Bool = False)
Description:Get the distance to a target object.
Return type:Float
Parameters:
NameTypeValue
targetObjftObject
useRadiusBoolFalse
Details:Which the useRadius flag set, it will substract the radius of each object from the distance
Method GetText:String ()

Syntax:


String = ftObject.GetText ()
Description:Get the text field of an object.
Return type:String
Method GetTileAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftObject.GetTileAt (xp:Int,yp:Int)
Description:Returns the tile index at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Method GetTileCount:Int()

Syntax:


Int = ftObject.GetTileCount ()
Description:Returns the total number of tiles of a tilemap.
Return type:Int
Method GetTileCountX:Int()

Syntax:


Int = ftObject.GetTileCountX ()
Description:Returns the number of tiles in the X direction.
Return type:Int
Method GetTileCountY:Int()

Syntax:


Int = ftObject.GetTileCountY ()
Description:Returns the number of tiles in the Y direction.
Return type:Int
Method GetTileHeight:Int(index:Int)

Syntax:


Int = ftObject.GetTileHeight (index:Int)
Description:Returns the height of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTileID:Int(index:Int)

Syntax:


Int = ftObject.GetTileID (index:Int)
Description:Returns the ID of the tiles texture map, at the given index, starting from zero.
Return type:Int
Parameters:
NameTypeValue
indexInt
Details:It returns -1 if there is no tile.
Method GetTileID:Int(column:Int, row:Int)

Syntax:


Int = ftObject.GetTileID (column:Int, row:Int)
Description:Returns the ID of the tiles texture map, at the given map row and column, starting from zero.
Return type:Int
Parameters:
NameTypeValue
columnInt
rowInt
Details:It returns -1 if there is no tile.
Method GetTileIDAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftObject.GetTileIDAt (xp:Int,yp:Int)
Description:Returns the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Details:It returns -1 if there is no tile.
Method GetTileMap:ftTileMap()

Syntax:


ftTileMap = ftObject.GetTileMap ()
Changes:New in v1.56
Description:Returns the tileMap of this object.
Return type:ftTileMap
Method GetTilePosX:Float(index:Int)

Syntax:


Float = ftObject.GetTilePosX (index:Int)
Description:Returns the X position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTilePosY:Float(index:Int)

Syntax:


Float = ftObject.GetTilePosY (index:Int)
Description:Returns the Y position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTileWidth:Int(index:Int)

Syntax:


Int = ftObject.GetTileWidth (index:Int)
Description:Returns the width of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTouchMode:Int()

Syntax:


Int = ftObject.GetTouchMode ()
Description:Returns the touchmode of an object.
Return type:Int
Method GetTransitionCount:Int ()

Syntax:


Int = ftObject.GetTransitionCount ()
Description:Returns the amount of active transitions of an object.
Return type:Int
Method GetType:Int ()

Syntax:


Int = ftObject.GetType ()
Changes:Docs changed in v1.56
Description:Returns the type of an object.
Return type:Int
Details:The value of the type of an object can be one of the following ones:
  • ftEngine.otImage (Value = 0)
  • ftEngine. otText (Value = 1)
  • ftEngine.otCircle (Value = 2)
  • ftEngine.otBox (Value = 3)
  • ftEngine.otZoneBox (Value = 4)
  • ftEngine.otZoneCircle (Value = 5)
  • ftEngine.otTileMap (Value = 6)
  • ftEngine.otTextMulti (Value = 7)
  • ftEngine.otPoint (Value = 8)
  • ftEngine.otStickMan (Value = 9)
  • ftEngine.otOval (Value = 10)
  • ftEngine.otLine (Value = 11)
  • ftEngine.otPoly (Value = 12)
  • ftEngine.otPivot (Value = 13)

Method GetVector:Float[](vecDistance:Float, vecAngle:Float, relative:Bool=False)

Syntax:


Float[] = ftObject.GetVector (vecDistance:Float, vecAngle:Float, relative:Bool=False)
Description:Determines a 2D vector from the objects center calculated by the given distance and angle.
Return type:Float[]
Parameters:
NameTypeValue
vecDistanceFloat
vecAngleFloat
relativeBoolFalse
Method GetVectorAngle:Float(vecXPos:Float, vecYPos:Float, relative:Int=False)

Syntax:


Float = ftObject.GetVectorAngle (vecXPos:Float, vecYPos:Float, relative:Int=False)
Description:Get the angle from the objects center to the given vector.
Return type:Float
Parameters:
NameTypeValue
vecXPosFloat
vecYPosFloat
relativeIntFalse
Method GetVectorDist:Float(vecXPos:Float, vecYPos:Float)

Syntax:


Float = ftObject.GetVectorDist (vecXPos:Float, vecYPos:Float)
Description:Get the distance in pixel from the objects center to the given vector.
Return type:Float
Parameters:
NameTypeValue
vecXPosFloat
vecYPosFloat
Method GetVisible:Bool()

Syntax:


Bool = ftObject.GetVisible ()
Description:Returns the visible flag.
Return type:Bool
Method GetWidth:Float()

Syntax:


Float = ftObject.GetWidth ()
Description:Returns the width of an object.
Return type:Float
Details:The returned value is the stored width multiplied by the X scale factor.
Method PauseTimerAll:Void()

Syntax:


ftObject.PauseTimerAll ()
Description:Pause all timer of an object.
Method PauseTransAll:Void()

Syntax:


ftObject.PauseTransAll ()
Description:Pause all transitions attached to an object.
Method Remove:Void(directFlag:Bool = False)

Syntax:


ftObject.Remove (directFlag:Bool = False)
Changes:Changed in v1.56 so it removes an attached animation and an attached tilemap too.
Description:Removes an object.
Parameters:
NameTypeValue
directFlagBoolFalse
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftObject.Render (xoff:Float=0.0, yoff:Float=0.0)
Changes:Changed in v1.55.
Description:Renders an object.
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method ResumeTimerAll:Void()

Syntax:


ftObject.ResumeTimerAll ()
Description:Resume all paused timer of an object.
Method ResumeTransAll:Void()

Syntax:


ftObject.ResumeTransAll ()
Description:Resume all transitions attached to an object.
Method SetActive:Void (activeFlag:Bool = True )

Syntax:


ftObject.SetActive (activeFlag:Bool = True)
Description:Set the active flag.
Parameters:
NameTypeValue
activeFlagBoolTrue
Method SetActiveAnim:Void (animName:String)

Syntax:


ftObject.SetActiveAnim (animName:String)
Description:Set the current active animation.
Parameters:
NameTypeValue
animNameString
Method SetAlpha:Void(newAlpha:Float, relative:Int=False)

Syntax:


ftObject.SetAlpha (newAlpha:Float, relative:Int=False)
Description:Set the alpha value of an object. (Ranging from 0.0 to 1.0)
Parameters:
NameTypeValue
newAlphaFloat
relativeIntFalse
Method SetAngle:Void (newAngle:Float, relative:Int = False )

Syntax:


ftObject.SetAngle (newAngle:Float, relative:Int = False)
Description:Set the objects angle.
Parameters:
NameTypeValue
newAngleFloat
relativeIntFalse
Method SetAngleOffset:Void (angleOffset:Float )

Syntax:


ftObject.SetAngleOffset (angleOffset:Float)
Changes:Changed in version 1.54.
Description:Set the objects angle offset manually.
Parameters:
NameTypeValue
angleOffsetFloat
Details:Normally it is set from loading an image from a sprite atlas where the image is already rotated.
Method SetAnimFrame:Void (frame:Float )

Syntax:


ftObject.SetAnimFrame (frame:Float)
Description:Set the current animation frame. The frame number starts with 1.
Parameters:
NameTypeValue
frameFloat
Method SetAnimPaused:Void (pauseFlag:Bool = False )

Syntax:


ftObject.SetAnimPaused (pauseFlag:Bool = False)
Description:Set the pause flag for the animation of an animated object.
Parameters:
NameTypeValue
pauseFlagBoolFalse
Method SetAnimRepeatCount:Void (repeatCount:Int = -1)

Syntax:


ftObject.SetAnimRepeatCount (repeatCount:Int = -1)
Changes:New in version 1.54.
Description:Set the repeat count of the current animation.
Parameters:
NameTypeValue
repeatCountInt-1
Details:The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself.
Method SetAnimTime:Void (time:Float = 10.0 )

Syntax:


ftObject.SetAnimTime (time:Float = 10.0)
Description:Set the animation range for an animated object.
Parameters:
NameTypeValue
timeFloat10.0
Details: Method SetAnimRange:Void (startFrame:Float, endFrame:Float )
Self.frameStart = startFrame
Self.frameEnd = endFrame
Self.animTime = (startFrame-1) * Self.frameTime
Self.frameLength = endFrame - startFrame + 1
End
Set the factor for the animation frame time.
The default value is 10.0. The higher the value is, the longer a frame is displayed.
Method SetAnimated:Void (animFlag:Bool = True )

Syntax:


ftObject.SetAnimated (animFlag:Bool = True)
Description:Turn the animation of an animated object on/off.
Parameters:
NameTypeValue
animFlagBoolTrue
Method SetBlendMode:Void (blendmode:Int = 0)

Syntax:


ftObject.SetBlendMode (blendmode:Int = 0)
Description:Set the blend mode of an object.
Parameters:
NameTypeValue
blendmodeInt0
Method SetColGroup:Void (collisionGroup:Int)

Syntax:


ftObject.SetColGroup (collisionGroup:Int)
Description:Set the objects collision group.
Parameters:
NameTypeValue
collisionGroupInt
Details:A value of 0 will disable the collision, a value between 1 and 32 will set the collision group.
Method SetColScale:Void (colScale:Float = 1.0)

Syntax:


ftObject.SetColScale (colScale:Float = 1.0)
Changes:Fixed in v1.54
Description:Sets the collision scale factor of an object.
Parameters:
NameTypeValue
colScaleFloat1.0
Details:The collision scale affects the calculation of the collision type objects (circle, bounding box, rotated box)
Method SetColType:Void (colltype:Int)

Syntax:


ftObject.SetColType (colltype:Int)
Description:Set the collision type of an object.
Parameters:
NameTypeValue
colltypeInt
Details:Collision types can be:
  • Const ctCircle% = 0
  • Const ctBox% = 1 (this will check against the rotated box of the object)
  • Const ctBound% = 2 (This will check against the bounding box of the object)
  • Const ctLine% = 3

Example:
Method OnCreate:Int()
+shotObj.SetSpeed(10)
Method GetTargetDist:Float(targetObj:ftObject, useRadius:Bool = False)

Syntax:


Float = ftObject.GetTargetDist (targetObj:ftObject, useRadius:Bool = False)
Description:Get the distance to a target object.
Return type:Float
Parameters:
NameTypeValue
targetObjftObject
useRadiusBoolFalse
Details:Which the useRadius flag set, it will substract the radius of each object from the distance
Method GetText:String ()

Syntax:


String = ftObject.GetText ()
Description:Get the text field of an object.
Return type:String
Method GetTileAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftObject.GetTileAt (xp:Int,yp:Int)
Description:Returns the tile index at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Method GetTileCount:Int()

Syntax:


Int = ftObject.GetTileCount ()
Description:Returns the total number of tiles of a tilemap.
Return type:Int
Method GetTileCountX:Int()

Syntax:


Int = ftObject.GetTileCountX ()
Description:Returns the number of tiles in the X direction.
Return type:Int
Method GetTileCountY:Int()

Syntax:


Int = ftObject.GetTileCountY ()
Description:Returns the number of tiles in the Y direction.
Return type:Int
Method GetTileHeight:Int(index:Int)

Syntax:


Int = ftObject.GetTileHeight (index:Int)
Description:Returns the height of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTileID:Int(index:Int)

Syntax:


Int = ftObject.GetTileID (index:Int)
Description:Returns the ID of the tiles texture map, at the given index, starting from zero.
Return type:Int
Parameters:
NameTypeValue
indexInt
Details:It returns -1 if there is no tile.
Method GetTileID:Int(column:Int, row:Int)

Syntax:


Int = ftObject.GetTileID (column:Int, row:Int)
Description:Returns the ID of the tiles texture map, at the given map row and column, starting from zero.
Return type:Int
Parameters:
NameTypeValue
columnInt
rowInt
Details:It returns -1 if there is no tile.
Method GetTileIDAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftObject.GetTileIDAt (xp:Int,yp:Int)
Description:Returns the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Details:It returns -1 if there is no tile.
Method GetTileMap:ftTileMap()

Syntax:


ftTileMap = ftObject.GetTileMap ()
Changes:New in v1.56
Description:Returns the tileMap of this object.
Return type:ftTileMap
Method GetTilePosX:Float(index:Int)

Syntax:


Float = ftObject.GetTilePosX (index:Int)
Description:Returns the X position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTilePosY:Float(index:Int)

Syntax:


Float = ftObject.GetTilePosY (index:Int)
Description:Returns the Y position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTileWidth:Int(index:Int)

Syntax:


Int = ftObject.GetTileWidth (index:Int)
Description:Returns the width of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTouchMode:Int()

Syntax:


Int = ftObject.GetTouchMode ()
Description:Returns the touchmode of an object.
Return type:Int
Method GetTransitionCount:Int ()

Syntax:


Int = ftObject.GetTransitionCount ()
Description:Returns the amount of active transitions of an object.
Return type:Int
Method GetType:Int ()

Syntax:


Int = ftObject.GetType ()
Changes:Docs changed in v1.56
Description:Returns the type of an object.
Return type:Int
Details:The value of the type of an object can be one of the following ones:
  • ftEngine.otImage (Value = 0)
  • ftEngine. otText (Value = 1)
  • ftEngine.otCircle (Value = 2)
  • ftEngine.otBox (Value = 3)
  • ftEngine.otZoneBox (Value = 4)
  • ftEngine.otZoneCircle (Value = 5)
  • ftEngine.otTileMap (Value = 6)
  • ftEngine.otTextMulti (Value = 7)
  • ftEngine.otPoint (Value = 8)
  • ftEngine.otStickMan (Value = 9)
  • ftEngine.otOval (Value = 10)
  • ftEngine.otLine (Value = 11)
  • ftEngine.otPoly (Value = 12)
  • ftEngine.otPivot (Value = 13)

Method GetVector:Float[](vecDistance:Float, vecAngle:Float, relative:Bool=False)

Syntax:


Float[] = ftObject.GetVector (vecDistance:Float, vecAngle:Float, relative:Bool=False)
Description:Determines a 2D vector from the objects center calculated by the given distance and angle.
Return type:Float[]
Parameters:
NameTypeValue
vecDistanceFloat
vecAngleFloat
relativeBoolFalse
Method GetVectorAngle:Float(vecXPos:Float, vecYPos:Float, relative:Int=False)

Syntax:


Float = ftObject.GetVectorAngle (vecXPos:Float, vecYPos:Float, relative:Int=False)
Description:Get the angle from the objects center to the given vector.
Return type:Float
Parameters:
NameTypeValue
vecXPosFloat
vecYPosFloat
relativeIntFalse
Method GetVectorDist:Float(vecXPos:Float, vecYPos:Float)

Syntax:


Float = ftObject.GetVectorDist (vecXPos:Float, vecYPos:Float)
Description:Get the distance in pixel from the objects center to the given vector.
Return type:Float
Parameters:
NameTypeValue
vecXPosFloat
vecYPosFloat
Method GetVisible:Bool()

Syntax:


Bool = ftObject.GetVisible ()
Description:Returns the visible flag.
Return type:Bool
Method GetWidth:Float()

Syntax:


Float = ftObject.GetWidth ()
Description:Returns the width of an object.
Return type:Float
Details:The returned value is the stored width multiplied by the X scale factor.
Method PauseTimerAll:Void()

Syntax:


ftObject.PauseTimerAll ()
Description:Pause all timer of an object.
Method PauseTransAll:Void()

Syntax:


ftObject.PauseTransAll ()
Description:Pause all transitions attached to an object.
Method Remove:Void(directFlag:Bool = False)

Syntax:


ftObject.Remove (directFlag:Bool = False)
Changes:Changed in v1.56 so it removes an attached animation and an attached tilemap too.
Description:Removes an object.
Parameters:
NameTypeValue
directFlagBoolFalse
Method Render:Void(xoff:Float=0.0, yoff:Float=0.0)

Syntax:


ftObject.Render (xoff:Float=0.0, yoff:Float=0.0)
Changes:Changed in v1.55.
Description:Renders an object.
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method ResumeTimerAll:Void()

Syntax:


ftObject.ResumeTimerAll ()
Description:Resume all paused timer of an object.
Method ResumeTransAll:Void()

Syntax:


ftObject.ResumeTransAll ()
Description:Resume all transitions attached to an object.
Method SetActive:Void (activeFlag:Bool = True )

Syntax:


ftObject.SetActive (activeFlag:Bool = True)
Description:Set the active flag.
Parameters:
NameTypeValue
activeFlagBoolTrue
Method SetActiveAnim:Void (animName:String)

Syntax:


ftObject.SetActiveAnim (animName:String)
Description:Set the current active animation.
Parameters:
NameTypeValue
animNameString
Method SetAlpha:Void(newAlpha:Float, relative:Int=False)

Syntax:


ftObject.SetAlpha (newAlpha:Float, relative:Int=False)
Description:Set the alpha value of an object. (Ranging from 0.0 to 1.0)
Parameters:
NameTypeValue
newAlphaFloat
relativeIntFalse
Method SetAngle:Void (newAngle:Float, relative:Int = False )

Syntax:


ftObject.SetAngle (newAngle:Float, relative:Int = False)
Description:Set the objects angle.
Parameters:
NameTypeValue
newAngleFloat
relativeIntFalse
Method SetAngleOffset:Void (angleOffset:Float )

Syntax:


ftObject.SetAngleOffset (angleOffset:Float)
Changes:Changed in version 1.54.
Description:Set the objects angle offset manually.
Parameters:
NameTypeValue
angleOffsetFloat
Details:Normally it is set from loading an image from a sprite atlas where the image is already rotated.
Method SetAnimFrame:Void (frame:Float )

Syntax:


ftObject.SetAnimFrame (frame:Float)
Description:Set the current animation frame. The frame number starts with 1.
Parameters:
NameTypeValue
frameFloat
Method SetAnimPaused:Void (pauseFlag:Bool = False )

Syntax:


ftObject.SetAnimPaused (pauseFlag:Bool = False)
Description:Set the pause flag for the animation of an animated object.
Parameters:
NameTypeValue
pauseFlagBoolFalse
Method SetAnimRepeatCount:Void (repeatCount:Int = -1)

Syntax:


ftObject.SetAnimRepeatCount (repeatCount:Int = -1)
Changes:New in version 1.54.
Description:Set the repeat count of the current animation.
Parameters:
NameTypeValue
repeatCountInt-1
Details:The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself.
Method SetAnimTime:Void (time:Float = 10.0 )

Syntax:


ftObject.SetAnimTime (time:Float = 10.0)
Description:Set the animation range for an animated object.
Parameters:
NameTypeValue
timeFloat10.0
Details: Method SetAnimRange:Void (startFrame:Float, endFrame:Float )
Self.frameStart = startFrame
Self.frameEnd = endFrame
Self.animTime = (startFrame-1) * Self.frameTime
Self.frameLength = endFrame - startFrame + 1
End
Set the factor for the animation frame time.
The default value is 10.0. The higher the value is, the longer a frame is displayed.
Method SetAnimated:Void (animFlag:Bool = True )

Syntax:


ftObject.SetAnimated (animFlag:Bool = True)
Description:Turn the animation of an animated object on/off.
Parameters:
NameTypeValue
animFlagBoolTrue
Method SetBlendMode:Void (blendmode:Int = 0)

Syntax:


ftObject.SetBlendMode (blendmode:Int = 0)
Description:Set the blend mode of an object.
Parameters:
NameTypeValue
blendmodeInt0
Method SetColGroup:Void (collisionGroup:Int)

Syntax:


ftObject.SetColGroup (collisionGroup:Int)
Description:Set the objects collision group.
Parameters:
NameTypeValue
collisionGroupInt
Details:A value of 0 will disable the collision, a value between 1 and 32 will set the collision group.
Method SetColScale:Void (colScale:Float = 1.0)

Syntax:


ftObject.SetColScale (colScale:Float = 1.0)
Changes:Fixed in v1.54
Description:Sets the collision scale factor of an object.
Parameters:
NameTypeValue
colScaleFloat1.0
Details:The collision scale affects the calculation of the collision type objects (circle, bounding box, rotated box)
Method SetColType:Void (colltype:Int)

Syntax:


ftObject.SetColType (colltype:Int)
Description:Set the collision type of an object.
Parameters:
NameTypeValue
colltypeInt
Details:Collision types can be:
  • Const ctCircle% = 0
  • Const ctBox% = 1 (this will check against the rotated box of the object)
  • Const ctBound% = 2 (This will check against the bounding box of the object)
  • Const ctLine% = 3

Example:
Method OnCreate:Int()
         ' Create an instance of the engine
         eng = New engine
         
@@ -66,5 +66,5 @@ 

Module fantomEngine.cftObject

Method SetColWith:Void (startIndex:Int, endIndex:Int, boolFlag:Bool)

Syntax:


ftObject.SetColWith (startIndex:Int, endIndex:Int, boolFlag:Bool)
Description:Set with which collision groups an object can collide.
Parameters:
NameTypeValue
startIndexInt
endIndexInt
boolFlagBool
Details:Indexes go from 1 to 32.
Method SetColWith:Void (index:Int,boolFlag:Int)

Syntax:


ftObject.SetColWith (index:Int,boolFlag:Int)
Description:Set with which collision group an object can collide.
Parameters:
NameTypeValue
indexInt
boolFlagInt
Details:Indexes go from 1 to 32.
Method SetColor:Void(cRed:Float, cGreen:Float, cBlue:Float)

Syntax:


ftObject.SetColor (cRed:Float, cGreen:Float, cBlue:Float)
Description:Set the color of an object.
Parameters:
NameTypeValue
cRedFloat
cGreenFloat
cBlueFloat
Method SetCurrImage:Void(index:Int, _frameIndex:Int)

Syntax:


ftObject.SetCurrImage (index:Int, _frameIndex:Int)
Description:Sets the current image and frame of the object to be drawn. Image index and frame index start with 1.
Parameters:
NameTypeValue
indexInt
_frameIndexInt
Method SetDataObj:Void (obj:Object)

Syntax:


ftObject.SetDataObj (obj:Object)
Description:Sets the data object of this object.
Parameters:
NameTypeValue
objObject
Method SetFlip:Void (vf:Bool,hf:Bool)

Syntax:


ftObject.SetFlip (vf:Bool,hf:Bool)
Description:Activate horizontal and vertical image flip.
Parameters:
NameTypeValue
vfBool
hfBool
Method SetFlipH:Void (hf:Bool)

Syntax:


ftObject.SetFlipH (hf:Bool)
Description:Activate horizontal image flip.
Parameters:
NameTypeValue
hfBool
Method SetFlipV:Void (vf:Bool)

Syntax:


ftObject.SetFlipV (vf:Bool)
Description:Activate vertical image flip.
Parameters:
NameTypeValue
vfBool
Method SetFriction:Void (newFriction:Float, relative:Int = False )

Syntax:


ftObject.SetFriction (newFriction:Float, relative:Int = False)
Description:Set the objects friction.
Parameters:
NameTypeValue
newFrictionFloat
relativeIntFalse
Method SetGroupID:Void (groupId:Int)

Syntax:


ftObject.SetGroupID (groupId:Int)
Description:Set the objects group ID.
Parameters:
NameTypeValue
groupIdInt
Method SetHandle:Void (hx:Float, hy:Float )

Syntax:


ftObject.SetHandle (hx:Float, hy:Float)
Description:Set the handle/hotspot of an object.
Parameters:
NameTypeValue
hxFloat
hyFloat
Details:The handle determines the relative position of the objects hotspot (images, primitives).
A handle of 0.5/0.5 is in the center of the object. A handle of 0.0/0.0 is at the top left corner.
Method SetHeight:Void (height:Float )

Syntax:


ftObject.SetHeight (height:Float)
Description:Set the height of an object.
Parameters:
NameTypeValue
heightFloat
Details:The stored height is the result of the given parameter divided by the current Y scale factor.
Method SetID:Void (i:Int )

Syntax:


ftObject.SetID (i:Int)
Description:Set the object ID.
Parameters:
NameTypeValue
iInt
Method SetImage:Void(index:Int, filename:String)

Syntax:


ftObject.SetImage (index:Int, filename:String)
Description:Sets a single image (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
filenameString
Method SetImage:Void(index:Int, image:Image)

Syntax:


ftObject.SetImage (index:Int, image:Image)
Description:Sets a single image (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
imageImage
Method SetImageObj:Void(index:Int, imageObj:ftImage)

Syntax:


ftObject.SetImageObj (index:Int, imageObj:ftImage)
Description:Sets a single image object (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
imageObjftImage
Method SetLayer:Void(newLayer:ftLayer)

Syntax:


ftObject.SetLayer (newLayer:ftLayer)
Description:Set the layer of an object.
Parameters:
NameTypeValue
newLayerftLayer
Method SetMaxSpeed:Void (maxSpeed:Float )

Syntax:


ftObject.SetMaxSpeed (maxSpeed:Float)
Description:Set the maximum speed of an object.
Parameters:
NameTypeValue
maxSpeedFloat
Method SetMinSpeed:Void (minSpeed:Float )

Syntax:


ftObject.SetMinSpeed (minSpeed:Float)
Description:Set the minimum speed of an object.
Parameters:
NameTypeValue
minSpeedFloat
Method SetName:Void (newName:String )

Syntax:


ftObject.SetName (newName:String)
Description:Set the name of an object.
Parameters:
NameTypeValue
newNameString
Method SetParent:Void(newParent:ftObject)

Syntax:


ftObject.SetParent (newParent:ftObject)
Description:Set the parent of an object.
Parameters:
NameTypeValue
newParentftObject
Method SetPos:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftObject.SetPos (x:Float, y:Float, relative:Int = False)
Description:Set the objects X/Y position.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Method SetPosX:Void (x:Float, relative:Int = False )

Syntax:


ftObject.SetPosX (x:Float, relative:Int = False)
Description:Set the X-position of an object.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Method SetPosY:Void (y:Float, relative:Int = False )

Syntax:


ftObject.SetPosY (y:Float, relative:Int = False)
Description:Set the Y-position of an object.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Method SetPosZ:Void (z:Float, relative:Int = False )

Syntax:


ftObject.SetPosZ (z:Float, relative:Int = False)
Description:Set the Z-position of an object.
Parameters:
NameTypeValue
zFloat
relativeIntFalse
Method SetRadius:Void (newRadius:Float, relative:Int = False )

Syntax:


ftObject.SetRadius (newRadius:Float, relative:Int = False)
Description:Set the radius of an object.
Parameters:
NameTypeValue
newRadiusFloat
relativeIntFalse
Method SetRenderArea:Void (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float)

Syntax:


ftObject.SetRenderArea (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float)
Description:Sets the area of an objects texture that is to be drawn.
Parameters:
NameTypeValue
renderOffsetXFloat
renderOffsetYFloat
renderWidthFloat
renderHeightFloat
Method SetScale:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScale (newScale:Float, relative:Int = False)
Description:Set the scale of an object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetScaleX:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScaleX (newScale:Float, relative:Int = False)
Description:Sets the X scale factor (width) of the object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetScaleY:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScaleY (newScale:Float, relative:Int = False)
Description:Sets the Y scale factor (height) of the object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetSpeed:Void (newSpeed:Float, ang:Float=9876.5)

Syntax:


ftObject.SetSpeed (newSpeed:Float, ang:Float=9876.5)
Description:Set the speed of an object. If an angle is given, the speed will be added in that direction. If not, then in the objects angle.
Parameters:
NameTypeValue
newSpeedFloat
angFloat9876.5
Method SetSpeedAngle:Void (newAngle:Float)

Syntax:


ftObject.SetSpeedAngle (newAngle:Float)
Description:Set the objects speed angle.
Parameters:
NameTypeValue
newAngleFloat
Method SetSpeedX:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedX (newSpeed:Float)
Description:Set the objects X speed.
Parameters:
NameTypeValue
newSpeedFloat
Method SetSpeedY:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedY (newSpeed:Float)
Description:Set the objects Y speed.
Parameters:
NameTypeValue
newSpeedFloat
Method SetSpin:Void (newSpin:Float, relative:Int = False )

Syntax:


ftObject.SetSpin (newSpin:Float, relative:Int = False)
Description:Set the objects spin speed.
Parameters:
NameTypeValue
newSpinFloat
relativeIntFalse
Method SetTag:Void (t:Int )

Syntax:


ftObject.SetTag (t:Int)
Description:Set the objects tag field.
Parameters:
NameTypeValue
tInt
Method SetText:Void (t:String )

Syntax:


ftObject.SetText (t:String)
Description:Set the text of an object.
Parameters:
NameTypeValue
tString
Method SetTileID:Void(column:Int, row:Int, id:Int)

Syntax:


ftObject.SetTileID (column:Int, row:Int, id:Int)
Description:Sets the ID of the tiles texture map, at the given map row and column, starting from zero.
Parameters:
NameTypeValue
columnInt
rowInt
idInt
Method SetTileIDAt:Void(xp:Int,yp:Int, id:Int=-1)

Syntax:


ftObject.SetTileIDAt (xp:Int,yp:Int, id:Int=-1)
Description:Sets the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Parameters:
NameTypeValue
xpInt
ypInt
idInt-1
Method SetTileSModXY:Void(xMod:Float, yMod:Float)

Syntax:


ftObject.SetTileSModXY (xMod:Float, yMod:Float)
Description:Sets the tile scale modification factors which are used during rendering.
Parameters:
NameTypeValue
xModFloat
yModFloat
Method SetTouchMode:Void (touch:Int)

Syntax:


ftObject.SetTouchMode (touch:Int)
Description:Set the objects touch mode.
Parameters:
NameTypeValue
touchInt
Details:Touch modes can be:
  • Const tmCircle% = 1
  • Const tmBound% = 2 (This will check against the bounding box of the object)
  • Const tmBox% = 3 (this will check against the rotated box of the object)

Method SetVisible:Void (visible:Bool = True )

Syntax:


ftObject.SetVisible (visible:Bool = True)
Description:Set if an object is visible.
Parameters:
NameTypeValue
visibleBoolTrue
Method SetWidth:Void (width:Float )

Syntax:


ftObject.SetWidth (width:Float)
Description:Set the width of an object.
Parameters:
NameTypeValue
widthFloat
Details:The stored width is the result of the given parameter divided by the current X scale factor.
Method SetWrapScreen:Void (ws:Bool )

Syntax:


ftObject.SetWrapScreen (ws:Bool)
Description:Set if an object will wrap around the screen borders automatically.
Parameters:
NameTypeValue
wsBool
Method SetWrapScreenX:Void (wsx:Bool )

Syntax:


ftObject.SetWrapScreenX (wsx:Bool)
Description:Set if an object will wrap around the left/right screen borders automatically.
Parameters:
NameTypeValue
wsxBool
Method SetWrapScreenY:Void (wsy:Bool )

Syntax:


ftObject.SetWrapScreenY (wsy:Bool)
Description:Set if an object will wrap around the top/bottom screen borders automatically.
Parameters:
NameTypeValue
wsyBool
Method Update:Void(delta:Float=1.0)

Syntax:


ftObject.Update (delta:Float=1.0)
Changes:Changed in v1.54
Description:Update an object with the given updatespeed factor.
Parameters:
NameTypeValue
deltaFloat1.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+End
Method SetColWith:Void (startIndex:Int, endIndex:Int, boolFlag:Bool)

Syntax:


ftObject.SetColWith (startIndex:Int, endIndex:Int, boolFlag:Bool)
Description:Set with which collision groups an object can collide.
Parameters:
NameTypeValue
startIndexInt
endIndexInt
boolFlagBool
Details:Indexes go from 1 to 32.
Method SetColWith:Void (index:Int,boolFlag:Int)

Syntax:


ftObject.SetColWith (index:Int,boolFlag:Int)
Description:Set with which collision group an object can collide.
Parameters:
NameTypeValue
indexInt
boolFlagInt
Details:Indexes go from 1 to 32.
Method SetColor:Void(cRed:Float, cGreen:Float, cBlue:Float)

Syntax:


ftObject.SetColor (cRed:Float, cGreen:Float, cBlue:Float)
Description:Set the color of an object.
Parameters:
NameTypeValue
cRedFloat
cGreenFloat
cBlueFloat
Method SetCurrImage:Void(index:Int, _frameIndex:Int)

Syntax:


ftObject.SetCurrImage (index:Int, _frameIndex:Int)
Description:Sets the current image and frame of the object to be drawn. Image index and frame index start with 1.
Parameters:
NameTypeValue
indexInt
_frameIndexInt
Method SetDataObj:Void (obj:Object)

Syntax:


ftObject.SetDataObj (obj:Object)
Description:Sets the data object of this object.
Parameters:
NameTypeValue
objObject
Method SetFlip:Void (vf:Bool,hf:Bool)

Syntax:


ftObject.SetFlip (vf:Bool,hf:Bool)
Description:Activate horizontal and vertical image flip.
Parameters:
NameTypeValue
vfBool
hfBool
Method SetFlipH:Void (hf:Bool)

Syntax:


ftObject.SetFlipH (hf:Bool)
Description:Activate horizontal image flip.
Parameters:
NameTypeValue
hfBool
Method SetFlipV:Void (vf:Bool)

Syntax:


ftObject.SetFlipV (vf:Bool)
Description:Activate vertical image flip.
Parameters:
NameTypeValue
vfBool
Method SetFriction:Void (newFriction:Float, relative:Int = False )

Syntax:


ftObject.SetFriction (newFriction:Float, relative:Int = False)
Description:Set the objects friction.
Parameters:
NameTypeValue
newFrictionFloat
relativeIntFalse
Method SetGroupID:Void (groupId:Int)

Syntax:


ftObject.SetGroupID (groupId:Int)
Description:Set the objects group ID.
Parameters:
NameTypeValue
groupIdInt
Method SetHandle:Void (hx:Float, hy:Float )

Syntax:


ftObject.SetHandle (hx:Float, hy:Float)
Description:Set the handle/hotspot of an object.
Parameters:
NameTypeValue
hxFloat
hyFloat
Details:The handle determines the relative position of the objects hotspot (images, primitives).
A handle of 0.5/0.5 is in the center of the object. A handle of 0.0/0.0 is at the top left corner.
Method SetHeight:Void (height:Float )

Syntax:


ftObject.SetHeight (height:Float)
Description:Set the height of an object.
Parameters:
NameTypeValue
heightFloat
Details:The stored height is the result of the given parameter divided by the current Y scale factor.
Method SetID:Void (i:Int )

Syntax:


ftObject.SetID (i:Int)
Description:Set the object ID.
Parameters:
NameTypeValue
iInt
Method SetImage:Void(index:Int, filename:String)

Syntax:


ftObject.SetImage (index:Int, filename:String)
Description:Sets a single image (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
filenameString
Method SetImage:Void(index:Int, image:Image)

Syntax:


ftObject.SetImage (index:Int, image:Image)
Description:Sets a single image (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
imageImage
Method SetImageObj:Void(index:Int, imageObj:ftImage)

Syntax:


ftObject.SetImageObj (index:Int, imageObj:ftImage)
Description:Sets a single image object (frame) of an object at the given index. Index starts at 1.
Parameters:
NameTypeValue
indexInt
imageObjftImage
Method SetLayer:Void(newLayer:ftLayer)

Syntax:


ftObject.SetLayer (newLayer:ftLayer)
Description:Set the layer of an object.
Parameters:
NameTypeValue
newLayerftLayer
Method SetMaxSpeed:Void (maxSpeed:Float )

Syntax:


ftObject.SetMaxSpeed (maxSpeed:Float)
Description:Set the maximum speed of an object.
Parameters:
NameTypeValue
maxSpeedFloat
Method SetMinSpeed:Void (minSpeed:Float )

Syntax:


ftObject.SetMinSpeed (minSpeed:Float)
Description:Set the minimum speed of an object.
Parameters:
NameTypeValue
minSpeedFloat
Method SetName:Void (newName:String )

Syntax:


ftObject.SetName (newName:String)
Description:Set the name of an object.
Parameters:
NameTypeValue
newNameString
Method SetParent:Void(newParent:ftObject)

Syntax:


ftObject.SetParent (newParent:ftObject)
Description:Set the parent of an object.
Parameters:
NameTypeValue
newParentftObject
Method SetPos:Void (x:Float, y:Float, relative:Int = False )

Syntax:


ftObject.SetPos (x:Float, y:Float, relative:Int = False)
Description:Set the objects X/Y position.
Parameters:
NameTypeValue
xFloat
yFloat
relativeIntFalse
Method SetPosX:Void (x:Float, relative:Int = False )

Syntax:


ftObject.SetPosX (x:Float, relative:Int = False)
Description:Set the X-position of an object.
Parameters:
NameTypeValue
xFloat
relativeIntFalse
Method SetPosY:Void (y:Float, relative:Int = False )

Syntax:


ftObject.SetPosY (y:Float, relative:Int = False)
Description:Set the Y-position of an object.
Parameters:
NameTypeValue
yFloat
relativeIntFalse
Method SetPosZ:Void (z:Float, relative:Int = False )

Syntax:


ftObject.SetPosZ (z:Float, relative:Int = False)
Description:Set the Z-position of an object.
Parameters:
NameTypeValue
zFloat
relativeIntFalse
Method SetRadius:Void (newRadius:Float, relative:Int = False )

Syntax:


ftObject.SetRadius (newRadius:Float, relative:Int = False)
Description:Set the radius of an object.
Parameters:
NameTypeValue
newRadiusFloat
relativeIntFalse
Method SetRenderArea:Void (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float)

Syntax:


ftObject.SetRenderArea (renderOffsetX:Float, renderOffsetY:Float, renderWidth:Float, renderHeight:Float)
Description:Sets the area of an objects texture that is to be drawn.
Parameters:
NameTypeValue
renderOffsetXFloat
renderOffsetYFloat
renderWidthFloat
renderHeightFloat
Method SetScale:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScale (newScale:Float, relative:Int = False)
Description:Set the scale of an object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetScaleX:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScaleX (newScale:Float, relative:Int = False)
Description:Sets the X scale factor (width) of the object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetScaleY:Void (newScale:Float, relative:Int = False )

Syntax:


ftObject.SetScaleY (newScale:Float, relative:Int = False)
Description:Sets the Y scale factor (height) of the object.
Parameters:
NameTypeValue
newScaleFloat
relativeIntFalse
Method SetSpeed:Void (newSpeed:Float, ang:Float=9876.5)

Syntax:


ftObject.SetSpeed (newSpeed:Float, ang:Float=9876.5)
Description:Set the speed of an object. If an angle is given, the speed will be added in that direction. If not, then in the objects angle.
Parameters:
NameTypeValue
newSpeedFloat
angFloat9876.5
Method SetSpeedAngle:Void (newAngle:Float)

Syntax:


ftObject.SetSpeedAngle (newAngle:Float)
Description:Set the objects speed angle.
Parameters:
NameTypeValue
newAngleFloat
Method SetSpeedX:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedX (newSpeed:Float)
Description:Set the objects X speed.
Parameters:
NameTypeValue
newSpeedFloat
Method SetSpeedY:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedY (newSpeed:Float)
Description:Set the objects Y speed.
Parameters:
NameTypeValue
newSpeedFloat
Method SetSpin:Void (newSpin:Float, relative:Int = False )

Syntax:


ftObject.SetSpin (newSpin:Float, relative:Int = False)
Description:Set the objects spin speed.
Parameters:
NameTypeValue
newSpinFloat
relativeIntFalse
Method SetTag:Void (t:Int )

Syntax:


ftObject.SetTag (t:Int)
Description:Set the objects tag field.
Parameters:
NameTypeValue
tInt
Method SetText:Void (t:String )

Syntax:


ftObject.SetText (t:String)
Description:Set the text of an object.
Parameters:
NameTypeValue
tString
Method SetTileID:Void(column:Int, row:Int, id:Int)

Syntax:


ftObject.SetTileID (column:Int, row:Int, id:Int)
Description:Sets the ID of the tiles texture map, at the given map row and column, starting from zero.
Parameters:
NameTypeValue
columnInt
rowInt
idInt
Method SetTileIDAt:Void(xp:Int,yp:Int, id:Int=-1)

Syntax:


ftObject.SetTileIDAt (xp:Int,yp:Int, id:Int=-1)
Description:Sets the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Parameters:
NameTypeValue
xpInt
ypInt
idInt-1
Method SetTileSModXY:Void(xMod:Float, yMod:Float)

Syntax:


ftObject.SetTileSModXY (xMod:Float, yMod:Float)
Description:Sets the tile scale modification factors which are used during rendering.
Parameters:
NameTypeValue
xModFloat
yModFloat
Method SetTouchMode:Void (touch:Int)

Syntax:


ftObject.SetTouchMode (touch:Int)
Description:Set the objects touch mode.
Parameters:
NameTypeValue
touchInt
Details:Touch modes can be:
  • Const tmCircle% = 1
  • Const tmBound% = 2 (This will check against the bounding box of the object)
  • Const tmBox% = 3 (this will check against the rotated box of the object)

Method SetVisible:Void (visible:Bool = True )

Syntax:


ftObject.SetVisible (visible:Bool = True)
Description:Set if an object is visible.
Parameters:
NameTypeValue
visibleBoolTrue
Method SetWidth:Void (width:Float )

Syntax:


ftObject.SetWidth (width:Float)
Description:Set the width of an object.
Parameters:
NameTypeValue
widthFloat
Details:The stored width is the result of the given parameter divided by the current X scale factor.
Method SetWrapScreen:Void (ws:Bool )

Syntax:


ftObject.SetWrapScreen (ws:Bool)
Description:Set if an object will wrap around the screen borders automatically.
Parameters:
NameTypeValue
wsBool
Method SetWrapScreenX:Void (wsx:Bool )

Syntax:


ftObject.SetWrapScreenX (wsx:Bool)
Description:Set if an object will wrap around the left/right screen borders automatically.
Parameters:
NameTypeValue
wsxBool
Method SetWrapScreenY:Void (wsy:Bool )

Syntax:


ftObject.SetWrapScreenY (wsy:Bool)
Description:Set if an object will wrap around the top/bottom screen borders automatically.
Parameters:
NameTypeValue
wsyBool
Method Update:Void(delta:Float=1.0)

Syntax:


ftObject.Update (delta:Float=1.0)
Changes:Changed in v1.54
Description:Update an object with the given updatespeed factor.
Parameters:
NameTypeValue
deltaFloat1.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftRGBA.monkey.html b/docs/cftRGBA.monkey.html index ce05b2c..1391e2f 100644 --- a/docs/cftRGBA.monkey.html +++ b/docs/cftRGBA.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftRGBA -

Module fantomEngine.cftRGBA


The cftRGBA module provides a RGBA color class.

Table of contents:

Classes:

Class ftRGBA
Table of contents:Methods:
  • Add   ( Method Add:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Add   ( Method Add:Void(color:ftRGBA) )
  • Copy   ( Method Copy:ftRGBA() )
  • Inverse   ( Method Inverse:Void(inklAlpha:Bool = False) )
  • Multiply   ( Method Multiply:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Multiply   ( Method Multiply:Void(color:ftRGBA) )
  • New   ( Method New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Set   ( Method Set:Void (color:ftRGBA) )
  • Set   ( Method Set:Void (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Sub   ( Method Sub:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Sub   ( Method Sub:Void(color:ftRGBA) )

Method Add:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Add (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Add:Void(color:ftRGBA)

Syntax:


ftRGBA.Add (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method Copy:ftRGBA()

Syntax:


ftRGBA = ftRGBA.Copy ()
Return type:ftRGBA
Method Inverse:Void(inklAlpha:Bool = False)

Syntax:


ftRGBA.Inverse (inklAlpha:Bool = False)
Parameters:
NameTypeValue
inklAlphaBoolFalse
Method Multiply:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Multiply (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Multiply:Void(color:ftRGBA)

Syntax:


ftRGBA.Multiply (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


none = ftRGBA.New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Return type:none
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Set:Void (color:ftRGBA)

Syntax:


ftRGBA.Set (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method Set:Void (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Set (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Sub:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Sub (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Sub:Void(color:ftRGBA)

Syntax:


ftRGBA.Sub (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftRGBA


The cftRGBA module provides a RGBA color class.

Table of contents:

Classes:

Class ftRGBA
Table of contents:Methods:
  • Add   ( Method Add:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Add   ( Method Add:Void(color:ftRGBA) )
  • Copy   ( Method Copy:ftRGBA() )
  • Inverse   ( Method Inverse:Void(inklAlpha:Bool = False) )
  • Multiply   ( Method Multiply:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Multiply   ( Method Multiply:Void(color:ftRGBA) )
  • New   ( Method New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Set   ( Method Set:Void (color:ftRGBA) )
  • Set   ( Method Set:Void (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Sub   ( Method Sub:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0) )
  • Sub   ( Method Sub:Void(color:ftRGBA) )

Method Add:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Add (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Add:Void(color:ftRGBA)

Syntax:


ftRGBA.Add (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method Copy:ftRGBA()

Syntax:


ftRGBA = ftRGBA.Copy ()
Return type:ftRGBA
Method Inverse:Void(inklAlpha:Bool = False)

Syntax:


ftRGBA.Inverse (inklAlpha:Bool = False)
Parameters:
NameTypeValue
inklAlphaBoolFalse
Method Multiply:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Multiply (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Multiply:Void(color:ftRGBA)

Syntax:


ftRGBA.Multiply (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


none = ftRGBA.New (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Return type:none
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Set:Void (color:ftRGBA)

Syntax:


ftRGBA.Set (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
Method Set:Void (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Set (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Sub:Void(_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)

Syntax:


ftRGBA.Sub (_red:Float, _green:Float, _blue:Float, _alpha:Float=-1.0)
Parameters:
NameTypeValue
_redFloat
_greenFloat
_blueFloat
_alphaFloat-1.0
Method Sub:Void(color:ftRGBA)

Syntax:


ftRGBA.Sub (color:ftRGBA)
Parameters:
NameTypeValue
colorftRGBA
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftScene.monkey.html b/docs/cftScene.monkey.html index 1b48fc1..668d667 100644 --- a/docs/cftScene.monkey.html +++ b/docs/cftScene.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftScene -

Module fantomEngine.cftScene


The class ftScene groups assigned layers and lets you manage them in a combined way. Layers can be connected to several scenes at one time.

Table of contents:

Classes:

Class ftScene
Table of contents:Methods:
  • AddLayer   ( Method AddLayer:Void(layer:ftLayer) )
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 ) )   fixed in v1.54
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )   fixed in v1.54
  • GetActive   ( Method GetActive:Bool() )
  • GetVisible   ( Method GetVisible:Bool() )
  • Remove   ( Method Remove:Void() )
  • RemoveLayer   ( Method RemoveLayer:Void(layer:ftLayer) )
  • SetActive   ( Method SetActive:Void(activeFlag:Bool) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Bool = False) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )
  • SetVisible   ( Method SetVisible:Void(visibleFlag:Bool) )

Method AddLayer:Void(layer:ftLayer)

Syntax:


ftScene.AddLayer (layer:ftLayer)
Description:Add a layer to a scene.
Parameters:
NameTypeValue
layerftLayer
Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftScene.CreateTransAlpha (alpha:Float, duration:Float, relative:Int, transId:Int=0)
Changes:fixed in v1.54
Description:Create an alpha transition for the scene.
Return type:ftTrans
Parameters:
NameTypeValue
alphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftScene.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Changes:fixed in v1.54
Description:Create an position transition for the scene.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
Method GetActive:Bool()

Syntax:


Bool = ftScene.GetActive ()
Description:Returns the active flag of the scene.
Return type:Bool
Method GetVisible:Bool()

Syntax:


Bool = ftScene.GetVisible ()
Description:Returns the visible flag of the scene.
Return type:Bool
Method Remove:Void()

Syntax:


ftScene.Remove ()
Description:Remove the scene from the engine.
Method RemoveLayer:Void(layer:ftLayer)

Syntax:


ftScene.RemoveLayer (layer:ftLayer)
Description:Remove a layer from a scene.
Parameters:
NameTypeValue
layerftLayer
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftScene.SetActive (activeFlag:Bool)
Description:Set the active flag of the scenes layers.
Parameters:
NameTypeValue
activeFlagBool
Method SetAlpha:Void(newAlpha:Float, relative:Bool = False)

Syntax:


ftScene.SetAlpha (newAlpha:Float, relative:Bool = False)
Description:Set the alpha value of each layer in the scene.
Parameters:
NameTypeValue
newAlphaFloat
relativeBoolFalse
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftScene.SetPos (x:Float, y:Float, relative:Bool = False)
Description:Set the position of each layer in the scene.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftScene.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of the scenes layers.
Parameters:
NameTypeValue
visibleFlagBool
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftScene


The class ftScene groups assigned layers and lets you manage them in a combined way. Layers can be connected to several scenes at one time.

Table of contents:

Classes:

Class ftScene
Table of contents:Methods:
  • AddLayer   ( Method AddLayer:Void(layer:ftLayer) )
  • CreateTransAlpha   ( Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 ) )   fixed in v1.54
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )   fixed in v1.54
  • GetActive   ( Method GetActive:Bool() )
  • GetVisible   ( Method GetVisible:Bool() )
  • Remove   ( Method Remove:Void() )
  • RemoveLayer   ( Method RemoveLayer:Void(layer:ftLayer) )
  • SetActive   ( Method SetActive:Void(activeFlag:Bool) )
  • SetAlpha   ( Method SetAlpha:Void(newAlpha:Float, relative:Bool = False) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )
  • SetVisible   ( Method SetVisible:Void(visibleFlag:Bool) )

Method AddLayer:Void(layer:ftLayer)

Syntax:


ftScene.AddLayer (layer:ftLayer)
Description:Add a layer to a scene.
Parameters:
NameTypeValue
layerftLayer
Method CreateTransAlpha:ftTrans(alpha:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftScene.CreateTransAlpha (alpha:Float, duration:Float, relative:Int, transId:Int=0)
Changes:fixed in v1.54
Description:Create an alpha transition for the scene.
Return type:ftTrans
Parameters:
NameTypeValue
alphaFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 )

Syntax:


ftTrans = ftScene.CreateTransPos (xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0)
Changes:fixed in v1.54
Description:Create an position transition for the scene.
Return type:ftTrans
Parameters:
NameTypeValue
xtFloat
ytFloat
durationFloat
relativeInt
transIdInt0
Details:The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the ftEngine.OnLayerTrans method for the first layer of a scene.
Method GetActive:Bool()

Syntax:


Bool = ftScene.GetActive ()
Description:Returns the active flag of the scene.
Return type:Bool
Method GetVisible:Bool()

Syntax:


Bool = ftScene.GetVisible ()
Description:Returns the visible flag of the scene.
Return type:Bool
Method Remove:Void()

Syntax:


ftScene.Remove ()
Description:Remove the scene from the engine.
Method RemoveLayer:Void(layer:ftLayer)

Syntax:


ftScene.RemoveLayer (layer:ftLayer)
Description:Remove a layer from a scene.
Parameters:
NameTypeValue
layerftLayer
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftScene.SetActive (activeFlag:Bool)
Description:Set the active flag of the scenes layers.
Parameters:
NameTypeValue
activeFlagBool
Method SetAlpha:Void(newAlpha:Float, relative:Bool = False)

Syntax:


ftScene.SetAlpha (newAlpha:Float, relative:Bool = False)
Description:Set the alpha value of each layer in the scene.
Parameters:
NameTypeValue
newAlphaFloat
relativeBoolFalse
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftScene.SetPos (x:Float, y:Float, relative:Bool = False)
Description:Set the position of each layer in the scene.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftScene.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of the scenes layers.
Parameters:
NameTypeValue
visibleFlagBool
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftSound.monkey.html b/docs/cftSound.monkey.html index bdf5df9..23f4cd3 100644 --- a/docs/cftSound.monkey.html +++ b/docs/cftSound.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftSound -

Module fantomEngine.cftSound


Table of contents:

Classes:

Class ftSound
Description:The class ftSound is an object to play sounds easily.
Table of contents:Methods:
  • GetFreeSoundChannel   ( Method GetFreeSoundChannel:Int() )
  • GetPan   ( Method GetPan:Float() )
  • GetPaused   ( Method GetPaused:Bool() )
  • GetPitchRate   ( Method GetPitchRate:Float() )
  • GetVolume   ( Method GetVolume:Float() )
  • Play   ( Method Play:Int(c:Int = -1) )
  • SetPan   ( Method SetPan:Void(channelPan:Float = 0.0) )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool) )
  • SetPitchRate   ( Method SetPitchRate:Void(channelRate:Float = 1.0) )
  • SetVolume   ( Method SetVolume:Void(vol:Float = 1.0) )
  • Stop   ( Method Stop:Void(c:Int=-1) )

Method GetFreeSoundChannel:Int()

Syntax:


Int = ftSound.GetFreeSoundChannel ()
Description:Returns a free sound channel index.
Return type:Int
Method GetPan:Float()

Syntax:


Float = ftSound.GetPan ()
Description:Returns the pan value of a sound.
Return type:Float
Method GetPaused:Bool()

Syntax:


Bool = ftSound.GetPaused ()
Description:Returns the flag of a sound.
Return type:Bool
Method GetPitchRate:Float()

Syntax:


Float = ftSound.GetPitchRate ()
Description:Returns the pitch rate of a sound.
Return type:Float
Method GetVolume:Float()

Syntax:


Float = ftSound.GetVolume ()
Description:Returns the volume of a sound. Ranges from 0.0 to 1.0.
Return type:Float
Method Play:Int(c:Int = -1)

Syntax:


Int = ftSound.Play (c:Int = -1)
Description:Plays a sound. If no channel is provided, fantomEngine will determine the channel automatically.
Return type:Int
Parameters:
NameTypeValue
cInt-1
Method SetPan:Void(channelPan:Float = 0.0)

Syntax:


ftSound.SetPan (channelPan:Float = 0.0)
Description:Set the pan value of a sound. Ranges from -1.0 to 1.0.
Parameters:
NameTypeValue
channelPanFloat0.0
Details:A value of -1.0 is on the left side, a value of 1.0 represents the right side.
Method SetPaused:Void(pauseFlag:Bool)

Syntax:


ftSound.SetPaused (pauseFlag:Bool)
Description:Pause/resume a sound or a music.
Parameters:
NameTypeValue
pauseFlagBool
Method SetPitchRate:Void(channelRate:Float = 1.0)

Syntax:


ftSound.SetPitchRate (channelRate:Float = 1.0)
Description:Set the rate of a sound.
Parameters:
NameTypeValue
channelRateFloat1.0
Details:The default base note (1.0) is 'A4'. You can use the GetPitchRate("C3") function to determine the rate from a given note.
Method SetVolume:Void(vol:Float = 1.0)

Syntax:


ftSound.SetVolume (vol:Float = 1.0)
Description:Set the volume of a sound. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volFloat1.0
Method Stop:Void(c:Int=-1)

Syntax:


ftSound.Stop (c:Int=-1)
Description:Stop playing the sound. If a channel is given, it will stop that specific sound channel.
Parameters:
NameTypeValue
cInt-1
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftSound


Table of contents:

Classes:

Class ftSound
Description:The class ftSound is an object to play sounds easily.
Table of contents:Methods:
  • GetFreeSoundChannel   ( Method GetFreeSoundChannel:Int() )
  • GetPan   ( Method GetPan:Float() )
  • GetPaused   ( Method GetPaused:Bool() )
  • GetPitchRate   ( Method GetPitchRate:Float() )
  • GetVolume   ( Method GetVolume:Float() )
  • Play   ( Method Play:Int(c:Int = -1) )
  • SetPan   ( Method SetPan:Void(channelPan:Float = 0.0) )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool) )
  • SetPitchRate   ( Method SetPitchRate:Void(channelRate:Float = 1.0) )
  • SetVolume   ( Method SetVolume:Void(vol:Float = 1.0) )
  • Stop   ( Method Stop:Void(c:Int=-1) )

Method GetFreeSoundChannel:Int()

Syntax:


Int = ftSound.GetFreeSoundChannel ()
Description:Returns a free sound channel index.
Return type:Int
Method GetPan:Float()

Syntax:


Float = ftSound.GetPan ()
Description:Returns the pan value of a sound.
Return type:Float
Method GetPaused:Bool()

Syntax:


Bool = ftSound.GetPaused ()
Description:Returns the flag of a sound.
Return type:Bool
Method GetPitchRate:Float()

Syntax:


Float = ftSound.GetPitchRate ()
Description:Returns the pitch rate of a sound.
Return type:Float
Method GetVolume:Float()

Syntax:


Float = ftSound.GetVolume ()
Description:Returns the volume of a sound. Ranges from 0.0 to 1.0.
Return type:Float
Method Play:Int(c:Int = -1)

Syntax:


Int = ftSound.Play (c:Int = -1)
Description:Plays a sound. If no channel is provided, fantomEngine will determine the channel automatically.
Return type:Int
Parameters:
NameTypeValue
cInt-1
Method SetPan:Void(channelPan:Float = 0.0)

Syntax:


ftSound.SetPan (channelPan:Float = 0.0)
Description:Set the pan value of a sound. Ranges from -1.0 to 1.0.
Parameters:
NameTypeValue
channelPanFloat0.0
Details:A value of -1.0 is on the left side, a value of 1.0 represents the right side.
Method SetPaused:Void(pauseFlag:Bool)

Syntax:


ftSound.SetPaused (pauseFlag:Bool)
Description:Pause/resume a sound or a music.
Parameters:
NameTypeValue
pauseFlagBool
Method SetPitchRate:Void(channelRate:Float = 1.0)

Syntax:


ftSound.SetPitchRate (channelRate:Float = 1.0)
Description:Set the rate of a sound.
Parameters:
NameTypeValue
channelRateFloat1.0
Details:The default base note (1.0) is 'A4'. You can use the GetPitchRate("C3") function to determine the rate from a given note.
Method SetVolume:Void(vol:Float = 1.0)

Syntax:


ftSound.SetVolume (vol:Float = 1.0)
Description:Set the volume of a sound. Ranges from 0.0 to 1.0.
Parameters:
NameTypeValue
volFloat1.0
Method Stop:Void(c:Int=-1)

Syntax:


ftSound.Stop (c:Int=-1)
Description:Stop playing the sound. If a channel is given, it will stop that specific sound channel.
Parameters:
NameTypeValue
cInt-1
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftSpriteAtlas.monkey.html b/docs/cftSpriteAtlas.monkey.html index 732e85f..8c06493 100644 --- a/docs/cftSpriteAtlas.monkey.html +++ b/docs/cftSpriteAtlas.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftSpriteAtlas -

Module fantomEngine.cftSpriteAtlas


The class ftSpriteAtlas manages spritesheets inside the fantomEngine. It reduces the call to the device storage by imprting all relevant data into memory.

Table of contents:

Classes:

Class ftSpriteAtlas
Table of contents:Methods:
  • GetAngleOffset   ( Method GetAngleOffset:Float(imageName:String) )
  • GetHeight   ( Method GetHeight:Int(imageName:String) )
  • GetImage   ( Method GetImage:Image(imageName:String) )
  • GetImageCount   ( Method GetImageCount:Int() )
  • GetImageHeight   ( Method GetImageHeight:Float(imageName:String) )   New in v1.55
  • GetImageWidth   ( Method GetImageWidth:Float(imageName:String) )   New in v1.55
  • GetRotated   ( Method GetRotated:Bool(imageName:String) )
  • GetWidth   ( Method GetWidth:Int(imageName:String) )
  • Load   ( Method Load:Void(imgName:String, dataName:String) )   Fixed in version 1.54 to support LINUX lines delimiters (13,10)
  • Remove   ( Method Remove:Void(discard:Bool = False) )

Method GetAngleOffset:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetAngleOffset (imageName:String)
Description:Returns the angle offset of an image.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetHeight:Int(imageName:String)

Syntax:


Int = ftSpriteAtlas.GetHeight (imageName:String)
Description:Returns the height of an image.
Return type:Int
Parameters:
NameTypeValue
imageNameString
Method GetImage:Image(imageName:String)

Syntax:


Image = ftSpriteAtlas.GetImage (imageName:String)
Description:Returns the image with the given name.
Return type:Image
Parameters:
NameTypeValue
imageNameString
Method GetImageCount:Int()

Syntax:


Int = ftSpriteAtlas.GetImageCount ()
Description:Returns the number of images in the sprite atlas.
Return type:Int
Method GetImageHeight:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetImageHeight (imageName:String)
Changes:New in v1.55
Description:Returns the height of the subimage with the given name.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetImageWidth:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetImageWidth (imageName:String)
Changes:New in v1.55
Description:Returns the width of the subimage with the given name.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetRotated:Bool(imageName:String)

Syntax:


Bool = ftSpriteAtlas.GetRotated (imageName:String)
Description:Returns TRUE if the image with the given name is rotated inside the sprite atlas.
Return type:Bool
Parameters:
NameTypeValue
imageNameString
Method GetWidth:Int(imageName:String)

Syntax:


Int = ftSpriteAtlas.GetWidth (imageName:String)
Description:Returns the width of an image.
Return type:Int
Parameters:
NameTypeValue
imageNameString
Method Load:Void(imgName:String, dataName:String)

Syntax:


ftSpriteAtlas.Load (imgName:String, dataName:String)
Changes:Fixed in version 1.54 to support LINUX lines delimiters (13,10)
Description:Loads a sprite atlas from the given image and data file name.
Parameters:
NameTypeValue
imgNameString
dataNameString
Method Remove:Void(discard:Bool = False)

Syntax:


ftSpriteAtlas.Remove (discard:Bool = False)
Description:Remove a sprite atlas. Set discard to TRUE if you want the corresponding images to be discarded.
Parameters:
NameTypeValue
discardBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftSpriteAtlas


The class ftSpriteAtlas manages spritesheets inside the fantomEngine. It reduces the call to the device storage by imprting all relevant data into memory.

Table of contents:

Classes:

Class ftSpriteAtlas
Table of contents:Methods:
  • GetAngleOffset   ( Method GetAngleOffset:Float(imageName:String) )
  • GetHeight   ( Method GetHeight:Int(imageName:String) )
  • GetImage   ( Method GetImage:Image(imageName:String) )
  • GetImageCount   ( Method GetImageCount:Int() )
  • GetImageHeight   ( Method GetImageHeight:Float(imageName:String) )   New in v1.55
  • GetImageWidth   ( Method GetImageWidth:Float(imageName:String) )   New in v1.55
  • GetRotated   ( Method GetRotated:Bool(imageName:String) )
  • GetWidth   ( Method GetWidth:Int(imageName:String) )
  • Load   ( Method Load:Void(imgName:String, dataName:String) )   Fixed in version 1.54 to support LINUX lines delimiters (13,10)
  • Remove   ( Method Remove:Void(discard:Bool = False) )

Method GetAngleOffset:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetAngleOffset (imageName:String)
Description:Returns the angle offset of an image.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetHeight:Int(imageName:String)

Syntax:


Int = ftSpriteAtlas.GetHeight (imageName:String)
Description:Returns the height of an image.
Return type:Int
Parameters:
NameTypeValue
imageNameString
Method GetImage:Image(imageName:String)

Syntax:


Image = ftSpriteAtlas.GetImage (imageName:String)
Description:Returns the image with the given name.
Return type:Image
Parameters:
NameTypeValue
imageNameString
Method GetImageCount:Int()

Syntax:


Int = ftSpriteAtlas.GetImageCount ()
Description:Returns the number of images in the sprite atlas.
Return type:Int
Method GetImageHeight:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetImageHeight (imageName:String)
Changes:New in v1.55
Description:Returns the height of the subimage with the given name.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetImageWidth:Float(imageName:String)

Syntax:


Float = ftSpriteAtlas.GetImageWidth (imageName:String)
Changes:New in v1.55
Description:Returns the width of the subimage with the given name.
Return type:Float
Parameters:
NameTypeValue
imageNameString
Method GetRotated:Bool(imageName:String)

Syntax:


Bool = ftSpriteAtlas.GetRotated (imageName:String)
Description:Returns TRUE if the image with the given name is rotated inside the sprite atlas.
Return type:Bool
Parameters:
NameTypeValue
imageNameString
Method GetWidth:Int(imageName:String)

Syntax:


Int = ftSpriteAtlas.GetWidth (imageName:String)
Description:Returns the width of an image.
Return type:Int
Parameters:
NameTypeValue
imageNameString
Method Load:Void(imgName:String, dataName:String)

Syntax:


ftSpriteAtlas.Load (imgName:String, dataName:String)
Changes:Fixed in version 1.54 to support LINUX lines delimiters (13,10)
Description:Loads a sprite atlas from the given image and data file name.
Parameters:
NameTypeValue
imgNameString
dataNameString
Method Remove:Void(discard:Bool = False)

Syntax:


ftSpriteAtlas.Remove (discard:Bool = False)
Description:Remove a sprite atlas. Set discard to TRUE if you want the corresponding images to be discarded.
Parameters:
NameTypeValue
discardBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftTileMap.monkey.html b/docs/cftTileMap.monkey.html index abe492d..a4db061 100644 --- a/docs/cftTileMap.monkey.html +++ b/docs/cftTileMap.monkey.html @@ -8,7 +8,7 @@ fantomEngine.cftTileMap -

Module fantomEngine.cftTileMap


The cftTileMap file provides the ftMapObj class that holds datas from map objects. Also it provides the ftTileMap class which stores the tilemap itself.

Table of contents:

Classes:

Class ftMapObj
Description:The ftMapObj class stores and deals with map objects provided by a Tiled compatible map. +

Module fantomEngine.cftTileMap


The cftTileMap file provides the ftMapObj class that holds datas from map objects. Also it provides the ftTileMap class which stores the tilemap itself.

Table of contents:

Classes:

Class ftMapObj
Description:The ftMapObj class stores and deals with map objects provided by a Tiled compatible map. The content of each object is only defined by the content of the map. So for an example, the object type -can be set by the map creator and you have to make sure that your app acts accordingly.
Table of contents:Methods:

Fields:

Method GetAlpha:Float()

Syntax:


Float = ftMapObj.GetAlpha ()
Description:Get the alpha value of a map object.
Return type:Float
Method GetHeight:Float()

Syntax:


Float = ftMapObj.GetHeight ()
Description:Get the height of a map object.
Return type:Float
Method GetLayerName:String ()

Syntax:


String = ftMapObj.GetLayerName ()
Description:Returns the name of the map layer, NOT the ftLayer.
Return type:String
Method GetName:String ()

Syntax:


String = ftMapObj.GetName ()
Description:Returns the name of map object.
Return type:String
Method GetPolyLine:Float[]()

Syntax:


Float[] = ftMapObj.GetPolyLine ()
Description:Returns the polyline of a map object.
Return type:Float[]
Method GetPolygon:Float[]()

Syntax:


Float[] = ftMapObj.GetPolygon ()
Description:Returns the polygon of a map object.
Return type:Float[]
Method GetPos:Float[]()

Syntax:


Float[] = ftMapObj.GetPos ()
Description:Returns the objects X and Y position in a 2D Float array. This is NOT the position of the ftObject.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftMapObj.GetPosX ()
Description:Get the X position of a map object. This is NOT the position of the ftObject.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftMapObj.GetPosY ()
Description:Get the Y position. This is NOT the position of the ftObject.
Return type:Float
Method GetProperty:String(key:String)

Syntax:


String = ftMapObj.GetProperty (key:String)
Description:Get the value of a specific property of a map object.
Return type:String
Parameters:
NameTypeValue
keyString
Method GetPropertyCount:Int()

Syntax:


Int = ftMapObj.GetPropertyCount ()
Description:Get number of properties of a map object.
Return type:Int
Method GetType:String ()

Syntax:


String = ftMapObj.GetType ()
Description:Returns the type of map object.
Return type:String
Method GetVisible:Bool()

Syntax:


Bool = ftMapObj.GetVisible ()
Description:Get the visible flag of a map object.
Return type:Bool
Method GetWidth:Float()

Syntax:


Float = ftMapObj.GetWidth ()
Description:Get the width of a map object.
Return type:Float
Field properties:StringMap = Null
Type:StringMap
Value:Null
Class ftTileSet
Description:The ftTileSet class stores tileSet information.
Table of contents:Methods:
  • GetTileAt   ( Method GetTileAt:Int(xp:Int,yp:Int) )
  • GetTileCount   ( Method GetTileCount:Int() )
  • GetTileCountX   ( Method GetTileCountX:Int() )
  • GetTileCountY   ( Method GetTileCountY:Int() )
  • GetTileHeight   ( Method GetTileHeight:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(column:Int, row:Int) )
  • GetTileIDAt   ( Method GetTileIDAt:Int(xp:Int,yp:Int) )
  • GetTilePosX   ( Method GetTilePosX:Float(index:Int) )
  • GetTilePosY   ( Method GetTilePosY:Float(index:Int) )
  • GetTileSetIndex   ( Method GetTileSetIndex:Int(tileID:Int) )   New in v1.56
  • GetTileWidth   ( Method GetTileWidth:Int(index:Int) )
  • Remove   ( Method Remove:Void() )   Fixed in v1.57
  • SetTileID   ( Method SetTileID:Void(column:Int, row:Int, id:Int) )
  • SetTileSModXY   ( Method SetTileSModXY:Void(xMod:Float, yMod:Float) )

Method GetTileAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftTileSet.GetTileAt (xp:Int,yp:Int)
Description:Returns the tile index at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Method GetTileCount:Int()

Syntax:


Int = ftTileSet.GetTileCount ()
Description:Returns the total number of tiles of a tilemap.
Return type:Int
Method GetTileCountX:Int()

Syntax:


Int = ftTileSet.GetTileCountX ()
Description:Returns the number of tiles in the X direction.
Return type:Int
Method GetTileCountY:Int()

Syntax:


Int = ftTileSet.GetTileCountY ()
Description:Returns the number of tiles in the Y direction.
Return type:Int
Method GetTileHeight:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileHeight (index:Int)
Description:Returns the height of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTileID:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileID (index:Int)
Description:Returns the ID of the tiles texture map, at the given index, starting from zero.
Return type:Int
Parameters:
NameTypeValue
indexInt
Details:It returns -1 if there is no tile.
Method GetTileID:Int(column:Int, row:Int)

Syntax:


Int = ftTileSet.GetTileID (column:Int, row:Int)
Description:Returns the ID of the tiles texture map, at the given map row and column, starting from zero.
Return type:Int
Parameters:
NameTypeValue
columnInt
rowInt
Details:It returns -1 if there is no tile.
Method GetTileIDAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftTileSet.GetTileIDAt (xp:Int,yp:Int)
Description:Returns the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Details:It returns -1 if there is no tile.
Method GetTilePosX:Float(index:Int)

Syntax:


Float = ftTileSet.GetTilePosX (index:Int)
Description:Returns the X position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTilePosY:Float(index:Int)

Syntax:


Float = ftTileSet.GetTilePosY (index:Int)
Description:Returns the Y position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTileSetIndex:Int(tileID:Int)

Syntax:


Int = ftTileSet.GetTileSetIndex (tileID:Int)
Changes:New in v1.56
Description:Returns the tileSetIndex of a given tile ID
Return type:Int
Parameters:
NameTypeValue
tileIDInt
Method GetTileWidth:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileWidth (index:Int)
Description:Returns the width of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method Remove:Void()

Syntax:


ftTileSet.Remove ()
Changes:Fixed in v1.57
Description:Removes the tilemap from the corresponding ftObject.
Method SetTileID:Void(column:Int, row:Int, id:Int)

Syntax:


ftTileSet.SetTileID (column:Int, row:Int, id:Int)
Description:Sets the ID of the tiles texture map, at the given map row and column, starting from zero.
Parameters:
NameTypeValue
columnInt
rowInt
idInt
Method SetTileSModXY:Void(xMod:Float, yMod:Float)

Syntax:


ftTileSet.SetTileSModXY (xMod:Float, yMod:Float)
Description:Sets the tile scale modification factors which are used during rendering.
Parameters:
NameTypeValue
xModFloat
yModFloat
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+can be set by the map creator and you have to make sure that your app acts accordingly.
Table of contents:Methods:

Fields:

Method GetAlpha:Float()

Syntax:


Float = ftMapObj.GetAlpha ()
Description:Get the alpha value of a map object.
Return type:Float
Method GetHeight:Float()

Syntax:


Float = ftMapObj.GetHeight ()
Description:Get the height of a map object.
Return type:Float
Method GetLayerName:String ()

Syntax:


String = ftMapObj.GetLayerName ()
Description:Returns the name of the map layer, NOT the ftLayer.
Return type:String
Method GetName:String ()

Syntax:


String = ftMapObj.GetName ()
Description:Returns the name of map object.
Return type:String
Method GetPolyLine:Float[]()

Syntax:


Float[] = ftMapObj.GetPolyLine ()
Description:Returns the polyline of a map object.
Return type:Float[]
Method GetPolygon:Float[]()

Syntax:


Float[] = ftMapObj.GetPolygon ()
Description:Returns the polygon of a map object.
Return type:Float[]
Method GetPos:Float[]()

Syntax:


Float[] = ftMapObj.GetPos ()
Description:Returns the objects X and Y position in a 2D Float array. This is NOT the position of the ftObject.
Return type:Float[]
Method GetPosX:Float()

Syntax:


Float = ftMapObj.GetPosX ()
Description:Get the X position of a map object. This is NOT the position of the ftObject.
Return type:Float
Method GetPosY:Float()

Syntax:


Float = ftMapObj.GetPosY ()
Description:Get the Y position. This is NOT the position of the ftObject.
Return type:Float
Method GetProperty:String(key:String)

Syntax:


String = ftMapObj.GetProperty (key:String)
Description:Get the value of a specific property of a map object.
Return type:String
Parameters:
NameTypeValue
keyString
Method GetPropertyCount:Int()

Syntax:


Int = ftMapObj.GetPropertyCount ()
Description:Get number of properties of a map object.
Return type:Int
Method GetType:String ()

Syntax:


String = ftMapObj.GetType ()
Description:Returns the type of map object.
Return type:String
Method GetVisible:Bool()

Syntax:


Bool = ftMapObj.GetVisible ()
Description:Get the visible flag of a map object.
Return type:Bool
Method GetWidth:Float()

Syntax:


Float = ftMapObj.GetWidth ()
Description:Get the width of a map object.
Return type:Float
Field properties:StringMap = Null
Type:StringMap
Value:Null
Class ftTileSet
Description:The ftTileSet class stores tileSet information.
Table of contents:Methods:
  • GetTileAt   ( Method GetTileAt:Int(xp:Int,yp:Int) )
  • GetTileCount   ( Method GetTileCount:Int() )
  • GetTileCountX   ( Method GetTileCountX:Int() )
  • GetTileCountY   ( Method GetTileCountY:Int() )
  • GetTileHeight   ( Method GetTileHeight:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(index:Int) )
  • GetTileID   ( Method GetTileID:Int(column:Int, row:Int) )
  • GetTileIDAt   ( Method GetTileIDAt:Int(xp:Int,yp:Int) )
  • GetTilePosX   ( Method GetTilePosX:Float(index:Int) )
  • GetTilePosY   ( Method GetTilePosY:Float(index:Int) )
  • GetTileSetIndex   ( Method GetTileSetIndex:Int(tileID:Int) )   New in v1.56
  • GetTileWidth   ( Method GetTileWidth:Int(index:Int) )
  • Remove   ( Method Remove:Void() )   Fixed in v1.57
  • SetTileID   ( Method SetTileID:Void(column:Int, row:Int, id:Int) )
  • SetTileSModXY   ( Method SetTileSModXY:Void(xMod:Float, yMod:Float) )

Method GetTileAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftTileSet.GetTileAt (xp:Int,yp:Int)
Description:Returns the tile index at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Method GetTileCount:Int()

Syntax:


Int = ftTileSet.GetTileCount ()
Description:Returns the total number of tiles of a tilemap.
Return type:Int
Method GetTileCountX:Int()

Syntax:


Int = ftTileSet.GetTileCountX ()
Description:Returns the number of tiles in the X direction.
Return type:Int
Method GetTileCountY:Int()

Syntax:


Int = ftTileSet.GetTileCountY ()
Description:Returns the number of tiles in the Y direction.
Return type:Int
Method GetTileHeight:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileHeight (index:Int)
Description:Returns the height of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method GetTileID:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileID (index:Int)
Description:Returns the ID of the tiles texture map, at the given index, starting from zero.
Return type:Int
Parameters:
NameTypeValue
indexInt
Details:It returns -1 if there is no tile.
Method GetTileID:Int(column:Int, row:Int)

Syntax:


Int = ftTileSet.GetTileID (column:Int, row:Int)
Description:Returns the ID of the tiles texture map, at the given map row and column, starting from zero.
Return type:Int
Parameters:
NameTypeValue
columnInt
rowInt
Details:It returns -1 if there is no tile.
Method GetTileIDAt:Int(xp:Int,yp:Int)

Syntax:


Int = ftTileSet.GetTileIDAt (xp:Int,yp:Int)
Description:Returns the ID of the tiles texture, at the given canvas coordinates, starting from zero.
Return type:Int
Parameters:
NameTypeValue
xpInt
ypInt
Details:It returns -1 if there is no tile.
Method GetTilePosX:Float(index:Int)

Syntax:


Float = ftTileSet.GetTilePosX (index:Int)
Description:Returns the X position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTilePosY:Float(index:Int)

Syntax:


Float = ftTileSet.GetTilePosY (index:Int)
Description:Returns the Y position of a tile with the given index. Index starts with 0.
Return type:Float
Parameters:
NameTypeValue
indexInt
Method GetTileSetIndex:Int(tileID:Int)

Syntax:


Int = ftTileSet.GetTileSetIndex (tileID:Int)
Changes:New in v1.56
Description:Returns the tileSetIndex of a given tile ID
Return type:Int
Parameters:
NameTypeValue
tileIDInt
Method GetTileWidth:Int(index:Int)

Syntax:


Int = ftTileSet.GetTileWidth (index:Int)
Description:Returns the width of a tile with the given index. Index starts at 0.
Return type:Int
Parameters:
NameTypeValue
indexInt
Method Remove:Void()

Syntax:


ftTileSet.Remove ()
Changes:Fixed in v1.57
Description:Removes the tilemap from the corresponding ftObject.
Method SetTileID:Void(column:Int, row:Int, id:Int)

Syntax:


ftTileSet.SetTileID (column:Int, row:Int, id:Int)
Description:Sets the ID of the tiles texture map, at the given map row and column, starting from zero.
Parameters:
NameTypeValue
columnInt
rowInt
idInt
Method SetTileSModXY:Void(xMod:Float, yMod:Float)

Syntax:


ftTileSet.SetTileSModXY (xMod:Float, yMod:Float)
Description:Sets the tile scale modification factors which are used during rendering.
Parameters:
NameTypeValue
xModFloat
yModFloat
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftTimer.monkey.html b/docs/cftTimer.monkey.html index d38394b..a2e6f36 100644 --- a/docs/cftTimer.monkey.html +++ b/docs/cftTimer.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftTimer -

Module fantomEngine.cftTimer


The class ftTimer handles ftEngine and ftObject timer objects.

Table of contents:

Classes:

Class ftTimer
Table of contents:Methods:
  • GetPaused   ( Method GetPaused:Bool() )
  • RemoveTimer   ( Method RemoveTimer:Void() )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool = True) )

Method GetPaused:Bool()

Syntax:


Bool = ftTimer.GetPaused ()
Description:Returns TRUE if a transition is paused.
Return type:Bool
Method RemoveTimer:Void()

Syntax:


ftTimer.RemoveTimer ()
Description:With this method removes the timer.
Method SetPaused:Void(pauseFlag:Bool = True)

Syntax:


ftTimer.SetPaused (pauseFlag:Bool = True)
Description:With this method you can pause and resume the timer.
Parameters:
NameTypeValue
pauseFlagBoolTrue
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftTimer


The class ftTimer handles ftEngine and ftObject timer objects.

Table of contents:

Classes:

Class ftTimer
Table of contents:Methods:
  • GetPaused   ( Method GetPaused:Bool() )
  • RemoveTimer   ( Method RemoveTimer:Void() )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool = True) )

Method GetPaused:Bool()

Syntax:


Bool = ftTimer.GetPaused ()
Description:Returns TRUE if a transition is paused.
Return type:Bool
Method RemoveTimer:Void()

Syntax:


ftTimer.RemoveTimer ()
Description:With this method removes the timer.
Method SetPaused:Void(pauseFlag:Bool = True)

Syntax:


ftTimer.SetPaused (pauseFlag:Bool = True)
Description:With this method you can pause and resume the timer.
Parameters:
NameTypeValue
pauseFlagBoolTrue
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftTrans.monkey.html b/docs/cftTrans.monkey.html index 2d8ba71..14c7a95 100644 --- a/docs/cftTrans.monkey.html +++ b/docs/cftTrans.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftTrans -

Module fantomEngine.cftTrans


The class ftTrans controls the way an object or layer does a transition. Starting with version 1.49, it utilizes the tween class from the
'monkey sample script in bananas/skn3/tweening/tween.monkey

Table of contents:

Classes:

Class ftTrans
Table of contents:Methods:
  • GetPaused   ( Method GetPaused:Bool() )
  • SetEase   ( Method SetEase(easeType:String="EaseIn") )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool = True) )
  • SetType   ( Method SetType(equationType:String="Linear") )

Method GetPaused:Bool()

Syntax:


Bool = ftTrans.GetPaused ()
Description:Returns TRUE if a transition is paused.
Return type:Bool
Method SetEase(easeType:String="EaseIn")

Syntax:


none = ftTrans.SetEase (easeType:String="EaseIn")
Description:Sets the ease type of a transition.
Return type:none
Parameters:
NameTypeValue
easeTypeString"EaseIn"
Details:This command sets the ease type of a transition. The ease type can be:
  • EaseIn
  • EaseOut
  • EaseInOut

Method SetPaused:Void(pauseFlag:Bool = True)

Syntax:


ftTrans.SetPaused (pauseFlag:Bool = True)
Description:With this method you can pause and resume the transition.
Parameters:
NameTypeValue
pauseFlagBoolTrue
Method SetType(equationType:String="Linear")

Syntax:


none = ftTrans.SetType (equationType:String="Linear")
Description:Sets the equation type of a transition.
Return type:none
Parameters:
NameTypeValue
equationTypeString"Linear"
Details:This command sets the equation type of a transition. The equation type can be:
  • Linear
  • Back
  • Bounce
  • Circ
  • Cubic
  • Elastic
  • Expo
  • Quad
  • Quart
  • Quint
  • Sine

This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftTrans


The class ftTrans controls the way an object or layer does a transition. Starting with version 1.49, it utilizes the tween class from the
'monkey sample script in bananas/skn3/tweening/tween.monkey

Table of contents:

Classes:

Class ftTrans
Table of contents:Methods:
  • GetPaused   ( Method GetPaused:Bool() )
  • SetEase   ( Method SetEase(easeType:String="EaseIn") )
  • SetPaused   ( Method SetPaused:Void(pauseFlag:Bool = True) )
  • SetType   ( Method SetType(equationType:String="Linear") )

Method GetPaused:Bool()

Syntax:


Bool = ftTrans.GetPaused ()
Description:Returns TRUE if a transition is paused.
Return type:Bool
Method SetEase(easeType:String="EaseIn")

Syntax:


none = ftTrans.SetEase (easeType:String="EaseIn")
Description:Sets the ease type of a transition.
Return type:none
Parameters:
NameTypeValue
easeTypeString"EaseIn"
Details:This command sets the ease type of a transition. The ease type can be:
  • EaseIn
  • EaseOut
  • EaseInOut

Method SetPaused:Void(pauseFlag:Bool = True)

Syntax:


ftTrans.SetPaused (pauseFlag:Bool = True)
Description:With this method you can pause and resume the transition.
Parameters:
NameTypeValue
pauseFlagBoolTrue
Method SetType(equationType:String="Linear")

Syntax:


none = ftTrans.SetType (equationType:String="Linear")
Description:Sets the equation type of a transition.
Return type:none
Parameters:
NameTypeValue
equationTypeString"Linear"
Details:This command sets the equation type of a transition. The equation type can be:
  • Linear
  • Back
  • Bounce
  • Circ
  • Cubic
  • Elastic
  • Expo
  • Quad
  • Quart
  • Quint
  • Sine

This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftVec2D.monkey.html b/docs/cftVec2D.monkey.html index 2ad4ef9..c81e0bb 100644 --- a/docs/cftVec2D.monkey.html +++ b/docs/cftVec2D.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftVec2D -

Module fantomEngine.cftVec2D


The cftVec2D module provides a 2D vector class.

Table of contents:

Classes:

Class ftVec2D
Table of contents:Methods:
  • Add   ( Method Add:Void (vector:ftVec2D) )
  • Add   ( Method Add:Void (addX:Float, addY:Float) )
  • Angle   ( Method Angle:Float (vector:ftVec2D) )
  • Angle   ( Method Angle:Float (xPos:Float, yPos:Float) )
  • Angle   ( Method Angle:Float () )
  • Copy   ( Method Copy:ftVec2D() )
  • Dot   ( Method Dot:Float(xPos:Float, yPos:Float) )
  • Dot   ( Method Dot:Float (vector:ftVec2D) )
  • Equals   ( Method Equals:Bool (vector:ftVec2D) )
  • Inverse   ( Method Inverse:Void() )
  • InverseX   ( Method InverseX:Void() )
  • InverseY   ( Method InverseY:Void() )
  • Length   ( Method Length:Float(vector:ftVec2D) )
  • Length   ( Method Length:Float(xPos:Float, yPos:Float) )
  • Length   ( Method Length:Float() )
  • Mul   ( Method Mul:Void (scalar:Float) )
  • New   ( Method New(xp:Float, yp:Float) )
  • Normalize   ( Method Normalize:Void() )
  • Perp   ( Method Perp:Void() )   New in v1.54
  • Set   ( Method Set:Void (setX:Float, setY:Float) )
  • Set   ( Method Set:Void (vector:ftVec2D) )
  • Sub   ( Method Sub:Void (vector:ftVec2D) )
  • Sub   ( Method Sub:Void (subX:Float, subY:Float) )

Fields:
  • x ( Field x:Float = 0.0 )
  • y ( Field y:Float = 0.0 )

Method Add:Void (vector:ftVec2D)

Syntax:


ftVec2D.Add (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Add:Void (addX:Float, addY:Float)

Syntax:


ftVec2D.Add (addX:Float, addY:Float)
Parameters:
NameTypeValue
addXFloat
addYFloat
Method Angle:Float (vector:ftVec2D)

Syntax:


Float = ftVec2D.Angle (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Angle:Float (xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Angle (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Angle:Float ()

Syntax:


Float = ftVec2D.Angle ()
Return type:Float
Method Copy:ftVec2D()

Syntax:


ftVec2D = ftVec2D.Copy ()
Return type:ftVec2D
Method Dot:Float(xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Dot (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Dot:Float (vector:ftVec2D)

Syntax:


Float = ftVec2D.Dot (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Equals:Bool (vector:ftVec2D)

Syntax:


Bool = ftVec2D.Equals (vector:ftVec2D)
Return type:Bool
Parameters:
NameTypeValue
vectorftVec2D
Method Inverse:Void()

Syntax:


ftVec2D.Inverse ()
Method InverseX:Void()

Syntax:


ftVec2D.InverseX ()
Method InverseY:Void()

Syntax:


ftVec2D.InverseY ()
Method Length:Float(vector:ftVec2D)

Syntax:


Float = ftVec2D.Length (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Length:Float(xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Length (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Length:Float()

Syntax:


Float = ftVec2D.Length ()
Return type:Float
Method Mul:Void (scalar:Float)

Syntax:


ftVec2D.Mul (scalar:Float)
Parameters:
NameTypeValue
scalarFloat
Method New(xp:Float, yp:Float)

Syntax:


none = ftVec2D.New (xp:Float, yp:Float)
Return type:none
Parameters:
NameTypeValue
xpFloat
ypFloat
Method Normalize:Void()

Syntax:


ftVec2D.Normalize ()
Method Perp:Void()

Syntax:


ftVec2D.Perp ()
Changes:New in v1.54
Method Set:Void (setX:Float, setY:Float)

Syntax:


ftVec2D.Set (setX:Float, setY:Float)
Parameters:
NameTypeValue
setXFloat
setYFloat
Method Set:Void (vector:ftVec2D)

Syntax:


ftVec2D.Set (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Sub:Void (vector:ftVec2D)

Syntax:


ftVec2D.Sub (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Sub:Void (subX:Float, subY:Float)

Syntax:


ftVec2D.Sub (subX:Float, subY:Float)
Parameters:
NameTypeValue
subXFloat
subYFloat
Field x:Float = 0.0
Type:Float
Value:0.0
Field y:Float = 0.0
Type:Float
Value:0.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftVec2D


The cftVec2D module provides a 2D vector class.

Table of contents:

Classes:

Class ftVec2D
Table of contents:Methods:
  • Add   ( Method Add:Void (vector:ftVec2D) )
  • Add   ( Method Add:Void (addX:Float, addY:Float) )
  • Angle   ( Method Angle:Float (vector:ftVec2D) )
  • Angle   ( Method Angle:Float (xPos:Float, yPos:Float) )
  • Angle   ( Method Angle:Float () )
  • Copy   ( Method Copy:ftVec2D() )
  • Dot   ( Method Dot:Float(xPos:Float, yPos:Float) )
  • Dot   ( Method Dot:Float (vector:ftVec2D) )
  • Equals   ( Method Equals:Bool (vector:ftVec2D) )
  • Inverse   ( Method Inverse:Void() )
  • InverseX   ( Method InverseX:Void() )
  • InverseY   ( Method InverseY:Void() )
  • Length   ( Method Length:Float(vector:ftVec2D) )
  • Length   ( Method Length:Float(xPos:Float, yPos:Float) )
  • Length   ( Method Length:Float() )
  • Mul   ( Method Mul:Void (scalar:Float) )
  • New   ( Method New(xp:Float, yp:Float) )
  • Normalize   ( Method Normalize:Void() )
  • Perp   ( Method Perp:Void() )   New in v1.54
  • Set   ( Method Set:Void (setX:Float, setY:Float) )
  • Set   ( Method Set:Void (vector:ftVec2D) )
  • Sub   ( Method Sub:Void (vector:ftVec2D) )
  • Sub   ( Method Sub:Void (subX:Float, subY:Float) )

Fields:
  • x ( Field x:Float = 0.0 )
  • y ( Field y:Float = 0.0 )

Method Add:Void (vector:ftVec2D)

Syntax:


ftVec2D.Add (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Add:Void (addX:Float, addY:Float)

Syntax:


ftVec2D.Add (addX:Float, addY:Float)
Parameters:
NameTypeValue
addXFloat
addYFloat
Method Angle:Float (vector:ftVec2D)

Syntax:


Float = ftVec2D.Angle (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Angle:Float (xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Angle (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Angle:Float ()

Syntax:


Float = ftVec2D.Angle ()
Return type:Float
Method Copy:ftVec2D()

Syntax:


ftVec2D = ftVec2D.Copy ()
Return type:ftVec2D
Method Dot:Float(xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Dot (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Dot:Float (vector:ftVec2D)

Syntax:


Float = ftVec2D.Dot (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Equals:Bool (vector:ftVec2D)

Syntax:


Bool = ftVec2D.Equals (vector:ftVec2D)
Return type:Bool
Parameters:
NameTypeValue
vectorftVec2D
Method Inverse:Void()

Syntax:


ftVec2D.Inverse ()
Method InverseX:Void()

Syntax:


ftVec2D.InverseX ()
Method InverseY:Void()

Syntax:


ftVec2D.InverseY ()
Method Length:Float(vector:ftVec2D)

Syntax:


Float = ftVec2D.Length (vector:ftVec2D)
Return type:Float
Parameters:
NameTypeValue
vectorftVec2D
Method Length:Float(xPos:Float, yPos:Float)

Syntax:


Float = ftVec2D.Length (xPos:Float, yPos:Float)
Return type:Float
Parameters:
NameTypeValue
xPosFloat
yPosFloat
Method Length:Float()

Syntax:


Float = ftVec2D.Length ()
Return type:Float
Method Mul:Void (scalar:Float)

Syntax:


ftVec2D.Mul (scalar:Float)
Parameters:
NameTypeValue
scalarFloat
Method New(xp:Float, yp:Float)

Syntax:


none = ftVec2D.New (xp:Float, yp:Float)
Return type:none
Parameters:
NameTypeValue
xpFloat
ypFloat
Method Normalize:Void()

Syntax:


ftVec2D.Normalize ()
Method Perp:Void()

Syntax:


ftVec2D.Perp ()
Changes:New in v1.54
Method Set:Void (setX:Float, setY:Float)

Syntax:


ftVec2D.Set (setX:Float, setY:Float)
Parameters:
NameTypeValue
setXFloat
setYFloat
Method Set:Void (vector:ftVec2D)

Syntax:


ftVec2D.Set (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Sub:Void (vector:ftVec2D)

Syntax:


ftVec2D.Sub (vector:ftVec2D)
Parameters:
NameTypeValue
vectorftVec2D
Method Sub:Void (subX:Float, subY:Float)

Syntax:


ftVec2D.Sub (subX:Float, subY:Float)
Parameters:
NameTypeValue
subXFloat
subYFloat
Field x:Float = 0.0
Type:Float
Value:0.0
Field y:Float = 0.0
Type:Float
Value:0.0
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/cftWaypoints.monkey.html b/docs/cftWaypoints.monkey.html index e0b5089..91bcebb 100644 --- a/docs/cftWaypoints.monkey.html +++ b/docs/cftWaypoints.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftWaypoints -

Module fantomEngine.cftWaypoints


The waypoint module lets you create paths of waypoints by hand. Then you can create a marker that you can let run along the path. Also you can connect an object to that marker. Another functionality is A* path finding.

Table of contents:

Classes:

Class ftMarker
Description:The ftMarker class defines a marker that runs along a path.
Table of contents:Methods:
  • ConnectObj   ( Method ConnectObj:Void(obj:ftObject, flag:Bool = True) )
  • GetCurrAngle   ( Method GetCurrAngle:Float() )
  • GetCurrDestPos   ( Method GetCurrDestPos:Float[]() )
  • GetCurrDestWP   ( Method GetCurrDestWP:ftWaypoint() )
  • GetCurrDist   ( Method GetCurrDist:Float() )
  • GetCurrPos   ( Method GetCurrPos:Float[]() )
  • GetCurrSrcWP   ( Method GetCurrSrcWP:ftWaypoint() )
  • GetFinal   ( Method GetFinal:Bool() )
  • MoveToWP   ( Method MoveToWP:Void(index:Int=1) )
  • MoveToWP   ( Method MoveToWP:Void(waypoint:ftWaypoint) )
  • Remove   ( Method Remove:Void() )
  • Render   ( Method Render:Void(renderType:Int=0) )
  • SetDirection   ( Method SetDirection:Void(dir:Int = ftPath.mdForward) )
  • SetInterpolationMode   ( Method SetInterpolationMode:Void(mode:Int = ftPath.imLinear) )
  • SetMoveMode   ( Method SetMoveMode:Void(mode:Int = ftPath.mmStop) )
  • SetSensivity   ( Method SetSensivity:Void(sensivityFactor:Float = 0.1) )
  • SetSpeed   ( Method SetSpeed:Void(speedFactor:Float = 1.0) )
  • Update   ( Method Update:Float(speedFactor:Float = 1.0) )

Method ConnectObj:Void(obj:ftObject, flag:Bool = True)

Syntax:


ftMarker.ConnectObj (obj:ftObject, flag:Bool = True)
Description:Connects an object to an existing marker .
Parameters:
NameTypeValue
objftObject
flagBoolTrue
Method GetCurrAngle:Float()

Syntax:


Float = ftMarker.GetCurrAngle ()
Description:Returns the current angle of a marker in degree.
Return type:Float
Method GetCurrDestPos:Float[]()

Syntax:


Float[] = ftMarker.GetCurrDestPos ()
Description:Returns the current destination waypoint X/Y/Z position.
Return type:Float[]
Method GetCurrDestWP:ftWaypoint()

Syntax:


ftWaypoint = ftMarker.GetCurrDestWP ()
Description:Returns the current destination waypoint.
Return type:ftWaypoint
Method GetCurrDist:Float()

Syntax:


Float = ftMarker.GetCurrDist ()
Description:Returns the current distance of the marker.
Return type:Float
Method GetCurrPos:Float[]()

Syntax:


Float[] = ftMarker.GetCurrPos ()
Description:Returns the current X/Y/Z position of the marker.
Return type:Float[]
Method GetCurrSrcWP:ftWaypoint()

Syntax:


ftWaypoint = ftMarker.GetCurrSrcWP ()
Description:Returns the source destination waypoint.
Return type:ftWaypoint
Method GetFinal:Bool()

Syntax:


Bool = ftMarker.GetFinal ()
Description:Returns if the marker reached the end of a path.
Return type:Bool
Method MoveToWP:Void(index:Int=1)

Syntax:


ftMarker.MoveToWP (index:Int=1)
Description:Moves a marker to a waypoint with a given index. Index starts with 1.
Parameters:
NameTypeValue
indexInt1
Method MoveToWP:Void(waypoint:ftWaypoint)

Syntax:


ftMarker.MoveToWP (waypoint:ftWaypoint)
Description:Moves a marker to a specific waypoint.
Parameters:
NameTypeValue
waypointftWaypoint
Method Remove:Void()

Syntax:


ftMarker.Remove ()
Description:Removes a marker.
Method Render:Void(renderType:Int=0)

Syntax:


ftMarker.Render (renderType:Int=0)
Description:Renders a marker at its current position.
Parameters:
NameTypeValue
renderTypeInt0
Details:A renderType of 0 renders a box, every other value a circle.
Method SetDirection:Void(dir:Int = ftPath.mdForward)

Syntax:


ftMarker.SetDirection (dir:Int = ftPath.mdForward)
Description:Sets the direction of a marker.
Parameters:
NameTypeValue
dirIntftPath.mdForward
Method SetInterpolationMode:Void(mode:Int = ftPath.imLinear)

Syntax:


ftMarker.SetInterpolationMode (mode:Int = ftPath.imLinear)
Description:Sets the interpolation mode of a marker.
Parameters:
NameTypeValue
modeIntftPath.imLinear
Method SetMoveMode:Void(mode:Int = ftPath.mmStop)

Syntax:


ftMarker.SetMoveMode (mode:Int = ftPath.mmStop)
Description:Sets the move mode of a marker.
Parameters:
NameTypeValue
modeIntftPath.mmStop
Method SetSensivity:Void(sensivityFactor:Float = 0.1)

Syntax:


ftMarker.SetSensivity (sensivityFactor:Float = 0.1)
Description:Sets the sensivity of a marker.
Parameters:
NameTypeValue
sensivityFactorFloat0.1
Details:The sensivity controls when a marker reaches its next waypoint. It is the minimum distance in pixel.
Method SetSpeed:Void(speedFactor:Float = 1.0)

Syntax:


ftMarker.SetSpeed (speedFactor:Float = 1.0)
Description:Sets the speed of a marker.
Parameters:
NameTypeValue
speedFactorFloat1.0
Method Update:Float(speedFactor:Float = 1.0)

Syntax:


Float = ftMarker.Update (speedFactor:Float = 1.0)
Description:Updates a marker and a connected object.
Return type:Float
Parameters:
NameTypeValue
speedFactorFloat1.0
Class ftPath
Description:The ftPath class defines a path created by hand.
Table of contents:Methods:
  • AddWP   ( Method AddWP:ftWaypoint(xpos:Float, ypos:Float, relative:Bool = False) )
  • CleanupLists   ( Method CleanupLists:Void() )
  • CreateMarker   ( Method CreateMarker:ftMarker(speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop) )
  • FindClosestWP   ( Method FindClosestWP:ftWaypoint(xpos:Float, ypos:Float) )
  • GetAngle   ( Method GetAngle:Float() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetScale   ( Method GetScale:Float[]() )
  • GetWP   ( Method GetWP:ftWaypoint(index:Int) )
  • GetWPCount   ( Method GetWPCount:Int() )
  • LoadFromString   ( Method LoadFromString:Void(ps:String) )
  • Remove   ( Method Remove:Void() )
  • RemoveAllMarkers   ( Method RemoveAllMarkers:Void() )
  • RemoveAllWP   ( Method RemoveAllWP:Void() )
  • RemoveWP   ( Method RemoveWP:Void(index:Int) )
  • RenderAllMarker   ( Method RenderAllMarker:Void(type:Int=0) )   Fixed in version 1.55
  • RenderAllWP   ( Method RenderAllWP:Void(type:Int=0) )   Fixed in version 1.55
  • SaveToString   ( Method SaveToString:String() )
  • SetAngle   ( Method SetAngle:Void(a:Float, relative:Bool = False) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )
  • SetPosX   ( Method SetPosX:Void(x:Float, relative:Bool = False) )
  • SetPosY   ( Method SetPosY:Void(y:Float, relative:Bool = False) )
  • SetScale   ( Method SetScale:Void(x:Float, y:Float, relative:Bool = False) )
  • UpdateAllMarker   ( Method UpdateAllMarker:Void(speedFactor:Float = 1.0) )

Constants:

Method AddWP:ftWaypoint(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftWaypoint = ftPath.AddWP (xpos:Float, ypos:Float, relative:Bool = False)
Description:This method adds a new waypoint to an existing path and returns it.
Return type:ftWaypoint
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
Method CleanupLists:Void()

Syntax:


ftPath.CleanupLists ()
Method CreateMarker:ftMarker(speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop)

Syntax:


ftMarker = ftPath.CreateMarker (speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop)
Description:This method creates a new marker for an existing path.
Return type:ftMarker
Parameters:
NameTypeValue
speedFloat1.0
dirIntmdForward
modeIntmmStop
Method FindClosestWP:ftWaypoint(xpos:Float, ypos:Float)

Syntax:


ftWaypoint = ftPath.FindClosestWP (xpos:Float, ypos:Float)
Description:To find the closest waypoint of a path to a given position, use this method.
Return type:ftWaypoint
Parameters:
NameTypeValue
xposFloat
yposFloat
Method GetAngle:Float()

Syntax:


Float = ftPath.GetAngle ()
Description:Returns the angle of the path.
Return type:Float
Method GetPos:Float[]()

Syntax:


Float[] = ftPath.GetPos ()
Description:Returns the position of the path inside an array.
Return type:Float[]
Method GetScale:Float[]()

Syntax:


Float[] = ftPath.GetScale ()
Description:Returns the scale factors of the path inside an array.
Return type:Float[]
Method GetWP:ftWaypoint(index:Int)

Syntax:


ftWaypoint = ftPath.GetWP (index:Int)
Description:Get a the waypoint with the given index. Index starts with 1.
Return type:ftWaypoint
Parameters:
NameTypeValue
indexInt
Method GetWPCount:Int()

Syntax:


Int = ftPath.GetWPCount ()
Description:Returns the waypoint count of the path.
Return type:Int
Method LoadFromString:Void(ps:String)

Syntax:


ftPath.LoadFromString (ps:String)
Description:Load a path from a string.
Parameters:
NameTypeValue
psString
Method Remove:Void()

Syntax:


ftPath.Remove ()
Description:Remove a path and its content.
Method RemoveAllMarkers:Void()

Syntax:


ftPath.RemoveAllMarkers ()
Description:Removes all markers of the path.
Method RemoveAllWP:Void()

Syntax:


ftPath.RemoveAllWP ()
Description:Removes all waypoints of the path.
Method RemoveWP:Void(index:Int)

Syntax:


ftPath.RemoveWP (index:Int)
Description:Returns a waypoint with the given index. Index starts with 1.
Parameters:
NameTypeValue
indexInt
Method RenderAllMarker:Void(type:Int=0)

Syntax:


ftPath.RenderAllMarker (type:Int=0)
Changes:Fixed in version 1.55
Description:Render all markers of a path. You can use this for debugging.
Parameters:
NameTypeValue
typeInt0
Details:A type value of 0 renders a square, any other value renders a circle.
Method RenderAllWP:Void(type:Int=0)

Syntax:


ftPath.RenderAllWP (type:Int=0)
Changes:Fixed in version 1.55
Description:Render all waypoints of a path. You can use this for debugging.
Parameters:
NameTypeValue
typeInt0
Details:A type value of 0 renders a square, any other value renders a circle.
Method SaveToString:String()

Syntax:


String = ftPath.SaveToString ()
Description:Save a path to a string.
Return type:String
Method SetAngle:Void(a:Float, relative:Bool = False)

Syntax:


ftPath.SetAngle (a:Float, relative:Bool = False)
Description:Sets the angle of a path and position its waypoints regarding the angle.
Parameters:
NameTypeValue
aFloat
relativeBoolFalse
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftPath.SetPos (x:Float, y:Float, relative:Bool = False)
Description:Sets the position of a path and its waypoints.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetPosX:Void(x:Float, relative:Bool = False)

Syntax:


ftPath.SetPosX (x:Float, relative:Bool = False)
Description:Sets the X position of a path and its waypoints.
Parameters:
NameTypeValue
xFloat
relativeBoolFalse
Method SetPosY:Void(y:Float, relative:Bool = False)

Syntax:


ftPath.SetPosY (y:Float, relative:Bool = False)
Description:Sets the Y position of a path and its waypoints.
Parameters:
NameTypeValue
yFloat
relativeBoolFalse
Method SetScale:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftPath.SetScale (x:Float, y:Float, relative:Bool = False)
Description:Sets the scale of a path and position its waypoints regarding the angle.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method UpdateAllMarker:Void(speedFactor:Float = 1.0)

Syntax:


ftPath.UpdateAllMarker (speedFactor:Float = 1.0)
Description:Updates all markers of a path.
Parameters:
NameTypeValue
speedFactorFloat1.0
Const imCatmull:Int=1
Type:Int
Value:1
Const imLinear:Int=0
Type:Int
Value:0
Const mdBackwards:Int = 2
Type:Int
Value:2
Const mdForward:Int = 1
Type:Int
Value:1
Const mmBounce:Int = 1
Type:Int
Value:1
Const mmCircle:Int = 3
Type:Int
Value:3
Const mmStop:Int = 0
Type:Int
Value:0
Const mmWarp:Int = 2
Type:Int
Value:2
Class ftWaypoint
Description:The ftWaypoint class defines a single waypoint in a path.
Table of contents:Methods:
  • GetIndex   ( Method GetIndex:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • Remove   ( Method Remove:Void() )
  • Render   ( Method Render:Void(renderType:Int=0) )
  • SetPos   ( Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False) )

Method GetIndex:Int()

Syntax:


Int = ftWaypoint.GetIndex ()
Description:Returns the path index of a waypoint. Index start with 1
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftWaypoint.GetPos ()
Description:Returns the X/Y position of a waypoint.
Return type:Float[]
Method Remove:Void()

Syntax:


ftWaypoint.Remove ()
Description:Removes a waypoint from its path.
Method Render:Void(renderType:Int=0)

Syntax:


ftWaypoint.Render (renderType:Int=0)
Description:Renders a waypoint at its current position.
Parameters:
NameTypeValue
renderTypeInt0
Details:A renderType of 0 renders a box, every other value a circle.
Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftWaypoint.SetPos (xpos:Float, ypos:Float, relative:Bool = False)
Description:Sets the position of a waypoint inside a path.
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+

Module fantomEngine.cftWaypoints


The waypoint module lets you create paths of waypoints by hand. Then you can create a marker that you can let run along the path. Also you can connect an object to that marker. Another functionality is A* path finding.

Table of contents:

Classes:

Class ftMarker
Description:The ftMarker class defines a marker that runs along a path.
Table of contents:Methods:
  • ConnectObj   ( Method ConnectObj:Void(obj:ftObject, flag:Bool = True) )
  • GetCurrAngle   ( Method GetCurrAngle:Float() )
  • GetCurrDestPos   ( Method GetCurrDestPos:Float[]() )
  • GetCurrDestWP   ( Method GetCurrDestWP:ftWaypoint() )
  • GetCurrDist   ( Method GetCurrDist:Float() )
  • GetCurrPos   ( Method GetCurrPos:Float[]() )
  • GetCurrSrcWP   ( Method GetCurrSrcWP:ftWaypoint() )
  • GetFinal   ( Method GetFinal:Bool() )
  • MoveToWP   ( Method MoveToWP:Void(index:Int=1) )
  • MoveToWP   ( Method MoveToWP:Void(waypoint:ftWaypoint) )
  • Remove   ( Method Remove:Void() )
  • Render   ( Method Render:Void(renderType:Int=0) )
  • SetDirection   ( Method SetDirection:Void(dir:Int = ftPath.mdForward) )
  • SetInterpolationMode   ( Method SetInterpolationMode:Void(mode:Int = ftPath.imLinear) )
  • SetMoveMode   ( Method SetMoveMode:Void(mode:Int = ftPath.mmStop) )
  • SetSensivity   ( Method SetSensivity:Void(sensivityFactor:Float = 0.1) )
  • SetSpeed   ( Method SetSpeed:Void(speedFactor:Float = 1.0) )
  • Update   ( Method Update:Float(speedFactor:Float = 1.0) )

Method ConnectObj:Void(obj:ftObject, flag:Bool = True)

Syntax:


ftMarker.ConnectObj (obj:ftObject, flag:Bool = True)
Description:Connects an object to an existing marker .
Parameters:
NameTypeValue
objftObject
flagBoolTrue
Method GetCurrAngle:Float()

Syntax:


Float = ftMarker.GetCurrAngle ()
Description:Returns the current angle of a marker in degree.
Return type:Float
Method GetCurrDestPos:Float[]()

Syntax:


Float[] = ftMarker.GetCurrDestPos ()
Description:Returns the current destination waypoint X/Y/Z position.
Return type:Float[]
Method GetCurrDestWP:ftWaypoint()

Syntax:


ftWaypoint = ftMarker.GetCurrDestWP ()
Description:Returns the current destination waypoint.
Return type:ftWaypoint
Method GetCurrDist:Float()

Syntax:


Float = ftMarker.GetCurrDist ()
Description:Returns the current distance of the marker.
Return type:Float
Method GetCurrPos:Float[]()

Syntax:


Float[] = ftMarker.GetCurrPos ()
Description:Returns the current X/Y/Z position of the marker.
Return type:Float[]
Method GetCurrSrcWP:ftWaypoint()

Syntax:


ftWaypoint = ftMarker.GetCurrSrcWP ()
Description:Returns the source destination waypoint.
Return type:ftWaypoint
Method GetFinal:Bool()

Syntax:


Bool = ftMarker.GetFinal ()
Description:Returns if the marker reached the end of a path.
Return type:Bool
Method MoveToWP:Void(index:Int=1)

Syntax:


ftMarker.MoveToWP (index:Int=1)
Description:Moves a marker to a waypoint with a given index. Index starts with 1.
Parameters:
NameTypeValue
indexInt1
Method MoveToWP:Void(waypoint:ftWaypoint)

Syntax:


ftMarker.MoveToWP (waypoint:ftWaypoint)
Description:Moves a marker to a specific waypoint.
Parameters:
NameTypeValue
waypointftWaypoint
Method Remove:Void()

Syntax:


ftMarker.Remove ()
Description:Removes a marker.
Method Render:Void(renderType:Int=0)

Syntax:


ftMarker.Render (renderType:Int=0)
Description:Renders a marker at its current position.
Parameters:
NameTypeValue
renderTypeInt0
Details:A renderType of 0 renders a box, every other value a circle.
Method SetDirection:Void(dir:Int = ftPath.mdForward)

Syntax:


ftMarker.SetDirection (dir:Int = ftPath.mdForward)
Description:Sets the direction of a marker.
Parameters:
NameTypeValue
dirIntftPath.mdForward
Method SetInterpolationMode:Void(mode:Int = ftPath.imLinear)

Syntax:


ftMarker.SetInterpolationMode (mode:Int = ftPath.imLinear)
Description:Sets the interpolation mode of a marker.
Parameters:
NameTypeValue
modeIntftPath.imLinear
Method SetMoveMode:Void(mode:Int = ftPath.mmStop)

Syntax:


ftMarker.SetMoveMode (mode:Int = ftPath.mmStop)
Description:Sets the move mode of a marker.
Parameters:
NameTypeValue
modeIntftPath.mmStop
Method SetSensivity:Void(sensivityFactor:Float = 0.1)

Syntax:


ftMarker.SetSensivity (sensivityFactor:Float = 0.1)
Description:Sets the sensivity of a marker.
Parameters:
NameTypeValue
sensivityFactorFloat0.1
Details:The sensivity controls when a marker reaches its next waypoint. It is the minimum distance in pixel.
Method SetSpeed:Void(speedFactor:Float = 1.0)

Syntax:


ftMarker.SetSpeed (speedFactor:Float = 1.0)
Description:Sets the speed of a marker.
Parameters:
NameTypeValue
speedFactorFloat1.0
Method Update:Float(speedFactor:Float = 1.0)

Syntax:


Float = ftMarker.Update (speedFactor:Float = 1.0)
Description:Updates a marker and a connected object.
Return type:Float
Parameters:
NameTypeValue
speedFactorFloat1.0
Class ftPath
Description:The ftPath class defines a path created by hand.
Table of contents:Methods:
  • AddWP   ( Method AddWP:ftWaypoint(xpos:Float, ypos:Float, relative:Bool = False) )
  • CleanupLists   ( Method CleanupLists:Void() )
  • CreateMarker   ( Method CreateMarker:ftMarker(speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop) )
  • FindClosestWP   ( Method FindClosestWP:ftWaypoint(xpos:Float, ypos:Float) )
  • GetAngle   ( Method GetAngle:Float() )
  • GetPos   ( Method GetPos:Float[]() )
  • GetScale   ( Method GetScale:Float[]() )
  • GetWP   ( Method GetWP:ftWaypoint(index:Int) )
  • GetWPCount   ( Method GetWPCount:Int() )
  • LoadFromString   ( Method LoadFromString:Void(ps:String) )
  • Remove   ( Method Remove:Void() )
  • RemoveAllMarkers   ( Method RemoveAllMarkers:Void() )
  • RemoveAllWP   ( Method RemoveAllWP:Void() )
  • RemoveWP   ( Method RemoveWP:Void(index:Int) )
  • RenderAllMarker   ( Method RenderAllMarker:Void(type:Int=0) )   Fixed in version 1.55
  • RenderAllWP   ( Method RenderAllWP:Void(type:Int=0) )   Fixed in version 1.55
  • SaveToString   ( Method SaveToString:String() )
  • SetAngle   ( Method SetAngle:Void(a:Float, relative:Bool = False) )
  • SetPos   ( Method SetPos:Void(x:Float, y:Float, relative:Bool = False) )
  • SetPosX   ( Method SetPosX:Void(x:Float, relative:Bool = False) )
  • SetPosY   ( Method SetPosY:Void(y:Float, relative:Bool = False) )
  • SetScale   ( Method SetScale:Void(x:Float, y:Float, relative:Bool = False) )
  • UpdateAllMarker   ( Method UpdateAllMarker:Void(speedFactor:Float = 1.0) )

Constants:

Method AddWP:ftWaypoint(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftWaypoint = ftPath.AddWP (xpos:Float, ypos:Float, relative:Bool = False)
Description:This method adds a new waypoint to an existing path and returns it.
Return type:ftWaypoint
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
Method CleanupLists:Void()

Syntax:


ftPath.CleanupLists ()
Method CreateMarker:ftMarker(speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop)

Syntax:


ftMarker = ftPath.CreateMarker (speed:Float= 1.0, dir:Int = mdForward, mode:Int = mmStop)
Description:This method creates a new marker for an existing path.
Return type:ftMarker
Parameters:
NameTypeValue
speedFloat1.0
dirIntmdForward
modeIntmmStop
Method FindClosestWP:ftWaypoint(xpos:Float, ypos:Float)

Syntax:


ftWaypoint = ftPath.FindClosestWP (xpos:Float, ypos:Float)
Description:To find the closest waypoint of a path to a given position, use this method.
Return type:ftWaypoint
Parameters:
NameTypeValue
xposFloat
yposFloat
Method GetAngle:Float()

Syntax:


Float = ftPath.GetAngle ()
Description:Returns the angle of the path.
Return type:Float
Method GetPos:Float[]()

Syntax:


Float[] = ftPath.GetPos ()
Description:Returns the position of the path inside an array.
Return type:Float[]
Method GetScale:Float[]()

Syntax:


Float[] = ftPath.GetScale ()
Description:Returns the scale factors of the path inside an array.
Return type:Float[]
Method GetWP:ftWaypoint(index:Int)

Syntax:


ftWaypoint = ftPath.GetWP (index:Int)
Description:Get a the waypoint with the given index. Index starts with 1.
Return type:ftWaypoint
Parameters:
NameTypeValue
indexInt
Method GetWPCount:Int()

Syntax:


Int = ftPath.GetWPCount ()
Description:Returns the waypoint count of the path.
Return type:Int
Method LoadFromString:Void(ps:String)

Syntax:


ftPath.LoadFromString (ps:String)
Description:Load a path from a string.
Parameters:
NameTypeValue
psString
Method Remove:Void()

Syntax:


ftPath.Remove ()
Description:Remove a path and its content.
Method RemoveAllMarkers:Void()

Syntax:


ftPath.RemoveAllMarkers ()
Description:Removes all markers of the path.
Method RemoveAllWP:Void()

Syntax:


ftPath.RemoveAllWP ()
Description:Removes all waypoints of the path.
Method RemoveWP:Void(index:Int)

Syntax:


ftPath.RemoveWP (index:Int)
Description:Returns a waypoint with the given index. Index starts with 1.
Parameters:
NameTypeValue
indexInt
Method RenderAllMarker:Void(type:Int=0)

Syntax:


ftPath.RenderAllMarker (type:Int=0)
Changes:Fixed in version 1.55
Description:Render all markers of a path. You can use this for debugging.
Parameters:
NameTypeValue
typeInt0
Details:A type value of 0 renders a square, any other value renders a circle.
Method RenderAllWP:Void(type:Int=0)

Syntax:


ftPath.RenderAllWP (type:Int=0)
Changes:Fixed in version 1.55
Description:Render all waypoints of a path. You can use this for debugging.
Parameters:
NameTypeValue
typeInt0
Details:A type value of 0 renders a square, any other value renders a circle.
Method SaveToString:String()

Syntax:


String = ftPath.SaveToString ()
Description:Save a path to a string.
Return type:String
Method SetAngle:Void(a:Float, relative:Bool = False)

Syntax:


ftPath.SetAngle (a:Float, relative:Bool = False)
Description:Sets the angle of a path and position its waypoints regarding the angle.
Parameters:
NameTypeValue
aFloat
relativeBoolFalse
Method SetPos:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftPath.SetPos (x:Float, y:Float, relative:Bool = False)
Description:Sets the position of a path and its waypoints.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method SetPosX:Void(x:Float, relative:Bool = False)

Syntax:


ftPath.SetPosX (x:Float, relative:Bool = False)
Description:Sets the X position of a path and its waypoints.
Parameters:
NameTypeValue
xFloat
relativeBoolFalse
Method SetPosY:Void(y:Float, relative:Bool = False)

Syntax:


ftPath.SetPosY (y:Float, relative:Bool = False)
Description:Sets the Y position of a path and its waypoints.
Parameters:
NameTypeValue
yFloat
relativeBoolFalse
Method SetScale:Void(x:Float, y:Float, relative:Bool = False)

Syntax:


ftPath.SetScale (x:Float, y:Float, relative:Bool = False)
Description:Sets the scale of a path and position its waypoints regarding the angle.
Parameters:
NameTypeValue
xFloat
yFloat
relativeBoolFalse
Method UpdateAllMarker:Void(speedFactor:Float = 1.0)

Syntax:


ftPath.UpdateAllMarker (speedFactor:Float = 1.0)
Description:Updates all markers of a path.
Parameters:
NameTypeValue
speedFactorFloat1.0
Const imCatmull:Int=1
Type:Int
Value:1
Const imLinear:Int=0
Type:Int
Value:0
Const mdBackwards:Int = 2
Type:Int
Value:2
Const mdForward:Int = 1
Type:Int
Value:1
Const mmBounce:Int = 1
Type:Int
Value:1
Const mmCircle:Int = 3
Type:Int
Value:3
Const mmStop:Int = 0
Type:Int
Value:0
Const mmWarp:Int = 2
Type:Int
Value:2
Class ftWaypoint
Description:The ftWaypoint class defines a single waypoint in a path.
Table of contents:Methods:
  • GetIndex   ( Method GetIndex:Int() )
  • GetPos   ( Method GetPos:Float[]() )
  • Remove   ( Method Remove:Void() )
  • Render   ( Method Render:Void(renderType:Int=0) )
  • SetPos   ( Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False) )

Method GetIndex:Int()

Syntax:


Int = ftWaypoint.GetIndex ()
Description:Returns the path index of a waypoint. Index start with 1
Return type:Int
Method GetPos:Float[]()

Syntax:


Float[] = ftWaypoint.GetPos ()
Description:Returns the X/Y position of a waypoint.
Return type:Float[]
Method Remove:Void()

Syntax:


ftWaypoint.Remove ()
Description:Removes a waypoint from its path.
Method Render:Void(renderType:Int=0)

Syntax:


ftWaypoint.Render (renderType:Int=0)
Description:Renders a waypoint at its current position.
Parameters:
NameTypeValue
renderTypeInt0
Details:A renderType of 0 renders a box, every other value a circle.
Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False)

Syntax:


ftWaypoint.SetPos (xpos:Float, ypos:Float, relative:Bool = False)
Description:Sets the position of a waypoint inside a path.
Parameters:
NameTypeValue
xposFloat
yposFloat
relativeBoolFalse
This fantomEngine framework is released under the MIT license:
Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/docs/index.html b/docs/index.html index 846da47..ae9ec3a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,5 +8,5 @@ index.html -


Introduction


fantomEngine is a 2D game framework (module) for Monkey X that was created to give game developers more time to work on the actual game play than on setting up render routines, update process chains and stuff like that.

With fantomEngine you will write only fractions of the code you did before.

Website, bug reports and forum support

The most current version of fantomEngine is now hosted at www.fantomgl.com as Google doesn't let someone create new downloads anymore. You can post issues/bug reports at the new support forum.
The forum is also a good place to ask your questions about how to use fantomEngine or make suggestions about needed features.

Features

fantomEngine currently supports the following features:

Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


+


Introduction


fantomEngine is a 2D game framework (module) for Monkey X that was created to give game developers more time to work on the actual game play than on setting up render routines, update process chains and stuff like that.

With fantomEngine you will write only fractions of the code you did before.

Website, bug reports and forum support

The most current version of fantomEngine is now hosted at www.fantomgl.com as Google doesn't let someone create new downloads anymore. You can post issues/bug reports at the new support forum.
The forum is also a good place to ask your questions about how to use fantomEngine or make suggestions about needed features.

Features

fantomEngine currently supports the following features:

Copyright (c) 2011-2016 Michael Hartlef

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, and to permit persons to whom the software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.