From 14ae2d5c6abb79f2f55642859d4c20007e1364dd Mon Sep 17 00:00:00 2001 From: Michael Hartlef Date: Mon, 8 Feb 2016 22:56:21 +0100 Subject: [PATCH] Version 1.58 Fxied LAyer scaling and layer scissor. --- Changes.txt | 18 + cftAStar.monkey | 13 +- cftBox2D.monkey | 5 +- cftEngine.monkey | 42 +- cftFont.monkey | 2 - cftFunctions.monkey | 4 - cftGui.monkey | 11 - cftImageMng.monkey | 1 - cftLayer.monkey | 46 +- cftObjAnimMng.monkey | 1 - cftObject.monkey | 667 +++++++++++------- cftScene.monkey | 2 - cftSpriteAtlas.monkey | 4 - cftTileMap.monkey | 6 - cftVec2D.monkey | 1 - cftWaypoints.monkey | 2 - docs/3rdpartytools.html | 2 +- docs/cftAStar.monkey.html | 2 +- docs/cftBox2D.monkey.html | 2 +- docs/cftEngine.monkey.html | 96 +-- docs/cftFont.monkey.html | 2 +- docs/cftFunctions.monkey.html | 2 +- docs/cftGui.monkey.html | 2 +- docs/cftHighscore.monkey.html | 2 +- docs/cftImageMng.monkey.html | 2 +- docs/cftKeyMapping.monkey.html | 4 +- docs/cftLayer.monkey.html | 2 +- docs/cftLocalization.monkey.html | 2 +- docs/cftMisc.monkey.html | 2 +- docs/cftObjAnimMng.monkey.html | 2 +- docs/cftObject.monkey.html | 8 +- docs/cftRGBA.monkey.html | 2 +- docs/cftScene.monkey.html | 2 +- docs/cftSound.monkey.html | 2 +- docs/cftSpriteAtlas.monkey.html | 2 +- docs/cftTileMap.monkey.html | 4 +- docs/cftTimer.monkey.html | 2 +- docs/cftTrans.monkey.html | 2 +- docs/cftVec2D.monkey.html | 2 +- docs/cftWaypoints.monkey.html | 2 +- docs/changes.html | 2 +- docs/classes.html | 2 +- docs/examples.html | 2 +- docs/index.html | 2 +- .../Layer/ScalingLayers/ScalingLayers.monkey | 261 +++++++ examples/Sound/Sound.data/happy.mp3 | Bin 0 -> 62692 bytes examples/Sound/Sound.data/shoot.wav | Bin 0 -> 10576 bytes examples/Sound/Sound.monkey | 159 +++++ .../Platformer_Physics.data/platformer.json | 39 + .../Platformer_Physics.data/platformer2.json | 39 + .../Platformer_Physics.data/tiles.png | Bin 0 -> 1029 bytes .../Platformer_Physics.monkey | 361 ++++++++++ fantomEngine.monkey | 2 +- monkeydoc/cftEngine.monkeydoc | 208 ++++++ monkeydoc/cftFont.monkeydoc | 4 + monkeydoc/cftHighscore.monkeydoc | 14 + monkeydoc/cftKeyMapping.monkeydoc | 8 + monkeydoc/cftLayer.monkeydoc | 50 +- monkeydoc/cftLocalization.monkeydoc | 8 + monkeydoc/cftObject.monkeydoc | 260 ++++++- monkeydoc/cftScene.monkeydoc | 20 + monkeydoc/cftSound.monkeydoc | 20 + monkeydoc/cftTileMap.monkeydoc | 18 + monkeydoc/cftTimer.monkeydoc | 4 + monkeydoc/cftTrans.monkeydoc | 8 + monkeydoc/fantomEngine.monkeydoc | 5 +- 66 files changed, 2007 insertions(+), 466 deletions(-) create mode 100644 examples/Layer/ScalingLayers/ScalingLayers.monkey create mode 100644 examples/Sound/Sound.data/happy.mp3 create mode 100644 examples/Sound/Sound.data/shoot.wav create mode 100644 examples/Sound/Sound.monkey create mode 100644 examples/TileMaps/Platformer_Physics/Platformer_Physics.data/platformer.json create mode 100644 examples/TileMaps/Platformer_Physics/Platformer_Physics.data/platformer2.json create mode 100644 examples/TileMaps/Platformer_Physics/Platformer_Physics.data/tiles.png create mode 100644 examples/TileMaps/Platformer_Physics/Platformer_Physics.monkey diff --git a/Changes.txt b/Changes.txt index 2178701..761b575 100755 --- a/Changes.txt +++ b/Changes.txt @@ -1,3 +1,21 @@ +Version 1.58 + +*Changes* + + - Added children flag to ftObject.SetActive so it affects children too + - ftLayer.SetLayerScissor now works with virtual values, no offsets anymore + +*Fixes* + + - Fixed/Changed ftLayer.Render regarding layer scaling. + - Fixed ftObject.Render regarding layer scaling and also object culling. + +*New example* + + - Layer/LayerScaling/LayerScaling.monkey + - TileMaps/Platformer_Physics/Platformer_Physics.monkey + +----------------------------------------------------------------------------------------- Version 1.57 *New functionalities* diff --git a/cftAStar.monkey b/cftAStar.monkey index 0287d1b..e8aa103 100755 --- a/cftAStar.monkey +++ b/cftAStar.monkey @@ -142,7 +142,6 @@ Class ftGridNode Self.block = blockFlag End '------------------------------------------ -'changes:Changed in v1.55 'summery:Sets the position of a node inside a grid. Method SetPos:Void(xpos:Float, ypos:Float, relative:Bool = False) If relative = True Then @@ -197,7 +196,6 @@ Class ftAStar End '#DOCON# '------------------------------------------ -'changes:Changed in v1.55 'summery:Add a node to a grid. Method AddNode:ftGridNode(ID:Int, xpos:Float, ypos:Float, relative:Bool = False) Local tmpNode := New ftGridNode @@ -451,7 +449,6 @@ Class ftAStar Return 0 End '------------------------------------------ -'changes:New in v.155 'summery:Returns the angle of the grid. Method GetAngle:Float() Return Self.angle @@ -638,13 +635,11 @@ Class ftAStar Return ret End '------------------------------------------ -'changes:New in v.155 'summery:Returns the X scale factor of the grid. Method GetScaleX:Float() Return Self.scaleX End '------------------------------------------ -'changes:New in v.155 'summery:Returns the Y scale factor of the grid. Method GetScaleY:Float() Return Self.scaleY @@ -840,7 +835,6 @@ Class ftAStar End '------------------------------------------ -'changes:Changed in v1.55 'summery:Sets the position of a grid and its nodes. Method SetPos:Void(x:Float, y:Float, relative:Bool = False) If relative = True Then @@ -863,7 +857,6 @@ Class ftAStar End '------------------------------------------ -'changes:Changed in v1.55 'summery:Sets the X position of a grid and its nodes. Method SetPosX:Void(x:Float, relative:Bool = False) If relative = True Then @@ -875,7 +868,7 @@ Class ftAStar node.x = node.xDist + Self.xPos Next 'Scale and rotate all nodes accordning to the scale factors and the angle of the grid - If Self.GetScaleX() <> 1.0 Or Self.GetScaleY() <> 1.0 then + If Self.GetScaleX() <> 1.0 Or Self.GetScaleY() <> 1.0 Then Self.SetScale(0.0, 0.0, True) Elseif Self.GetAngle() <> 0.0 Self.SetAngle(0.0, True) @@ -883,7 +876,6 @@ Class ftAStar End '------------------------------------------ -'changes:Changed in v1.55 'summery:Sets the Y position of a grid and its nodes. Method SetPos:Void(y:Float, relative:Bool = False) If relative = True Then @@ -895,7 +887,7 @@ Class ftAStar node.y = node.yDist + Self.yPos Next 'Scale and rotate all nodes accordning to the scale factors and the angle of the grid - If Self.GetScaleX() <> 1.0 Or Self.GetScaleY() <> 1.0 then + If Self.GetScaleX() <> 1.0 Or Self.GetScaleY() <> 1.0 Then Self.SetScale(0.0, 0.0, True) Elseif Self.GetAngle() <> 0.0 Self.SetAngle(0.0, True) @@ -903,7 +895,6 @@ Class ftAStar End '------------------------------------------ -'changes:Changed in v1.55. 'summery:Sets the scale of a grid and position its nodes regarding the angle. Method SetScale:Void(x:Float, y:Float, relative:Bool = False) If relative = True Then diff --git a/cftBox2D.monkey b/cftBox2D.monkey index 921beb6..bcb7067 100755 --- a/cftBox2D.monkey +++ b/cftBox2D.monkey @@ -271,8 +271,9 @@ Class ftBox2D fixtureDef.density = 0.7 fixtureDef.friction = 0.1 fixtureDef.restitution = 0.9 - 'bodyDef.angle = (tmpObj.GetAngle())* 0.0174533 - bodyDef.angle = (tmpObj.GetAngle()+90)* 0.0174533 + bodyDef.angle = (tmpObj.GetAngle())* 0.0174533 + 'bodyDef.angle = (tmpObj.GetAngle()+90)* 0.0174533 +'Print (tmpObj.GetWidth()+":"+tmpObj.GetHeight()+":"+tmpObj.GetAngle()+":"+(bodyDef.angle/0.0174533)) bodyDef.position.Set( tmpObj.GetPosX()/m_physScale, tmpObj.GetPosY()/m_physScale) body = m_world.CreateBody(bodyDef) diff --git a/cftEngine.monkey b/cftEngine.monkey index 69500a5..7107672 100755 --- a/cftEngine.monkey +++ b/cftEngine.monkey @@ -19,7 +19,6 @@ Import fantomEngine '*************************************** 'summery:The class [b]ftEngine[/b] 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. -'changes:Fixed in v1.56 Class ftEngine '#DOCOFF# Field _imgLoading:Image = Null @@ -487,7 +486,6 @@ This command copies a given object and returns the copy. The new object contains End #End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 #Rem 'summery:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos. The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount. @@ -538,7 +536,6 @@ It creates a DEFAULT animation automatically. End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 #Rem 'summery:Creates an animated image object (sprite) from the given sprite atlas with a center at xPos/yPos. The texture will be grabbed from frameStartX/frameStartY with the given frameWidth/frameHeight. The number of frames will be taken from the given frameCount. @@ -589,7 +586,6 @@ It creates a DEFAULT animation automatically. End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Creates a rectangle with the given width/height and the center at xpos/ypos. #End @@ -623,7 +619,6 @@ It creates a DEFAULT animation automatically. End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Creates a circle with the given radius and the center at xpos/ypos. #End @@ -657,7 +652,6 @@ It creates a DEFAULT animation automatically. End '------------------------------------------ -'changes:New in v1.57 #Rem 'summery:Creates an custom GUI manager object which you can use to GUI child objects to. #End @@ -683,7 +677,6 @@ It creates a DEFAULT animation automatically. Return obj End '------------------------------------------ -'changes:Fxied in v1.57 #Rem 'summery:Creates an image object (sprite) from the given filename with a center at xpos/ypos. 'To load an animated image object, use CreateAnimImage. @@ -725,7 +718,6 @@ It creates a DEFAULT animation automatically. End '------------------------------------------ -'changes:Fixed in v1.57 #Rem 'summery:Creates an image object (sprite) from the given image with a center at xpos/ypos. #End @@ -764,7 +756,6 @@ It creates a DEFAULT animation automatically. End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 #Rem 'summery: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. #End @@ -803,7 +794,6 @@ It creates a DEFAULT animation automatically. End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 #Rem 'summery:Loads a subimage from a packed texture created by the tool TexturePacker with a center at xpos/ypos. It supports rotated sub images in LibGDX files too. @@ -961,7 +951,6 @@ From version 1.52 on it supports Sparrow compatible files (.xml). End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Creates a line object starting at xpos/ypos and ending at x/y. The objects handle is in the middle of the line by default and can be changed via a call to ftObject.SetHandle. @@ -1017,7 +1006,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th End '------------------------------------------ -'changes:Changed in v1.56 'summery:Creates an oval object with the given width/height and the center at xpos/ypos. 'Provided by Douglas Williams 'seeAlso:CreateAnimImage,CreateBox,CreateCircle,CreateImage,CreateLine,CreatePoint,CreatePoly,CreateStickman,CreateTileMap,CreateText @@ -1062,7 +1050,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Creates an empty object (pivot) which you can use to attach/parent child objects to. #End @@ -1094,7 +1081,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return obj End '------------------------------------------ -'changes:Changed in v1.56 'summery:Creates a point object at the given xpos/ypos. 'Provided by Douglas Williams 'seeAlso:CreateAnimImage,CreateBox,CreateCircle,CreateImage,CreateLine,CreateOval,CreatePoly,CreateStickman,CreateTileMap,CreateText @@ -1126,9 +1112,8 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return obj End '------------------------------------------ -'changes:Changed in v1.56 -'provided by Douglas Williams 'summery:Creates a polygon object with supplied vertices pairs (Minimum of 3 pairs required). +'Provided by Douglas Williams 'seeAlso:CreateAnimImage,CreateBox,CreateCircle,CreateImage,CreateLine,CreateOval,CreatePoint,CreateStickman,CreateTileMap,CreateText Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null) Local minX:Float = 99999,maxX:Float=-99999, minY:Float=99999, maxY:Float=-99999 @@ -1193,7 +1178,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return scene End '------------------------------------------ -'changes:New in v1.55 #Rem 'summery:Creates/loads a sprite atlas. #End @@ -1205,8 +1189,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return newAtlas End '------------------------------------------ -'changes:Changed in v1.56 -'provided by Douglas Williams #Rem 'summery:Creates a stickman with top left corner at position xpos/ypos with size of width:8 / height:29 #End @@ -1241,7 +1223,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return obj End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Creates a new text object. #End @@ -1289,7 +1270,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th End '----------------------------------------------------------------------------- -'changes:Changed in v1.56 to support multiple tilesets #Rem 'summery:Create a tile map which you can fill yourself. #End @@ -1369,7 +1349,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return obj End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 #Rem 'summery:Create a tile map which you can fill yourself. #End @@ -1454,7 +1433,6 @@ When the timer fires it will call OnObjectTimer. A repeatCount of -1 will let th Return obj End '----------------------------------------------------------------------------- -'changes:Changed in v1.56 to support multiple tilesets #Rem 'summery:Create a tile map from a JSON file exported by the tool Tiled. The layerIndex tells fantomEngine to load the tileLayer at that index. Index starts with 1. @@ -1463,7 +1441,7 @@ The layerIndex tells fantomEngine to load the tileLayer at that index. Index sta Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 ) Local obj:ftObject = New ftObject Local imgH:Int - Local imgW:int + Local imgW:Int Local tlH:Int Local tlW:Int Local path:String ="" @@ -1747,7 +1725,6 @@ The layerIndex tells fantomEngine to load the tileLayer at that index. Index sta obj.collType = -1 obj.internal_RotateSpriteCol() - Return obj End '----------------------------------------------------------------------------- @@ -1908,7 +1885,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in version 1.56 'summery:Returns the cameras X and Y coordinate. 'seeAlso:GetCamX,GetCamY,SetCam,SetCamX,SetCamY Method GetCam:Float[] () @@ -1918,14 +1894,12 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time Return [retX, retY] End '----------------------------------------------------------------------------- -'changes:New in version 1.56 'summery:Returns the cameras X coordinate. 'seeAlso:GetCam,GetCamY,SetCam,SetCamX,SetCamY Method GetCamX:Float () Return Self.camX End '----------------------------------------------------------------------------- -'changes:New in version 1.56 'summery:Returns the cameras Y coordinate. 'seeAlso:GetCam,GetCamX,SetCam,SetCamX,SetCamY Method GetCamY:Float () @@ -1998,7 +1972,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the device X position of a virtual X coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalXY,GetLocalY,GetWorldX,GetWorldXY,GetWorldY Method GetLocalX:Float(wordXPos:Float, withCam:Bool = True) @@ -2012,7 +1985,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the device X/Y position of a virtual X/Y coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalX,GetLocalY,GetWorldX,GetWorldXY,GetWorldY Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True) @@ -2029,7 +2001,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the device Y position of a virtual Y coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalX,GetLocalXY,GetWorldX,GetWorldXY,GetWorldY Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True) @@ -2168,7 +2139,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time Return Self.volumeSFX End '------------------------------------------ -'changes:Added support for FontMachine in v1.54. #Rem 'summery:Loads an EZGui compatible font or a packed FontMachine font. The filename has to end with a .txt extension. #End @@ -2180,7 +2150,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the world X position from a local X coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalX,GetLocalXY,GetLocalY,GetWorldXY,GetWorldY Method GetWorldX:Float(localXPos:Float, withCam:Bool = True) @@ -2194,7 +2163,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the world X/Y position from a local X/Y coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalX,GetLocalXY,GetLocalY,GetWorldX,GetWorldY Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True) @@ -2211,7 +2179,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:New in v1.55 'summery:Returns the world Y position from a local Y coordinate. It takes the virtual canvas size and camera position into its calculation. 'seeAlso:GetLocalX,GetLocalXY,GetLocalY,GetWorldX,GetWorldXY Method GetWorldY:Float(localYPos:Float, withCam:Bool = True) @@ -2225,7 +2192,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:Changed in v1.55 to use Image.MidHandle as the default flag. #Rem 'summery:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager. #End @@ -2235,7 +2201,6 @@ When the timer fires it will call OnTimer. A repeatCount of -1 will let the time End '----------------------------------------------------------------------------- -'changes:Changed in v1.55 to use Image.MidHandle as the default flag. '#Rem 'summery:Loads an image like mogo.LoadImage, but also stores it in the fantomEngine image manager. '#End @@ -2308,7 +2273,6 @@ The current default file formats are: End '------------------------------------------ -'changes:Fixed in version 1.57 #Rem 'summery:Creates an instance of the fantomEngine. #End @@ -2364,7 +2328,6 @@ The current default file formats are: Return 0 End '------------------------------------------ -'changes:New in version 1.54 #Rem 'summery:This method is called when an animation of an object (obj) has finished one loop. #End @@ -2945,7 +2908,6 @@ Lower values than 1.0 slow down the engine, bigger values speed it up. Endif End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Do a touch check over all layers and their active objects which have a touch method assigned to them. 'If a touch was detected, it will call the [b]ftEngine.OnObjectTouch[/b] method. diff --git a/cftFont.monkey b/cftFont.monkey index b1bf9d5..a22e2c8 100755 --- a/cftFont.monkey +++ b/cftFont.monkey @@ -33,7 +33,6 @@ Class ftChar End '#DOCON# '*************************************** -'changes:Added fontMachine support in version 1.54 'summery:The class ftFont provides a few methods regarding the definition of a loaded font. Class ftFont '#DOCOFF# @@ -211,7 +210,6 @@ Class ftFont End '------------------------------------------ -'changes:Fixed in versin 1.54 to support LINUX lines delimiters (13,10) Method Load:Void(url:String) Local iniText:String Local pageNum:Int = 0 diff --git a/cftFunctions.monkey b/cftFunctions.monkey index d60cf00..5ada2a1 100755 --- a/cftFunctions.monkey +++ b/cftFunctions.monkey @@ -140,7 +140,6 @@ Public Return s End '------------------------------------------ -'changes:Changed help text in v1.54. #Rem 'summery:Maximizes the HTML5 canvas. 'HTML5 only. @@ -150,7 +149,6 @@ Public ' End '------------------------------------------ -'changes:Changed help text in v1.54. #Rem 'summery:Resizes the HTML5 canvas to the given proportions. 'HTML5 only. @@ -160,7 +158,6 @@ Public ' End '------------------------------------------ -'changes:Changed help text in v1.54. #Rem 'summery:Resizes the HTML5 console to the given proportions. 'HTML5 only. @@ -170,7 +167,6 @@ Public ' End '------------------------------------------ -'changes:Changed help text in v1.54. #Rem 'summery:Hides the HTML5 console. 'HTML5 only. diff --git a/cftGui.monkey b/cftGui.monkey index 0bb862b..d441c34 100755 --- a/cftGui.monkey +++ b/cftGui.monkey @@ -18,7 +18,6 @@ Import fantomEngine #End '*************************************** -'changes:New in version 1.57. Class ftGuiGadget Extends ftObject '#DOCOFF# Field gotHit:Bool = False @@ -65,7 +64,6 @@ Class ftGuiGadget Extends ftObject End '*************************************** -'changes:New in version 1.57. Class ftGuiButton Extends ftGuiGadget '----------------------------------------------------------------------------- ' Overriding the default method so it will handle the fading effect. @@ -91,7 +89,6 @@ Class ftGuiButton Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57 Class ftGuiCheckbox Extends ftGuiGadget '----------------------------------------------------------------------------- ' Overriding the default method so it will handle the fading effect. @@ -131,7 +128,6 @@ Class ftGuiCheckbox Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiJoystick Extends ftGuiGadget '#DOCOFF# Field xStickOff:Float = 0.0 @@ -227,7 +223,6 @@ Class ftGuiJoystick Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiLabel Extends ftGuiGadget Field hasShadow:Bool = False Field shadowX:Float = 2.0 @@ -257,7 +252,6 @@ Class ftGuiLabel Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiListviewItem Field text:String = "" Field img:ftImage = Null @@ -280,7 +274,6 @@ Class ftGuiListviewItem End '*************************************** -'changes:New in version 1.57. Class ftGuiListview Extends ftGuiGadget Field itemList:= New List Field scrollX:Float = 0.0 @@ -408,7 +401,6 @@ Class ftGuiListview Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiMng Extends ftObject 'Field engine:ftEngine Field objList := New List @@ -618,7 +610,6 @@ Class ftGuiMng Extends ftObject End '*************************************** -'changes:New in version 1.57. Class ftGuiSlider Extends ftGuiGadget '#DOCOFF# Field xKnobOff:Float = 0.0 @@ -684,7 +675,6 @@ Class ftGuiSlider Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiSwitch Extends ftGuiGadget '----------------------------------------------------------------------------- ' Overriding the default method so it will handle the fading effect. @@ -722,7 +712,6 @@ Class ftGuiSwitch Extends ftGuiGadget End '*************************************** -'changes:New in version 1.57. Class ftGuiTextfield Extends ftGuiGadget Field hasShadow:Bool = False Field shadowX:Float = 2.0 diff --git a/cftImageMng.monkey b/cftImageMng.monkey index 6068c69..0607cc4 100755 --- a/cftImageMng.monkey +++ b/cftImageMng.monkey @@ -93,7 +93,6 @@ Class ftImage Self.imageNode.Remove() End '------------------------------------------ -'changes:New in version 1.54. 'summery:Sets the path (filename) of a ftImage. Method SetPath:String(filePath:String) Self.path = filePath diff --git a/cftLayer.monkey b/cftLayer.monkey index 7370809..33bc42c 100755 --- a/cftLayer.monkey +++ b/cftLayer.monkey @@ -52,10 +52,10 @@ Class ftLayer Field tag:Int = 0 Field isGUI:Bool = False - Field scissorOffX:Float = 0.0 - Field scissorOffY:Float = 0.0 - Field scissorOffWidth:Float = 0.0 - Field scissorOffHeight:Float = 0.0 + Field scissorX:Float = 0.0 + Field scissorY:Float = 0.0 + Field scissorWidth:Float = 0.0 + Field scissorHeight:Float = 0.0 '----------------------------------------------------------------------------- Method CleanupLists:Void() @@ -69,7 +69,6 @@ Class ftLayer '#DOCON# '------------------------------------------ -'changes:changed in v1.56 #Rem 'summery:Does a collision check on all active objects of this layer with a assigned collision group. 'If a collision appears, ftEngine.OnObjectCollision is called. @@ -94,7 +93,6 @@ Class ftLayer CleanupLists() End '------------------------------------------ -'changes:changed in v1.56 #Rem 'summery:Does a collision check on the given object. 'The object needs to be active. If a collision appears, ftEngine.OnObjectCollision is called. @@ -282,7 +280,6 @@ Class ftLayer Return tag End '----------------------------------------------------------------------------- -'changes:New in version 1.55 'summery:Returns the amount of active transitions of the layer. Method GetTransitionCount:Int () Return transitionList.Count() @@ -294,7 +291,6 @@ Class ftLayer Return isVisible End '------------------------------------------ -'changes:Fixed in version 1.57 'summery:Removes this layer from the engine. If the delObjects flag is set to TRUE, then it will remove all attached objects too. Method Remove:Void(delObjects:Bool = False) If Self.engine <> Null Then @@ -336,7 +332,7 @@ Class ftLayer Next End '------------------------------------------ -'changes:Changed in v1.55. +'changes:Changed/Fixed in v1.58 regarding layer scaling and layerScissor. #Rem 'summery:Render all visible and active objects of a layer. 'Objects are normally rendered in their order of creation, unless you have sorted the objects of a layer via the ftLayer.SortObjects method. @@ -344,6 +340,7 @@ Class ftLayer #End 'seeAlso:SetVisible,SetGUI,SetLayerScissor Method Render:Void() + Local sc:Float[4] Local _scissor:Bool = False PushMatrix 'If xPos <> 0.0 Or yPos <> 0.0 Then Translate (xPos, yPos) @@ -358,12 +355,16 @@ Class ftLayer engine.lastLayerAngle = angle If scale <> engine.lastLayerScale Then - Scale(scale, scale) + 'Scale(scale, scale) engine.lastLayerScale = scale Endif If isVisible=True Then - If Self.scissorOffX <> 0.0 Or Self.scissorOffY <> 0.0 Or Self.scissorOffWidth <> 0.0 Or Self.scissorOffHeight <> 0.0 Then - mojo.SetScissor( engine.autofitX+Self.scissorOffX, engine.autofitY+Self.scissorOffY, (engine.canvasWidth+Self.scissorOffWidth)*engine.scaleX, (engine.canvasHeight+Self.scissorOffHeight)*engine.scaleY ) + If Self.scissorX <> 0.0 Or Self.scissorY <> 0.0 Or Self.scissorWidth <> 0.0 Or Self.scissorHeight <> 0.0 + sc = mojo.GetScissor() + + 'mojo.SetScissor( engine.autofitX+Self.scissorOffX, engine.autofitY+Self.scissorOffY, (engine.canvasWidth+Self.scissorOffWidth)*engine.scaleX, (engine.canvasHeight+Self.scissorOffHeight)*engine.scaleY ) + mojo.SetScissor( engine.autofitX + Self.scissorX * engine.scaleX, engine.autofitY + Self.scissorY * engine.scaleY, Self.scissorWidth * engine.scaleX, Self.scissorHeight * engine.scaleY ) + _scissor = True Endif For Local obj := Eachin objList @@ -379,14 +380,18 @@ Class ftLayer If obj.isVisible And obj.isActive And obj.parentObj = Null If obj.type = ftEngine.otGUI ftGuiMng(obj).Render(Self.xPos-engine.camX, Self.yPos-engine.camY) + 'ftGuiMng(obj).Render((Self.xPos-engine.camX)/Self.scale, (Self.yPos-engine.camY)/Self.scale) Else obj.Render(Self.xPos-engine.camX, Self.yPos-engine.camY) + 'obj.Render((Self.xPos-engine.camX)/Self.scale, (Self.yPos-engine.camY)/Self.scale) Endif Endif Endif Next If _scissor = True - mojo.SetScissor( engine.autofitX, engine.autofitY, (engine.canvasWidth)*engine.scaleX, (engine.canvasHeight)*engine.scaleY ) + 'mojo.SetScissor( engine.autofitX, engine.autofitY, (engine.canvasWidth)*engine.scaleX, (engine.canvasHeight)*engine.scaleY ) +'mojo.SetScissor( 0, 0 ,DeviceWidth() , DeviceHeight() ) +mojo.SetScissor( sc[0], sc[1] ,sc[2] , sc[3] ) Endif Endif PopMatrix @@ -432,14 +437,14 @@ Class ftLayer Self.id = layerID End '------------------------------------------ -'changes:New in v1.55. -'summery:Sets the offset of the scissor for this layer. +'changes:Changed in v1.58. No offset but real sizes. +'summery:Sets the position and the size of the scissor for this layer. Width and Height take a virtual canvas size into account. 'seeAlso:Render - Method SetLayerScissor:Void(offX:Float = 0.0, offY:Float = 0.0, offWidth:Float = 0.0, offHeight:Float = 0.0) - Self.scissorOffX = offX - Self.scissorOffY = offY - Self.scissorOffWidth = offWidth - Self.scissorOffHeight = offHeight + Method SetLayerScissor:Void(X:Float, Y:Float, Width:Float, Height:Float) + Self.scissorX = X + Self.scissorY = Y + Self.scissorWidth = Width + Self.scissorHeight = Height End '----------------------------------------------------------------------------- 'summery:Set the X and Y position of a layer. @@ -505,7 +510,6 @@ Overwrite that method to get a different sorting. The default sorting will sort objList.Sort() End '------------------------------------------ -'changes:Changed in v1.56 #Rem 'summery:Executes a touch check to each object at the given position. 'The object has to have a touchmode > 0 and needs to be active. diff --git a/cftObjAnimMng.monkey b/cftObjAnimMng.monkey index 5e06dca..aaca053 100755 --- a/cftObjAnimMng.monkey +++ b/cftObjAnimMng.monkey @@ -127,7 +127,6 @@ Class ftObjAnimMng animObj.SetCurrImage(currAnim.animFrames[currAnim.currFrame].imgIndex+1, currAnim.animFrames[currAnim.currFrame].frameIndex ) End '----------------------------------------------------------------------------- -'changes:New in version 1.54. #Rem 'summery:Set the repeat count of the current animation. 'The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself. diff --git a/cftObject.monkey b/cftObject.monkey index f0ba445..99f1bc7 100755 --- a/cftObject.monkey +++ b/cftObject.monkey @@ -59,6 +59,7 @@ Class ftObject Field engine:ftEngine = Null Field red:Float = 255.0 + Field blue:Float = 255.0 Field green:Float = 255.0 Field alpha:Float = 1.0 @@ -466,7 +467,6 @@ ftEngine.tmBox (Value = 3)[/list] End '#DOCON# '---------------------------------------------------------- -'changes:Changed in version 1.54 'summery:Add a animation sequence to an object. This way an object becomes animated. 'seeAlso:AddAnim Method CreateAnim:Void(animName:String, imgIndex:Int, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) @@ -487,7 +487,6 @@ ftEngine.tmBox (Value = 3)[/list] Self.SetAnimRepeatCount(_repeatCount) End '---------------------------------------------------------- -'changes:Changed in version 1.54 'summery:Add a animation sequence to an object. This way an object becomes animated. 'seeAlso:AddAnim Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) @@ -719,7 +718,6 @@ ftEngine.tmBox (Value = 3)[/list] Return collGroup End '----------------------------------------------------------------------------- -'changes:New in vesion 1.56. 'summery:Returns the color of an object in an array. 'seeAlso:SetColor Method GetColor:Float[]() @@ -1157,7 +1155,6 @@ It returns -1 if there is no tile. Return Self.tileMap.GetTileIDAt(xp,yp) End '----------------------------------------------------------------------------- -'changes:New in v1.56 'summery:Returns the tileMap of this object. Method GetTileMap:ftTileMap() Return Self.tileMap @@ -1193,7 +1190,6 @@ It returns -1 if there is no tile. Return transitionList.Count() End '----------------------------------------------------------------------------- -'changes:Docs changed in v1.56 #Rem 'summery:Returns the type of an object. The value of the type of an object can be one of the following ones: @@ -1303,7 +1299,6 @@ The returned value is the stored width multiplied by the X scale factor. Next End '------------------------------------------ -'changes:Changed in v1.56 so it removes an attached animation and an attached tilemap too. 'summery:Removes an object. Method Remove:Void(directFlag:Bool = False) For Local child := Eachin childObjList @@ -1348,7 +1343,7 @@ The returned value is the stored width multiplied by the X scale factor. End '------------------------------------------ -'changes:Changed in v1.55. +'changes:Fixed in v1.58 regarding layer scaling. 'summery:Renders an object. Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) Local txOff:Float @@ -1374,9 +1369,15 @@ The returned value is the stored width multiplied by the X scale factor. Local drawAngle:Float Local _cw:Float Local _ch:Float + Local layerScale:Float + Local mxcl:Float + Local mxcr:Float + Local myct:Float + Local mycb:Float + If deleted = False Then - + layerScale = Self.GetLayer().GetScale() 'Change alpha if needed mAlpha = Self.alpha * Self.layer.alpha If engine.alpha <> mAlpha Then @@ -1399,268 +1400,403 @@ The returned value is the stored width multiplied by the X scale factor. Endif 'If object is flipped, scale it accordingly If Self.isFlipV Then - tempScaleY = Self.scaleY * -1 + 'tempScaleY = Self.scaleY * -1 + tempScaleY = Self.scaleY * -1 * layerScale Else - tempScaleY = Self.scaleY + 'tempScaleY = Self.scaleY + tempScaleY = Self.scaleY * layerScale Endif If Self.isFlipH Then - tempScaleX = Self.scaleX * -1 + 'tempScaleX = Self.scaleX * -1 + tempScaleX = Self.scaleX * -1 * layerScale Else - tempScaleX = Self.scaleX + 'tempScaleX = Self.scaleX + tempScaleX = Self.scaleX * layerScale Endif + px = (Self.hOffX + xPos) * layerScale + xoff + py = (Self.hOffY + yPos) * layerScale + yoff + + mxcl = (Self.maxX * layerScale) + px + mxcr = (Self.minX * layerScale) + px + myct = (Self.maxY * layerScale) + py + mycb = (Self.minY * layerScale) + py + + If type <> ftEngine.otTileMap + 'Draw the object according to its type - Select type - - Case ftEngine.otPivot - ' Draw nothing - - Case ftEngine.otPoint - DrawPoint xPos + xoff, yPos + yoff - - Case ftEngine.otStickMan - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle - Scale (Self.scaleX, Self.scaleY) - DrawCircle (-w*(Self.handleX))+4, (-h*(Self.handleY))+4, 4 ' o Head - DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+6, (-w*(Self.handleX))+4, (-h*(Self.handleY))+25 ' | Body - DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+14, (-w*(Self.handleX))+8, (-h*(Self.handleY))+18 ' \ Arm - DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+25, (-w*(Self.handleX)), (-h*(Self.handleY))+29 ' / Leg - DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+25, (-w*(Self.handleX))+8, (-h*(Self.handleY))+29 ' \ Leg - PopMatrix - - Case ftEngine.otOval - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle - DrawOval -w * (Self.handleX), -h * (Self.handleY), w, h - PopMatrix - - Case ftEngine.otLine - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle+90.0 - DrawLine -w * (Self.handleX), 0, w - (w * Self.handleX), 0 - PopMatrix - - Case ftEngine.otPoly - PushMatrix - Translate ((xPos + xoff), (yPos + yoff)) - Rotate 360.0-angle - Scale (Self.scaleX, Self.scaleY) - DrawPoly (verts) - PopMatrix - - Case ftEngine.otImage - px = Self.hOffX+xPos+xoff - py = Self.hOffY+yPos+yoff - If (maxX+px+w/2.0*scaleX)>=0 And (minX+px-w/2.0*scaleX) <= engine.canvasWidth Then - If (maxY+py+h/2.0*scaleY)>=0 And (minY+py-h/2.0*scaleY) <= engine.canvasHeight Then - DrawImageRect( Self.objImg[Self.currImageIndex-1].img, px, py, rox, roy, rw, rh, 360-angle+offAngle, tempScaleX, tempScaleY, Self.currImageFrame-1) - Endif - Endif - Case ftEngine.otTileMap - _cw = engine.GetCanvasWidth() - _ch = engine.GetCanvasHeight() - tempScaleX = tempScaleX + Self.tileMap.tileModSX - tempScaleY = tempScaleY + Self.tileMap.tileModSY - - tlW = Self.tileMap.tileSizeX * Self.scaleX - tlH = Self.tileMap.tileSizeY * Self.scaleY - tlW2 = tlW/2.0 - tlH2 = tlH/2.0 - drawAngle = 360.0-Self.angle - - 'Determine the first and last x/y coordinate - Local xFirst:Int = 1 - Local xLast:Int = Self.tileMap.tileCountX - Local yFirst:Int = 1 - Local yLast:Int = Self.tileMap.tileCountY - - If Self.tileMap.tiles[0].tileType = 0 - 'Determine the first x coordinates - For ytX = 1 To Self.tileMap.tileCountX - tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX - If (tlxPos+tlW2)>=0 And (tlxPos-tlW2)<=_cw Then - xFirst = ytX - Exit - Endif - Next - - 'Determine the last X coordinates - For ytX = (xFirst+1) To Self.tileMap.tileCountX - tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX - If (tlxPos+tlW2)<0 Or (tlxPos-tlW2)>_cw Then - xLast = ytX-1 - Exit - Endif - Next - - 'Determine the first y coordinates - For ytY = 1 To Self.tileMap.tileCountY - tilePos = (ytY-1)*Self.tileMap.tileCountX - tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - If (tlyPos+tlH2)>=0 And (tlyPos-tlH2)<=_ch Then - yFirst = ytY - Exit - Endif - Next - - 'Determine the last Y coordinates - For ytY = (yFirst+1) To Self.tileMap.tileCountY - tilePos = (ytY-1)*Self.tileMap.tileCountX - tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - If (tlyPos+tlH2)<0 Or (tlyPos-tlH2)>_ch Then - yLast = ytY-1 - Exit - Endif - Next - - Endif - - ' Now draw the map - For ytY = yFirst To yLast - For ytX = xFirst To xLast - tilePos = (ytX-1)+(ytY-1)*Self.tileMap.tileCountX - tileSetIndex = Self.tileMap.tiles[tilePos].tileSetIndex - tileIDx = Self.tileMap.tiles[tilePos].tileID - If tileIDx >= 0 - tileIDx = tileIDx-Self.tileMap.tileSets[tileSetIndex].firstGID+1 - Endif - - If tileIDx <> - 1 Then - 'tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX - tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX + (Self.tileMap.tiles[tilePos].sizeX/2-Self.tileMap.tileSizeX/2) - 'tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - (Self.tileMap.tiles[tilePos].sizeY/2-Self.tileMap.tileSizeY/2) - - 'DrawImageRect( Self.objImg[0].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) - 'DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) -'If dbXXX = 0 -'Print("TilePos="+tilePos+" : tileSetIndex="+tileSetIndex+" : tileIDx="+tileIDx+" : X/Y="+tlxPos+":"+tlyPos+" : w/h="+Self.tileMap.tileSets[tileSetIndex].tilewidth+":"+ Self.tileMap.tileSets[tileSetIndex].tileheight) -'Endif - DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tilewidth-tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tileheight-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) - Endif - Next - Next -'dbXXX = 1 - Case ftEngine.otCircle - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle - DrawCircle -w * (Self.handleX-0.5), -h * (Self.handleY-0.5), radius * Self.scaleX - PopMatrix - - Case ftEngine.otBox - px = Self.hOffX+xPos+xoff - py = Self.hOffY+yPos+yoff - If (maxX+px+w/2.0*scaleX)>=0 And (minX+px-w/2.0*scaleX) <= engine.canvasWidth Then - If (maxY+py+h/2.0*scaleY)>=0 And (minY+py-h/2.0*scaleY) <= engine.canvasHeight Then - + If mxcl>=0 And mxcr <= engine.canvasWidth + If myct>=0 And mycb <= engine.canvasHeight Then + Select type + + Case ftEngine.otPivot + ' Draw nothing + + Case ftEngine.otPoint + 'DrawPoint xPos + xoff, yPos + yoff + DrawPoint xPos*layerScale + xoff, yPos*layerScale + yoff + + Case ftEngine.otStickMan PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate ((xPos*layerScale+xoff), (yPos*layerScale+yoff)) Rotate 360.0-angle - Scale (Self.scaleX, Self.scaleY) - DrawRect -w*Self.handleX, -h*Self.handleY, w, h + 'Scale (Self.scaleX, Self.scaleY) + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + + DrawCircle (-w*(Self.handleX))+4, (-h*(Self.handleY))+4, 4 ' o Head + DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+6, (-w*(Self.handleX))+4, (-h*(Self.handleY))+25 ' | Body + DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+14, (-w*(Self.handleX))+8, (-h*(Self.handleY))+18 ' \ Arm + DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+25, (-w*(Self.handleX)), (-h*(Self.handleY))+29 ' / Leg + DrawLine (-w*(Self.handleX))+4, (-h*(Self.handleY))+25, (-w*(Self.handleX))+8, (-h*(Self.handleY))+29 ' \ Leg + PopMatrix + + Case ftEngine.otOval + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate ((xPos*layerScale+xoff), (yPos*layerScale+yoff)) + Rotate 360.0-angle + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + DrawOval -w * (Self.handleX), -h * (Self.handleY), w, h + PopMatrix + + Case ftEngine.otLine + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate ((xPos*layerScale+xoff), (yPos*layerScale+yoff)) + Rotate 360.0-angle+90.0 + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + DrawLine -w * (Self.handleX), 0, w - (w * Self.handleX), 0 PopMatrix + + Case ftEngine.otPoly + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate ((xPos*layerScale+xoff), (yPos*layerScale+yoff)) + Rotate 360.0-angle + 'Scale (Self.scaleX, Self.scaleY) + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + DrawPoly (verts) + PopMatrix + + Case ftEngine.otImage + 'px = Self.hOffX+xPos+xoff + 'py = Self.hOffY+yPos+yoff + 'If (maxX+px+w/2.0*scaleX)>=0 And (minX+px-w/2.0*scaleX) <= engine.canvasWidth Then + 'If (maxY+py+h/2.0*scaleY)>=0 And (minY+py-h/2.0*scaleY) <= engine.canvasHeight Then + DrawImageRect( Self.objImg[Self.currImageIndex-1].img, px, py, rox, roy, rw, rh, 360-angle+offAngle, tempScaleX, tempScaleY, Self.currImageFrame-1) + 'Endif + 'Endif +#rem + Case ftEngine.otTileMap + _cw = engine.GetCanvasWidth() + _ch = engine.GetCanvasHeight() + 'tempScaleX = tempScaleX + Self.tileMap.tileModSX + tempScaleX = tempScaleX + Self.tileMap.tileModSX * layerScale + 'tempScaleY = tempScaleY + Self.tileMap.tileModSY + tempScaleY = tempScaleY + Self.tileMap.tileModSY * layerScale - Endif - Endif - - Case ftEngine.otText - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle - Scale (Self.scaleX, Self.scaleY) - Select Self.textMode - Case 0 'topLeft - txOff = 0.0 - tyOff = 0.0 - Case 1 'topCenter - txOff = -(Float(Self.objFont.Length(Self.text))/2.0) - tyOff = 0.0 - Case 2 'topRight - txOff = -Self.objFont.Length(Self.text) - tyOff = 0.0 + tlW = Self.tileMap.tileSizeX * Self.scaleX + tlH = Self.tileMap.tileSizeY * Self.scaleY + tlW2 = tlW/2.0 + tlH2 = tlH/2.0 + drawAngle = 360.0-Self.angle - Case 7 'centerLeft - txOff = 0.0 - tyOff = -(Float(Self.objFont.Height())/2.0) - Case 3 'centerCenter - txOff = -(Float(Self.objFont.Length(Self.text))/2.0) - tyOff = -(Float(Self.objFont.Height())/2.0) - Case 4 'centerRight - txOff = -Self.objFont.Length(Self.text) - tyOff = -(Float(Self.objFont.Height())/2.0) + 'Determine the first and last x/y coordinate + Local xFirst:Int = 1 + Local xLast:Int = Self.tileMap.tileCountX + Local yFirst:Int = 1 + Local yLast:Int = Self.tileMap.tileCountY - Case 8 'bottomLeft - txOff = 0.0 - tyOff = -(Float(Self.objFont.Height())) - Case 5 'bottomCenter - txOff = -(Float(Self.objFont.Length(Self.text))/2.0) - tyOff = -(Float(Self.objFont.Height())) - Case 6 'bottomRight - txOff = -Self.objFont.Length(Self.text) - tyOff = -(Float(Self.objFont.Height())) - End - objFont.Draw(text, txOff, tyOff) - PopMatrix - - Case ftEngine.otTextMulti - PushMatrix - Translate ((xPos+xoff), (yPos+yoff)) - Rotate 360.0-angle - Scale (Self.scaleX, Self.scaleY) - Local lines:String[] = Self.text.Split("~n") - Local objFontHeight:Float = Self.objFont.Height() - Local linesCount:Int = lines.Length() - - For _y = 1 To linesCount - - Select Self.textMode - Case 0 'topLeft - txOff = 0.0 - tyOff = 0.0 + (objFontHeight*(_y-1)) + If Self.tileMap.tiles[0].tileType = 0 + 'Determine the first x coordinates + For ytX = 1 To Self.tileMap.tileCountX + tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX + If (tlxPos+tlW2)>=0 And (tlxPos-tlW2)<=_cw Then + xFirst = ytX + Exit + Endif + Next - Case 1 'topCenter - txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) - tyOff = 0.0 + (objFontHeight*(_y-1)) + 'Determine the last X coordinates + For ytX = (xFirst+1) To Self.tileMap.tileCountX + tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX + If (tlxPos+tlW2)<0 Or (tlxPos-tlW2)>_cw Then + xLast = ytX-1 + Exit + Endif + Next - Case 2 'topRight - txOff = -Self.objFont.Length(lines[_y-1]) - tyOff = 0.0 + (objFontHeight*(_y-1)) + 'Determine the first y coordinates + For ytY = 1 To Self.tileMap.tileCountY + tilePos = (ytY-1)*Self.tileMap.tileCountX + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + If (tlyPos+tlH2)>=0 And (tlyPos-tlH2)<=_ch Then + yFirst = ytY + Exit + Endif + Next - Case 7 'centerLeft - txOff = 0.0 - tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) + 'Determine the last Y coordinates + For ytY = (yFirst+1) To Self.tileMap.tileCountY + tilePos = (ytY-1)*Self.tileMap.tileCountX + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + If (tlyPos+tlH2)<0 Or (tlyPos-tlH2)>_ch Then + yLast = ytY-1 + Exit + Endif + Next - Case 3 'centerCenter - txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) - tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) - - Case 4 'centerRight - txOff = -Self.objFont.Length(lines[_y-1]) - tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) + Endif + + ' Now draw the map + For ytY = yFirst To yLast + For ytX = xFirst To xLast + tilePos = (ytX-1)+(ytY-1)*Self.tileMap.tileCountX + tileSetIndex = Self.tileMap.tiles[tilePos].tileSetIndex + tileIDx = Self.tileMap.tiles[tilePos].tileID + If tileIDx >= 0 + tileIDx = tileIDx-Self.tileMap.tileSets[tileSetIndex].firstGID+1 + Endif + + If tileIDx <> - 1 Then + 'tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX + tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX + (Self.tileMap.tiles[tilePos].sizeX/2-Self.tileMap.tileSizeX/2) + 'tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - (Self.tileMap.tiles[tilePos].sizeY/2-Self.tileMap.tileSizeY/2) + + 'DrawImageRect( Self.objImg[0].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + 'DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + 'If dbXXX = 0 + 'Print("TilePos="+tilePos+" : tileSetIndex="+tileSetIndex+" : tileIDx="+tileIDx+" : X/Y="+tlxPos+":"+tlyPos+" : w/h="+Self.tileMap.tileSets[tileSetIndex].tilewidth+":"+ Self.tileMap.tileSets[tileSetIndex].tileheight) + 'Endif + DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tilewidth-tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tileheight-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + Endif + Next + Next + 'dbXXX = 1 +#End + Case ftEngine.otCircle + + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate ((xPos*layerScale+xoff), (yPos*layerScale+yoff)) + Rotate 360.0-angle + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + 'DrawCircle -w * (Self.handleX-0.5), -h * (Self.handleY-0.5), radius * Self.scaleX + DrawCircle -w * (Self.handleX-0.5), -h * (Self.handleY-0.5), radius + PopMatrix + + + Case ftEngine.otBox + 'px = Self.hOffX+xPos+xoff + 'py = Self.hOffY+yPos+yoff + + 'If (maxX+px+w/2.0*scaleX)>=0 And (minX+px-w/2.0*scaleX) <= engine.canvasWidth Then + 'If (maxY+py+h/2.0*scaleY)>=0 And (minY+py-h/2.0*scaleY) <= engine.canvasHeight Then + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate (xPos*layerScale+xoff, yPos*layerScale+yoff) + + Rotate 360.0-angle + + 'Scale (Self.scaleX, Self.scaleY) + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + + DrawRect -w*Self.handleX, -h*Self.handleY, w, h + PopMatrix + 'Endif + 'Endif + + Case ftEngine.otText + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate (xPos*layerScale+xoff, yPos*layerScale+yoff) + Rotate 360.0-angle + 'Scale (Self.scaleX, Self.scaleY) + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + Select Self.textMode + Case 0 'topLeft + txOff = 0.0 + tyOff = 0.0 + Case 1 'topCenter + txOff = -(Float(Self.objFont.Length(Self.text))/2.0) + tyOff = 0.0 + Case 2 'topRight + txOff = -Self.objFont.Length(Self.text) + tyOff = 0.0 + + Case 7 'centerLeft + txOff = 0.0 + tyOff = -(Float(Self.objFont.Height())/2.0) + Case 3 'centerCenter + txOff = -(Float(Self.objFont.Length(Self.text))/2.0) + tyOff = -(Float(Self.objFont.Height())/2.0) + Case 4 'centerRight + txOff = -Self.objFont.Length(Self.text) + tyOff = -(Float(Self.objFont.Height())/2.0) + + Case 8 'bottomLeft + txOff = 0.0 + tyOff = -(Float(Self.objFont.Height())) + Case 5 'bottomCenter + txOff = -(Float(Self.objFont.Length(Self.text))/2.0) + tyOff = -(Float(Self.objFont.Height())) + Case 6 'bottomRight + txOff = -Self.objFont.Length(Self.text) + tyOff = -(Float(Self.objFont.Height())) + End + objFont.Draw(text, txOff, tyOff) + PopMatrix + + Case ftEngine.otTextMulti + PushMatrix + 'Translate ((xPos+xoff), (yPos+yoff)) + Translate (xPos*layerScale+xoff, yPos*layerScale+yoff) + Rotate 360.0-angle + 'Scale (Self.scaleX, Self.scaleY) + Scale (Self.scaleX*layerScale, Self.scaleY*layerScale) + Local lines:String[] = Self.text.Split("~n") + Local objFontHeight:Float = Self.objFont.Height() + Local linesCount:Int = lines.Length() + + For _y = 1 To linesCount + + Select Self.textMode + Case 0 'topLeft + txOff = 0.0 + tyOff = 0.0 + (objFontHeight*(_y-1)) + + Case 1 'topCenter + txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) + tyOff = 0.0 + (objFontHeight*(_y-1)) + + Case 2 'topRight + txOff = -Self.objFont.Length(lines[_y-1]) + tyOff = 0.0 + (objFontHeight*(_y-1)) + + Case 7 'centerLeft + txOff = 0.0 + tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) + + Case 3 'centerCenter + txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) + tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) + + Case 4 'centerRight + txOff = -Self.objFont.Length(lines[_y-1]) + tyOff = -((objFontHeight*linesCount)/2.0) + (objFontHeight*(_y-1)) + + Case 8 'bottomLeft + txOff = 0.0 + tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + + Case 5 'bottomCenter + txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) + tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + + Case 6 'bottomRight + txOff = -Self.objFont.Length(lines[_y-1]) + tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + + End + objFont.Draw(lines[_y-1], txOff, tyOff) + Next + PopMatrix + End + Endif + Endif + Else + _cw = engine.GetCanvasWidth() + _ch = engine.GetCanvasHeight() + 'tempScaleX = tempScaleX + Self.tileMap.tileModSX + tempScaleX = tempScaleX + Self.tileMap.tileModSX * layerScale + 'tempScaleY = tempScaleY + Self.tileMap.tileModSY + tempScaleY = tempScaleY + Self.tileMap.tileModSY * layerScale + + tlW = Self.tileMap.tileSizeX * Self.scaleX + tlH = Self.tileMap.tileSizeY * Self.scaleY + tlW2 = tlW/2.0 + tlH2 = tlH/2.0 + drawAngle = 360.0-Self.angle + + 'Determine the first and last x/y coordinate + Local xFirst:Int = 1 + Local xLast:Int = Self.tileMap.tileCountX + Local yFirst:Int = 1 + Local yLast:Int = Self.tileMap.tileCountY + + If Self.tileMap.tiles[0].tileType = 0 + 'Determine the first x coordinates + For ytX = 1 To Self.tileMap.tileCountX + tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX + If (tlxPos+tlW2)>=0 And (tlxPos-tlW2)<=_cw Then + xFirst = ytX + Exit + Endif + Next - Case 8 'bottomLeft - txOff = 0.0 - tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + 'Determine the last X coordinates + For ytX = (xFirst+1) To Self.tileMap.tileCountX + tlxPos = xoff+xPos+Self.tileMap.tiles[ytX-1].xOff * Self.scaleX + If (tlxPos+tlW2)<0 Or (tlxPos-tlW2)>_cw Then + xLast = ytX-1 + Exit + Endif + Next - Case 5 'bottomCenter - txOff = -(Float(Self.objFont.Length(lines[_y-1]))/2.0) - tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + 'Determine the first y coordinates + For ytY = 1 To Self.tileMap.tileCountY + tilePos = (ytY-1)*Self.tileMap.tileCountX + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + If (tlyPos+tlH2)>=0 And (tlyPos-tlH2)<=_ch Then + yFirst = ytY + Exit + Endif + Next - Case 6 'bottomRight - txOff = -Self.objFont.Length(lines[_y-1]) - tyOff = -(objFontHeight*linesCount) + (objFontHeight*(_y-1)) + 'Determine the last Y coordinates + For ytY = (yFirst+1) To Self.tileMap.tileCountY + tilePos = (ytY-1)*Self.tileMap.tileCountX + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + If (tlyPos+tlH2)<0 Or (tlyPos-tlH2)>_ch Then + yLast = ytY-1 + Exit + Endif + Next - End - objFont.Draw(lines[_y-1], txOff, tyOff) - Next - PopMatrix - End - + Endif + + ' Now draw the map + For ytY = yFirst To yLast + For ytX = xFirst To xLast + tilePos = (ytX-1)+(ytY-1)*Self.tileMap.tileCountX + tileSetIndex = Self.tileMap.tiles[tilePos].tileSetIndex + tileIDx = Self.tileMap.tiles[tilePos].tileID + If tileIDx >= 0 + tileIDx = tileIDx-Self.tileMap.tileSets[tileSetIndex].firstGID+1 + Endif + + If tileIDx <> - 1 Then + 'tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX + tlxPos = xoff+xPos+Self.tileMap.tiles[tilePos].xOff * Self.scaleX + (Self.tileMap.tiles[tilePos].sizeX/2-Self.tileMap.tileSizeX/2) + 'tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY + tlyPos = yoff+yPos+Self.tileMap.tiles[tilePos].yOff * Self.scaleY - (Self.tileMap.tiles[tilePos].sizeY/2-Self.tileMap.tileSizeY/2) + + 'DrawImageRect( Self.objImg[0].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + 'DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, rw-tileMap.tileSpacing, rh-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + 'If dbXXX = 0 + 'Print("TilePos="+tilePos+" : tileSetIndex="+tileSetIndex+" : tileIDx="+tileIDx+" : X/Y="+tlxPos+":"+tlyPos+" : w/h="+Self.tileMap.tileSets[tileSetIndex].tilewidth+":"+ Self.tileMap.tileSets[tileSetIndex].tileheight) + 'Endif + DrawImageRect( Self.objImg[tileSetIndex].img, tlxPos, tlyPos, tileMap.tileSpacing, tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tilewidth-tileMap.tileSpacing, Self.tileMap.tileSets[tileSetIndex].tileheight-tileMap.tileSpacing, drawAngle, tempScaleX, tempScaleY, tileIDx) + Endif + Next + Next + 'dbXXX = 1 + + Endif + + If Self.onRenderEvent = True Then engine.OnObjectRender(Self) For Local child := Eachin childObjList If child.isVisible And child.isActive Then child.Render(xoff, yoff) @@ -1684,10 +1820,16 @@ The returned value is the stored width multiplied by the X scale factor. Next End '----------------------------------------------------------------------------- +'changes:Changed in v1.58 -> Added a flag to affect children too. 'summery:Set the active flag. 'seeAlso:GetActive - Method SetActive:Void (activeFlag:Bool = True ) + Method SetActive:Void (activeFlag:Bool = True, children:Bool = False ) isActive = activeFlag + If children = True + For Local child := Eachin childObjList + child.SetActive(activeFlag, children) + Next + Endif End '----------------------------------------------------------------------------- 'summery:Set the current active animation. @@ -1728,7 +1870,6 @@ The returned value is the stored width multiplied by the X scale factor. internal_RotateSpriteCol() End '------------------------------------------ -'changes:Changed in version 1.54. #Rem 'summery:Set the objects angle offset manually. Normally it is set from loading an image from a sprite atlas where the image is already rotated. @@ -1766,7 +1907,6 @@ Normally it is set from loading an image from a sprite atlas where the image is Self.animMng.isAnimPaused = pauseFlag End '----------------------------------------------------------------------------- -'changes:New in version 1.54. #Rem 'summery:Set the repeat count of the current animation. 'The default value of -1 means it runs forever. A value greater than 0 describes how many times the animation repeats itself. @@ -1828,7 +1968,6 @@ A value of 0 will disable the collision, a value between 1 and 32 will set the c Self.blue = cBlue End '----------------------------------------------------------------------------- -'changes:Fixed in v1.54 #Rem 'summery:Sets the collision scale factor of an object. 'The collision scale affects the calculation of the collision type objects (circle, bounding box, rotated box) @@ -2583,7 +2722,6 @@ The stored width is the result of the given parameter divided by the current X s End '----------------------------------------------------------------------------- '#DOCOFF# -'changes:Fixed in version 1.57 Method _Init:ftObject() xPos = 0.0 yPos = 0.0 @@ -2715,16 +2853,15 @@ The stored width is the result of the given parameter divided by the current X s currImageIndex = 1 currImageFrame = 1 - minX = 0.0 - minY = 0.0 - maxX = 0.0 - maxY = 0.0 + Self.minX = 0.0 + Self.minY = 0.0 + Self.maxX = 0.0 + Self.maxY = 0.0 Return Self End '#DOCON# '------------------------------------------ -'changes:Changed in v1.54 'summery:Update an object with the given updatespeed factor. Method Update:Void(delta:Float=1.0) @@ -3003,7 +3140,6 @@ Local yp:Float End '----------------------------------------------------------------------------- - 'changes:Changed in v1.54 Method internal_Circle2CircleInBox:Bool(sp1:ftObject, sp2:ftObject) Local xf:Float, yf:Float, rf:Float @@ -3020,7 +3156,6 @@ Local yp:Float End '----------------------------------------------------------------------------- -'changes:Changed in v1.54 Method internal_Circle2LineObj:Bool(sp1:ftObject, sp2:ftObject) Local rf:Float Local bp1:tPointS = New tPointS @@ -3047,7 +3182,6 @@ Local yp:Float End '----------------------------------------------------------------------------- -'changes:Changed in v1.54 Method internal_Bound2Bound:Bool(sp1:ftObject, sp2:ftObject) Local left1:Float, left2:Float, right1:Float, right2:Float, top1:Float, top2:Float, bottom1:Float, bottom2:Float, h:Float, w:Float @@ -3085,7 +3219,6 @@ Local yp:Float Return True End '----------------------------------------------------------------------------- -'changes:Fixed in v1.54 Method internal_Box2Box:Bool(pSpriteA:ftObject, pSpriteB:ftObject) ' -- Corner points Local ap1:tPointS = New tPointS @@ -3245,7 +3378,6 @@ Local yp:Float Return False End '----------------------------------------------------------------------------- -'changes:Fixed in v1.54 Method internal_Box2Circle:Bool(sp2:ftObject, sp1:ftObject) Local rf:Float Local bp1:tPointS = New tPointS @@ -3283,7 +3415,6 @@ Local yp:Float '----------------------------------------------------------------------------- -'changes:New in v1.54 'Adapted from Fredborg's code Method internal_Line2Line( x0:Float, y0:Float , x1:Float, y1:Float,x2:Float ,y2:Float, x3:Float, y3:Float ) @@ -3317,7 +3448,6 @@ Local yp:Float End '----------------------------------------------------------------------------- -'changes:Changed in v1.54 Method internal_Line2Circle:Bool(x1:Float, y1:Float, x2:Float, y2:Float, px:Float, py:Float, r:Float) Local sx:Float Local sy:Float @@ -3423,7 +3553,6 @@ Local yp:Float End '----------------------------------------------------------------------------- - 'changes:Changed in v1.56 Method internal_PointInsideBound:Bool(sp:ftObject, px:Float, py:Float) Local t:Float, b:Float, l:Float, r:Float, hys:Float, wxs:Float wxs = sp.w * sp.scaleX * sp.collScale @@ -3447,7 +3576,6 @@ Local yp:Float Return True End '----------------------------------------------------------------------------- -'changes:Changed in v1.56 Method internal_PointInsideCircle:Bool(_sp:ftObject, _px:Float, _py:Float) Local xf:Float Local yf:Float @@ -3496,7 +3624,6 @@ Local yp:Float End #End '----------------------------------------------------------------------------- - 'changes:Fixed in v1.56 Method internal_PointInsidePolygon:Bool(sp:ftObject, px:Float, py:Float) 'Local iangle:Float 'Local x1:Float,x3:Float,y1:Float,y3:Float @@ -3557,7 +3684,6 @@ Local yp:Float '***************************************************************** -'changes:Fixed in v1.54 Method internal_RotateSpriteCol:Void() '***************************************************************** Local cx:Float @@ -3616,7 +3742,6 @@ Local yp:Float #Rem '***************************************************************** -'changes:Fixed in v1.54 Method internal_RotateSpriteCol_OLD:Int(pSprite:ftObject) '***************************************************************** Local cx:Float diff --git a/cftScene.monkey b/cftScene.monkey index ef9edb5..c468af9 100755 --- a/cftScene.monkey +++ b/cftScene.monkey @@ -42,7 +42,6 @@ Class ftScene layerList.AddLast(layer) End '----------------------------------------------------------------------------- -'changes:fixed in v1.54 #Rem 'summery:Create an alpha transition for the scene. 'The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the [b]ftEngine.OnLayerTrans[/b] method for the first layer of a scene. @@ -63,7 +62,6 @@ Class ftScene Return trans End '----------------------------------------------------------------------------- -'changes:fixed in v1.54 #Rem 'summery:Create an position transition for the scene. 'The duration is the time in milliseconds, the transition takes to complete. Only a transID > 0 will fire the [b]ftEngine.OnLayerTrans[/b] method for the first layer of a scene. diff --git a/cftSpriteAtlas.monkey b/cftSpriteAtlas.monkey index 2cacbba..09fd4c8 100755 --- a/cftSpriteAtlas.monkey +++ b/cftSpriteAtlas.monkey @@ -46,7 +46,6 @@ Class ftSpriteAtlas Next End '------------------------------------------ -'changes:Fixed in v1.54 to take account of rotated images Method _Parse:Void() Local s:String Local tpasLen:Int @@ -122,7 +121,6 @@ Class ftSpriteAtlas Return img End '------------------------------------------ -'changes:New in v1.55 'summery:Returns the height of the subimage with the given name. Method GetImageHeight:Float(imageName:String) Local retVal:Float = 0.0 @@ -133,7 +131,6 @@ Class ftSpriteAtlas Return retVal End '------------------------------------------ -'changes:New in v1.55 'summery:Returns the width of the subimage with the given name. Method GetImageWidth:Float(imageName:String) Local retVal:Float = 0.0 @@ -167,7 +164,6 @@ Class ftSpriteAtlas Return 0 End '------------------------------------------ -'changes:Fixed in version 1.54 to support LINUX lines delimiters (13,10) 'summery:Loads a sprite atlas from the given image and data file name. Method Load:Void(imgName:String, dataName:String) tpStringFromFile = LoadString(dataName) diff --git a/cftTileMap.monkey b/cftTileMap.monkey index 6b6dc1b..ae25e20 100755 --- a/cftTileMap.monkey +++ b/cftTileMap.monkey @@ -259,7 +259,6 @@ Class ftTileMap End '#DOCOFF# 'bitofgold changes: -'changes:Changed in v1.54 '----------------------------------------------------------------------------- 'summary:Returns the tile index at the given canvas coordinates, starting from zero. 'even higher performance, only divisions @@ -453,7 +452,6 @@ It returns -1 if there is no tile. '#DOCOFF# 'bitofgold changes: '----------------------------------------------------------------------------- -'changes:Changed in v1.54 'summary: Returns the ID of the tiles texture, at the given canvas coordinates, starting from zero. 'It returns -1 If there is no tile. 'even higher performance, only divisions @@ -486,7 +484,6 @@ It returns -1 if there is no tile. Return Self.tiles[index].sizeY * obj.scaleY End '----------------------------------------------------------------------------- -'changes:New in v1.56 'summery:Returns the tileSetIndex of a given tile ID Method GetTileSetIndex:Int(tileID:Int) Local retVal:Int = -1 @@ -498,7 +495,6 @@ It returns -1 if there is no tile. Return retVal End '----------------------------------------------------------------------------- -'changes:Fixed in v1.57 'summery:Removes the tilemap from the corresponding ftObject. Method Remove:Void() 'tiles.Resize(0) @@ -534,7 +530,6 @@ It returns -1 if there is no tile. '#DOCOFF# 'bitofgold changed function '----------------------------------------------------------------------------- -'changed in version 1.54 'Summary:Sets the ID of the tiles texture, at the given canvas coordinates, starting from zero. Method SetTileIDAt_NEW:Void(xp:Int,yp:Int, id:Int=-1) Local tilePos:Int = GetTileAt(xp,yp) @@ -557,7 +552,6 @@ It returns -1 if there is no tile. '#DOCOFF# 'start of bitofgold changes: -'changes:New in v1.54 'bitofgold new function: '----------------------------------------------------------------------------- 'summary: converts world coordinates to tile coordinates. Use Floor() to get integer tile position values from zero! (eg. returns 0.5 at half of first tile) diff --git a/cftVec2D.monkey b/cftVec2D.monkey index 9d260a0..a8639ee 100755 --- a/cftVec2D.monkey +++ b/cftVec2D.monkey @@ -157,7 +157,6 @@ Class ftVec2D End '------------------------------------------ -'changes:New in v1.54 Method Perp:Void() Local xt:Float = Self.x diff --git a/cftWaypoints.monkey b/cftWaypoints.monkey index d409027..48b7969 100755 --- a/cftWaypoints.monkey +++ b/cftWaypoints.monkey @@ -342,7 +342,6 @@ Class ftPath End '------------------------------------------ -'changes:Fixed in version 1.55 #Rem 'summery:Render all markers of a path. You can use this for debugging. A type value of 0 renders a square, any other value renders a circle. @@ -359,7 +358,6 @@ A type value of 0 renders a square, any other value renders a circle. End '------------------------------------------ -'changes:Fixed in version 1.55 #Rem 'summery:Render all waypoints of a path. You can use this for debugging. A type value of 0 renders a square, any other value renders a circle. diff --git a/docs/3rdpartytools.html b/docs/3rdpartytools.html index 295d0e3..f5e944f 100644 --- a/docs/3rdpartytools.html +++ b/docs/3rdpartytools.html @@ -8,5 +8,5 @@ 3rdpartytools.html -


3rd party tools


fantomEngine supports file formats of various 3rd party tools wich can create bitmap fonts, sprite sheets and tile maps.

Bitmap fonts

To create bitmap fonts for fantomEngine you can use these tools:

* Hiero *

Hiero is a Java web app and is freely available. The original software is available here:

http://slick.cokeandcode.com/demos/hiero.jnlp (freeware, Java web app)

If that is not working for you, try this link:

http://www.n4te.com/hiero/hiero.jnlp

I found this version in this forum post: http://www.cocos2d-iphone.org/forum/topic/220/page/2

With Hiero, rename the .fnt file to .txt and flip the bitmap file vertically as it is exported from Hiero upside down.

* SpriteFont *

http://www.spritefont.altervista.org (commercial, OSX and Windows, Ubuntu)

* Glyph Designer *

http://www.71squared.com/en/glyphdesigner (commercial, OSX only)
https://71squared.com/gdx (commercial, Windows only)

With GlyphDesigner, save the font as a EZGUI (.txt) file.

* TWL font editor *

Users have reported, that the font editor from TWL can be used too. You can get it here:

http://l33tlabs.org/

* FontMachine *

JungleIDE users can create bitmap fonts via FontMachine and use these in fantomEngine. It has to be a packed font:

http://www.jungleide.com/?page_id=5179

Tile maps

If you need to create tile maps, fantomEngine supports Tiled, a very good tile map editor. You can get it here:

http://www.mapeditor.org (freeware, OSX and Windows)

Export the map as a JSON (.json) file.

Sprite sheets / Texture atlas

To create a sprite sheet, that fantomEngine can use automatically, use TexturePacker. You can get it here:

http://www.codeandweb.com/texturepacker (commercial, OSX and Windows, Ubuntu)

Or on Windows, the free tool MakeAtlas can be used too:

http://www.monkeycoder.co.nz/Community/posts.php?topic=5088 (freeware, Windows)

Export the sprite sheet in the LibGDX or Sparrow file format.

Box2D physic shapes

To create physic shapes, that fantomEngine can use automatically, use PhysicsEditor. You can get it here:

http://www.codeandweb.com/physicseditor (commercial, OSX and Windows)

Export the shapes with the custom fantomEngine export plugin (JSON format) that ships with fE.


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.


+


3rd party tools


fantomEngine supports file formats of various 3rd party tools wich can create bitmap fonts, sprite sheets and tile maps.

Bitmap fonts

To create bitmap fonts for fantomEngine you can use these tools:

* Hiero *

Hiero is a Java web app and is freely available. The original software is available here:

http://slick.cokeandcode.com/demos/hiero.jnlp (freeware, Java web app)

If that is not working for you, try this link:

http://www.n4te.com/hiero/hiero.jnlp

I found this version in this forum post: http://www.cocos2d-iphone.org/forum/topic/220/page/2

With Hiero, rename the .fnt file to .txt and flip the bitmap file vertically as it is exported from Hiero upside down.

* SpriteFont *

http://www.spritefont.altervista.org (commercial, OSX and Windows, Ubuntu)

* Glyph Designer *

http://www.71squared.com/en/glyphdesigner (commercial, OSX only)
https://71squared.com/gdx (commercial, Windows only)

With GlyphDesigner, save the font as a EZGUI (.txt) file.

* TWL font editor *

Users have reported, that the font editor from TWL can be used too. You can get it here:

http://l33tlabs.org/

* FontMachine *

JungleIDE users can create bitmap fonts via FontMachine and use these in fantomEngine. It has to be a packed font:

http://www.jungleide.com/?page_id=5179

Tile maps

If you need to create tile maps, fantomEngine supports Tiled, a very good tile map editor. You can get it here:

http://www.mapeditor.org (freeware, OSX and Windows)

Export the map as a JSON (.json) file.

Sprite sheets / Texture atlas

To create a sprite sheet, that fantomEngine can use automatically, use TexturePacker. You can get it here:

http://www.codeandweb.com/texturepacker (commercial, OSX and Windows, Ubuntu)

Or on Windows, the free tool MakeAtlas can be used too:

http://www.monkeycoder.co.nz/Community/posts.php?topic=5088 (freeware, Windows)

Export the sprite sheet in the LibGDX or Sparrow file format.

Box2D physic shapes

To create physic shapes, that fantomEngine can use automatically, use PhysicsEditor. You can get it here:

http://www.codeandweb.com/physicseditor (commercial, OSX and Windows)

Export the shapes with the custom fantomEngine export plugin (JSON format) that ships with fE.


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/cftAStar.monkey.html b/docs/cftAStar.monkey.html index 0afc4c8..a922319 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) )
  • 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() )
  • 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() )
  • GetScaleY   ( Method GetScaleY:Float() )
  • 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) )
  • SetPos   ( Method SetPos:Void(y:Float, relative:Bool = False) )
  • SetPosX   ( Method SetPosX:Void(x:Float, relative:Bool = False) )
  • SetScale   ( Method SetScale:Void(x:Float, y:Float, relative:Bool = False) )

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)
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 ()
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 ()
Description:Returns the X scale factor of the grid.
Return type:Float
Method GetScaleY:Float()

Syntax:


Float = ftAStar.GetScaleY ()
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)
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)
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)
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)
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) )

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)
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 53ceaba..cc813cb 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 fa607e4..f7729f4 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
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) )
  • CreateAnimImage   ( Method CreateAnimImage:ftObject(atl:Image, frameStartX:Int, frameStartY:Int, frameWidth:Int, frameHeight:Int, frameCount:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateBox   ( Method CreateBox:ftObject(width:Float, height:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateCircle   ( Method CreateCircle:ftObject(radius:Float, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateGUI   ( Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0) )
  • CreateImage   ( Method CreateImage:ftObject(filename:String, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateImage   ( Method CreateImage:ftObject(image:Image, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, x:Int, y:Int, width:Int, height:Int, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateImage   ( Method CreateImage:ftObject(atlas:Image, dataFileName:String, subImageName:String, xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateLayer   ( Method CreateLayer:ftLayer(_ucla:Object=Null) )
  • CreateLine   ( Method CreateLine:ftObject(xpos:Float, ypos:Float, x2:Float, y2:Float, _ucob:Object=Null) )
  • 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) )
  • CreatePath   ( Method CreatePath:ftPath(xpos:Float, ypos:Float ) )
  • CreatePivot   ( Method CreatePivot:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreatePoint   ( Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreatePoly   ( Method CreatePoly:ftObject(verts:Float[], xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateScene   ( Method CreateScene:ftScene(_ucSc:Object=Null) )
  • CreateSpriteAtlas   ( Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string) )
  • CreateStickMan   ( Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null) )
  • CreateText   ( Method CreateText:ftObject(font:ftFont, txt:String, xpos:Float, ypos:Float, textmode:Int=ftEngine.taTopLeft, _ucob:Object=Null) )
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:ftImage, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )
  • CreateTileMap   ( Method CreateTileMap:ftObject(atl:Image, tileSizeX:Int, tileSizeY:Int, tileCountX:Int, tileCountY:Int, xpos:Float, ypos:Float ) )
  • CreateTileMap   ( Method CreateTileMap:ftObject(filename:String, xpos:Float, ypos:Float, layerIndex:Int=1 ) )
  • 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[] () )
  • GetCamX   ( Method GetCamX:Float () )
  • GetCamY   ( Method GetCamY:Float () )
  • 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) )
  • GetLocalXY   ( Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True) )
  • GetLocalY   ( Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True) )
  • 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) )
  • GetWorldXY   ( Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True) )
  • GetWorldY   ( Method GetWorldY:Float(localYPos:Float, withCam:Bool = True) )
  • LoadFont   ( Method LoadFont:ftFont(filename:String) )
  • LoadImage   ( Method LoadImage:Image(path:String, frameCount:Int=1, flags:Int=Image.MidHandle) )
  • LoadImage   ( Method LoadImage:Image(path:String, frameWidth:Int, frameHeight:Int, frameCount:Int, flags:Int=Image.MidHandle) )
  • LoadMusic   ( Method LoadMusic:ftSound(filename:String, loopFlag:Bool=False) )
  • LoadSound   ( Method LoadSound:ftSound(filename:String, loopFlag:Bool=False) )
  • New   ( Method New() )
  • 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) )
  • 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) )
  • 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)
See also:ActivateSound
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)
See also:ActivateMusic
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)
See also:SwipeUpdate
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
See also:GetDeltaTime , Update
Method CancelTimerAll:Void()

Syntax:


ftEngine.CancelTimerAll ()
Description:Cancels all timers attached of the engine.
See also:CreateTimer , OnTimer
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
See also:SetColType , SetColWith , SetColGroup , OnObjectCollision
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
See also:SetColType , SetColWith , SetColGroup , OnObjectCollision
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
See also:SetColType , SetColWith , SetColGroup , OnObjectCollision
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)
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
See also:CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateAnimImage , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateAnimImage , CreateBox , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
Method CreateGUI:ftGuiMng(xpos:Float=0.0, ypos:Float=0.0)

Syntax:


ftGuiMng = ftEngine.CreateGUI (xpos:Float=0.0, ypos:Float=0.0)
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
See also:...
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)
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
See also:CreateAnimImage , CreateBox , CreateCircle , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateAnimImage , CreateBox , CreateCircle , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateAnimImage , CreateBox , CreateCircle , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
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
See also:CreateAnimImage , CreateBox , CreateCircle , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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()
See also:SetDefaultLayer , GetDefaultLayer , RemoveLayer , RemoveAllLayer
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)
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
+
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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
+
See also:OnObjTimer , CreateTimer
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)
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()
+
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
Description:Creates an empty object (pivot) which you can use to attach/parent child objects to.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
See also:CreateAnimImage , CreateBox , CreateCircle , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap , CreateText
Method CreatePoint:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreatePoint (xpos:Float, ypos:Float, _ucob:Object=Null)
Description:Creates a point object at the given xpos/ypos.
Return type:ftObject
Parameters:
NameTypeValue
xposFloat
yposFloat
_ucobObjectNull
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoly , CreateStickman , CreateTileMap , CreateText
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)
Description:Creates a polygon object with supplied vertices pairs (Minimum of 3 pairs required).
Return type:ftObject
Parameters:
NameTypeValue
vertsFloat[]
xposFloat
yposFloat
_ucobObjectNull
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreateStickman , CreateTileMap , CreateText
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.
See also:GetDefaultScene , SetDefaultScene , RemoveScene , RemoveAllScenes
Method CreateSpriteAtlas:ftSpriteAtlas(imgfileName:String, dataFileName:string)

Syntax:


ftSpriteAtlas = ftEngine.CreateSpriteAtlas (imgfileName:String, dataFileName:string)
Description:Creates/loads a sprite atlas.
Return type:ftSpriteAtlas
Parameters:
NameTypeValue
imgfileNameString
dataFileNamestring
See also:CreateImage , CreateAnimImage
Method CreateStickMan:ftObject(xpos:Float, ypos:Float, _ucob:Object=Null)

Syntax:


ftObject = ftEngine.CreateStickMan (xpos:Float, ypos:Float, _ucob:Object=Null)
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
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateTileMap , CreateText
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)
Description:Creates a new text object.
Return type:ftObject
Parameters:
NameTypeValue
fontftFont
txtString
xposFloat
yposFloat
textmodeIntftEngine.taTopLeft
_ucobObjectNull
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateTileMap
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)
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlftImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateText
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)
Description:Create a tile map which you can fill yourself.
Return type:ftObject
Parameters:
NameTypeValue
atlImage
tileSizeXInt
tileSizeYInt
tileCountXInt
tileCountYInt
xposFloat
yposFloat
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateText
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)
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.
See also:CreateAnimImage , CreateBox , CreateCircle , CreateImage , CreateLine , CreateOval , CreatePoint , CreatePoly , CreateStickman , CreateText
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.
See also:OnTimer , CreateObjTimer
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
See also:CreateZoneCircle , CollisionCheck , TouchCheck
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
See also:CreateZoneBox , CollisionCheck , TouchCheck
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
See also:GetAccelZ , GetAccelXY , GetAccelY
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
See also:GetAccelX , GetAccelY , GetAccelZ
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.
See also:GetAccelX , GetAccelXY , 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.
See also:GetAccelX , GetAccelXY , GetAccelY
Method GetCam:Float[] ()

Syntax:


Float[] = ftEngine.GetCam ()
Description:Returns the cameras X and Y coordinate.
Return type:Float[]
See also:GetCamX , GetCamY , SetCam , SetCamX , SetCamY
Method GetCamX:Float ()

Syntax:


Float = ftEngine.GetCamX ()
Description:Returns the cameras X coordinate.
Return type:Float
See also:GetCam , GetCamY , SetCam , SetCamX , SetCamY
Method GetCamY:Float ()

Syntax:


Float = ftEngine.GetCamY ()
Description:Returns the cameras Y coordinate.
Return type:Float
See also:GetCam , GetCamX , SetCam , SetCamX , SetCamY
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()
See also:SetCanvasSize , GetCanvasWidth
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()
See also:SetCanvasSize , GetCanvasHeight
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()
See also:SetDefaultLayer , CreateLayer , RemoveLayer
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.
See also:SetDefaultScene , CreateScene , RemoveScene
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
See also:CalcDeltaTime , Update
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)
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
See also:GetLocalXY , GetLocalY , GetWorldX , GetWorldXY , GetWorldY
Method GetLocalXY:Float[](wordXPos:Float, wordYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetLocalXY (wordXPos:Float, wordYPos:Float, withCam:Bool = True)
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
See also:GetLocalX , GetLocalY , GetWorldX , GetWorldXY , GetWorldY
Method GetLocalY:Float(wordYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetLocalY (wordYPos:Float, withCam:Bool = True)
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
See also:GetLocalX , GetLocalXY , GetWorldX , GetWorldXY , GetWorldY
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
See also:SetPaused
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
See also:GetScaleY , SetCanvasSize
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.
See also:GetScaleX , SetCanvasSize
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
See also:SetTimeScale , Update
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
See also:GetTouchY , GetTouchXY
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.
See also:GetTouchX , GetTouchY
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.
See also:GetTouchX , GetTouchXY
Method GetVolumeMUS:Float()

Syntax:


Float = ftEngine.GetVolumeMUS ()
Description:Returns the general volume of music. Ranges from 0.0 to 1.0.
Return type:Float
See also:SetVolumeMUS , GetVolumeSFX
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
See also:SetVolumeSFX , GetVolumeMUS
Method GetWorldX:Float(localXPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldX (localXPos:Float, withCam:Bool = True)
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
See also:GetLocalX , GetLocalXY , GetLocalY , GetWorldXY , GetWorldY
Method GetWorldXY:Float[](localXPos:Float, localYPos:Float, withCam:Bool = True)

Syntax:


Float[] = ftEngine.GetWorldXY (localXPos:Float, localYPos:Float, withCam:Bool = True)
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
See also:GetLocalX , GetLocalXY , GetLocalY , GetWorldX , GetWorldY
Method GetWorldY:Float(localYPos:Float, withCam:Bool = True)

Syntax:


Float = ftEngine.GetWorldY (localYPos:Float, withCam:Bool = True)
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
See also:GetLocalX , GetLocalXY , GetLocalY , GetWorldX , GetWorldXY
Method LoadFont:ftFont(filename:String)

Syntax:


ftFont = ftEngine.LoadFont (filename:String)
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)
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)
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 ()
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
See also:Update
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)
Description:This method is called when an animation of an object (obj) has finished one loop.
Return type:Int
Parameters:
NameTypeValue
objftObject
See also:Update
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
See also:CollisionCheck
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.
See also:RemoveAllObjects
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
See also:Render , RestoreAlpha , RestoreBlendmode , RestoreColor , OnObjectRender
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
+
See also:SortObjects
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
See also:CreateObjTimer
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
See also:TouchCheck
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
See also:Update
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
See also:SwipeUpdate
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
See also:CreateTimer
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.
See also:CreateLayer , SetDefaultLayer , RemoveLayer
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.
See also:CreateScene , SetDefaultScene , RemoveScene
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)
See also:CreateLayer , SetDefaultLayer , RemoveAllLayer
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.
See also:CreateScene , SetDefaultScene , RemoveAllScenes
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
See also:OnObjectRender
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
See also:OnObjectRender
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.
See also:RestoreBlendmode , RestoreColor , OnObjectRender
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.
See also:RestoreAlpha , RestoreColor , OnObjectRender
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.
See also:RestoreAlpha , RestoreBlendmode , OnObjectRender
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
See also:SetCamX , SetCamY , GetCam , GetCamX , GetCamY
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
See also:SetCam , SetCamY , GetCam , GetCamX , GetCamY
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
See also:SetCam , SetCamX , GetCam , GetCamX , GetCamY
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
See also:GetCanvasWidth , GetCanvasHeight
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)
See also:SetDefaultVisible
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)
See also:CreateLayer , RemoveLayer , GetDefaultLayer
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.
See also:CreateScene , RemoveScene , 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)
See also:SetDefaultActive
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
See also:SetMaxSoundChannel
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.
See also:SetFirstSoundChannel
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.
See also:GetPaused
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
See also:SetSwipeSnap
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
See also:SetSwipeDeadDist
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.
See also:GetTimeScale , Update
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
See also:SetVolumeSFX
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
See also:SetVolumeMUS
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.
See also:OnObjectSort
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.
See also:OnObjectSort
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.
See also:OnSwipeDone
Method TouchCheck:Void(touchID:Int=0)

Syntax:


ftEngine.TouchCheck (touchID:Int=0)
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.
See also:OnObjectTouch
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.
See also:OnObjectTouch
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
See also:SetDefaultActive , SetTimeScale , OnLayerUpdate , OnObjectUpdate
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
See also:SetDefaultActive , SetTimeScale , OnLayerUpdate , OnObjectUpdate
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 c9d71c5..44c6d52 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:

  • ftFont   Added fontMachine support in version 1.54

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
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
See also:Height
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
See also:Length
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 d8ec178..11e6f2b 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:

  • GetBrowserName   ( Function GetBrowserName:String() )
  • GetBrowserPlatform   ( Function GetBrowserPlatform:String() )
  • GetBrowserVersion   ( Function GetBrowserVersion:String() )
  • GetDeviceName   ( Function GetDeviceName:String() )
  • GetHardware   ( Function GetHardware:String() )
  • GetLanguage   ( Function GetLanguage:String() )
  • GetProduct   ( Function GetProduct:String() )
  • GetSerial   ( Function GetSerial:String() )
  • GetUser   ( Function GetUser:String() )
  • HideConsole   ( Function HideConsole:Void() )   Changed help text in v1.54.
  • IsMobileBrowser   ( Function IsMobileBrowser:Bool() )
  • MaximizeCanvas   ( Function MaximizeCanvas:Void() )   Changed help text in v1.54.
  • ResizeCanvas   ( Function ResizeCanvas:Void(x:Int, y:Int) )   Changed help text in v1.54.
  • ResizeConsole   ( Function ResizeConsole:Void(x:Int, y:Int) )   Changed help text in v1.54.

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 ()
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 ()
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)
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)
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 db0a5c7..a8fc311 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
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
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
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
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
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
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
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
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
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
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
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 f87d02c..43c1c96 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""
See also:GetName , GetValue
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
See also:AddScore , LoadFromString
Method GetName:String(i:Int)

Syntax:


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

Syntax:


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

Syntax:


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

Syntax:


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

Syntax:


ftHighScoreList.SetCount (count:Int = 10)
Description:Set the number of highscore entries.
Parameters:
NameTypeValue
countInt10
See also:Count
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 c3d4bd0..d6af156 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) )

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)
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 7a9b61e..568876f 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.
See also:SetKey , LoadFromString
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.

+
See also:SaveToString , GetKey
Method SaveToString:String()

Syntax:


String = ftKeyMapping.SaveToString ()
Description:This method saves the key mapping data to a string.
Return type:String
See also:LoadFromString , SetKey
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
See also:GetKey , SafeToString
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 bf5bd3a..755dceb 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() )
  • CollisionCheck   ( Method CollisionCheck:Void(obj:ftObject) )
  • 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 () )
  • GetVisible   ( Method GetVisible:Bool() )
  • Remove   ( Method Remove:Void(delObjects:Bool = False) )
  • RemoveAllObjects   ( Method RemoveAllObjects:Void() )
  • RemoveAllObjectsByID   ( Method RemoveAllObjectsByID:Void(objID:Int) )
  • Render   ( Method Render:Void() )   Changed/Fixed in v1.58 regarding layer scaling and layerScissor.
  • 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(X:Float, Y:Float, Width:Float, Height:Float) )   Changed in v1.58. No offset but real sizes.
  • 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) )
  • Update   ( Method Update:Void(speed:Float=1.0) )

Method CollisionCheck:Void()

Syntax:


ftLayer.CollisionCheck ()
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)
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.
See also:CreateTransPos
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.
See also:CreateTransAlpha
Method GetActive:Bool()

Syntax:


Bool = ftLayer.GetActive ()
Description:Returns if a layer is active or not.
Return type:Bool
See also:SetActive
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
See also:SetAlpha
Method GetID:Int ()

Syntax:


Int = ftLayer.GetID ()
Description:Returns the layer ID value.
Return type:Int
See also:SetID
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[]
See also:SetPos , GetPosX , GetPosY
Method GetPosX:Float()

Syntax:


Float = ftLayer.GetPosX ()
Description:Returns the X position of a layer.
Return type:Float
See also:SetPosX , GetPosY , GetPos
Method GetPosY:Float()

Syntax:


Float = ftLayer.GetPosY ()
Description:Returns the Y position of a layer.
Return type:Float
See also:SetPosY , GetPosX , GetPos
Method GetScale:Float()

Syntax:


Float = ftLayer.GetScale ()
Description:Returns the scale factor of a layer.
Return type:Float
See also:SetScale
Method GetTag:Int ()

Syntax:


Int = ftLayer.GetTag ()
Description:Returns the layer tag value.
Return type:Int
See also:SetTag
Method GetTransitionCount:Int ()

Syntax:


Int = ftLayer.GetTransitionCount ()
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
See also:SetVisible
Method Remove:Void(delObjects:Bool = False)

Syntax:


ftLayer.Remove (delObjects:Bool = False)
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/Fixed in v1.58 regarding layer scaling and layerScissor.
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.
See also:SetVisible , SetGUI , SetLayerScissor
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftLayer.SetActive (activeFlag:Bool)
Description:Set the active flag of a layer.
Parameters:
NameTypeValue
activeFlagBool
See also:GetActive
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
See also:GetAlpha
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
See also:Render
Method SetID:Void (layerID:Int )

Syntax:


ftLayer.SetID (layerID:Int)
Description:Sets the layer ID field with any value.
Parameters:
NameTypeValue
layerIDInt
See also:GetID
Method SetLayerScissor:Void(X:Float, Y:Float, Width:Float, Height:Float)

Syntax:


ftLayer.SetLayerScissor (X:Float, Y:Float, Width:Float, Height:Float)
Changes:Changed in v1.58. No offset but real sizes.
Description:Sets the position and the size of the scissor for this layer. Width and Height take a virtual canvas size into account.
Parameters:
NameTypeValue
XFloat
YFloat
WidthFloat
HeightFloat
See also:Render
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
See also:GetPos , SetPosXSetPosY
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
See also:GetPosX , SetPos , SetPosY
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
See also:GetPosY , SetPos , SetPosX
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
See also:GetScale
Method SetTag:Void (newTag:Int )

Syntax:


ftLayer.SetTag (newTag:Int)
Description:Sets the layer tag field with any value.
Parameters:
NameTypeValue
newTagInt
See also:GetTag
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftLayer.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of a layer.
Parameters:
NameTypeValue
visibleFlagBool
See also:GetVisible , Render
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)
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 d32f71b..58ab96b 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
See also:SetDefaultLanguage
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.
See also:LoadFromString , SetDefaultLanguage
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
See also:GetString , SetDefaultLanguage
Method SetDefaultLanguage:Void(defLang:String ="EN")

Syntax:


ftLocalization.SetDefaultLanguage (defLang:String ="EN")
Description:This method sets the default language.
Parameters:
NameTypeValue
defLangString"EN"
See also:GetString , GetDefaultLanguage
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 b51313b..04bd26d 100644 --- a/docs/cftMisc.monkey.html +++ b/docs/cftMisc.monkey.html @@ -8,5 +8,5 @@ fantomEngine.cftMisc -

Module fantomEngine.cftMisc


Table of contents:

Functions:

  • GetPitchRate   ( Function GetPitchRate:Float(halfStep:Float, base:Float=1.0) )

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:

  • GetPitchRate   ( Function GetPitchRate:Float(halfStep:Float, base:Float=1.0) )

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 c514350..0dc3275 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 ) )
  • 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)
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 de92468..70ebc83 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) )
  • CreateAnim   ( Method CreateAnim:Void(animName:String, imgName:String, _frameStart:Int = 1, _frameEnd:Int = 1, _repeatCount:Int = -1) )
  • 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[]() )
  • 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() )
  • 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 () )
  • 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) )
  • Render   ( Method Render:Void(xoff:Float=0.0, yoff:Float=0.0) )   Fixed in v1.58 regarding layer scaling.
  • ResumeTimerAll   ( Method ResumeTimerAll:Void() )
  • ResumeTransAll   ( Method ResumeTransAll:Void() )
  • SetActive   ( Method SetActive:Void (activeFlag:Bool = True, children:Bool = False ) )   Changed in v1.58 -> Added a flag to affect children too.
  • 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 ) )
  • SetAnimFrame   ( Method SetAnimFrame:Void (frame:Float ) )
  • SetAnimPaused   ( Method SetAnimPaused:Void (pauseFlag:Bool = False ) )
  • SetAnimRepeatCount   ( Method SetAnimRepeatCount:Void (repeatCount:Int = -1) )
  • 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) )
  • 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) )

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
See also:SetSpeed , GetSpeed , SetMaxSpeed , SetMinSpeed
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
See also:CreateTransAlpha
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
See also:CreateTransPos
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
See also:CreateTransot
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
See also:CreateTransScale
Method CancelTimerAll:Void()

Syntax:


ftObject.CancelTimerAll ()
Description:Cancels all timers attached to an object.
See also:CreateTimer , PauseTimerAll , ResumeTimerAll
Method CancelTransAll:Void()

Syntax:


ftObject.CancelTransAll ()
Description:Cancels all transitions attached to an object.
See also:PauseTransAll , ResumeTransAll
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)

See also:SetColWith , SetColType , SetColGroup , SetColScale
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)

See also:GetTouchMode , SetTouchMode
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)
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgIndexInt
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
See also:AddAnim
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)
Description:Add a animation sequence to an object. This way an object becomes animated.
Parameters:
NameTypeValue
animNameString
imgNameString
_frameStartInt1
_frameEndInt1
_repeatCountInt-1
See also:AddAnim
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.
See also:AddTransAlpha
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.
See also:AddTransPos
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.
See also:AddTransRot
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.
See also:AddTransScale
Method GetActive:Bool()

Syntax:


Bool = ftObject.GetActive ()
Description:Returns the active flag.
Return type:Bool
See also:SetActive
Method GetAlpha:Float()

Syntax:


Float = ftObject.GetAlpha ()
Description:Get the alpha value.
Return type:Float
See also:SetAlpha
Method GetAngle:Float()

Syntax:


Float = ftObject.GetAngle ()
Description:Get the angle the object is heading.
Return type:Float
See also:SetAngle
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
See also:SetAnimFrame
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
See also:SetAnimPaused
Method GetAnimTime:Float ()

Syntax:


Float = ftObject.GetAnimTime ()
Description:Get the frame time of the current animation.
Return type:Float
See also:SetAnimTime
Method GetAnimated:Bool ()

Syntax:


Bool = ftObject.GetAnimated ()
Description:Return the isAnimated flag.
Return type:Bool
See also:SetAnimated
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.
See also:SetBlendMode
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
See also:GetParent , SetParent
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.
See also:SetColGroup , SetColWith , CheckCollision
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

See also:SetColType , SetColWith , CheckCollision
Method GetColor:Float[]()

Syntax:


Float[] = ftObject.GetColor ()
Description:Returns the color of an object in an array.
Return type:Float[]
See also:SetColor
Method GetDataObj:Object ()

Syntax:


Object = ftObject.GetDataObj ()
Description:Returns the data object of this object.
Return type:Object
See also:SetDataObj
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.
See also:SetFlip , GetFlipH , GetFlipV
Method GetFlipH:Bool()

Syntax:


Bool = ftObject.GetFlipH ()
Description:Returns the horizontal FLIP flag.
Return type:Bool
See also:SetFlipH , GetFlip , GetFlipV
Method GetFlipV:Bool()

Syntax:


Bool = ftObject.GetFlipV ()
Description:Returns the vetical FLIP flag.
Return type:Bool
See also:SetFlipV , GetFlip , GetFlipH
Method GetFriction:Float()

Syntax:


Float = ftObject.GetFriction ()
Description:Get the friction value.
Return type:Float
See also:SetFriction
Method GetGroupID:Int ()

Syntax:


Int = ftObject.GetGroupID ()
Description:Returns the group ID of an object.
Return type:Int
See also:SetGroupID
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.
See also: , SetHeight , GetWidth
Method GetID:Int ()

Syntax:


Int = ftObject.GetID ()
Description:Returns the ID of an object.
Return type:Int
See also:SetID
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
See also:SetImageObj
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
See also:SetLayer
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
+
See also:GetMapObjCount
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.
See also:GetMapObj
Method GetName:String ()

Syntax:


String = ftObject.GetName ()
Description:Get the name of an object.
Return type:String
See also:SetName
Method GetParent:ftObject()

Syntax:


ftObject = ftObject.GetParent ()
Description:Get the parent object.
Return type:ftObject
See also:SetParent
Method GetPos:Float[]()

Syntax:


Float[] = ftObject.GetPos ()
Description:Returns the objects X and Y position in a 2D Float array.
Return type:Float[]
See also:SetPos , GetPosX , GetPosY , GetPosZ
Method GetPosX:Float()

Syntax:


Float = ftObject.GetPosX ()
Description:Get the X position.
Return type:Float
See also:SetPosX , GetPos , GetPosY , GetPosZ
Method GetPosY:Float()

Syntax:


Float = ftObject.GetPosY ()
Description:Get the Y position.
Return type:Float
See also:SetPosY , GetPosX , GetPos , GetPosZ
Method GetPosZ:Float()

Syntax:


Float = ftObject.GetPosZ ()
Description:Get the Z position.
Return type:Float
See also:SetPosZ , GetPosX , GetPosY , GetPos
Method GetRadius:Float()

Syntax:


Float = ftObject.GetRadius ()
Description:Returns the radius of an object.
Return type:Float
See also:SetRadius
Method GetScale:Float()

Syntax:


Float = ftObject.GetScale ()
Description:Get current scale factor of an object.
Return type:Float
See also:SetScale , GetScaleX , GetScaleY
Method GetScaleX:Float()

Syntax:


Float = ftObject.GetScaleX ()
Description:Returns the X scale factor (width) of the object.
Return type:Float
See also:SetScaleX , GetScale , GetScaleY
Method GetScaleY:Float()

Syntax:


Float = ftObject.GetScaleY ()
Description:Returns the Y scale factor (height) of the object.
Return type:Float
See also:SetScaleY , GetScaleX , GetScale
Method GetSpeed:Float()

Syntax:


Float = ftObject.GetSpeed ()
Description:Get current linear speed of an object.
Return type:Float
See also:SetSpeed , GetSpeedAngle
Method GetSpeedAngle:Float()

Syntax:


Float = ftObject.GetSpeedAngle ()
Description:Get the current speed angle.
Return type:Float
See also:SetSpeedangle , GetSpeed
Method GetSpeedMax:Float()

Syntax:


Float = ftObject.GetSpeedMax ()
Description:Get the max speed of an object.
Return type:Float
See also:SetMaxSpeed
Method GetSpeedMin:Float()

Syntax:


Float = ftObject.GetSpeedMin ()
Description:Get the minimum speed of an object.
Return type:Float
See also:SetMinSpeed
Method GetSpeedX:Float()

Syntax:


Float = ftObject.GetSpeedX ()
Description:Get the current X speed.
Return type:Float
See also:SetSpeedX , GetSpeed , GetSpeedY , GetSpeedXY
Method GetSpeedXY:Float[]()

Syntax:


Float[] = ftObject.GetSpeedXY ()
Description:Get current the X and Y speed of a 2D Float array.
Return type:Float[]
See also:SetSpeed , GetSpeed , GetSpeedX , GetSpeedY
Method GetSpeedY:Float()

Syntax:


Float = ftObject.GetSpeedY ()
Description:Get the current Y speed.
Return type:Float
See also:SetSpeedY , GetSpeed , GetSpeedXX
Method GetSpin:Float()

Syntax:


Float = ftObject.GetSpin ()
Description:Get the spin speed value.
Return type:Float
See also:SetSpin
Method GetTag:Int ()

Syntax:


Int = ftObject.GetTag ()
Description:Get the object tag value.
Return type:Int
See also:SetTag
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)
See also:GetTargetDist
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
See also:GetTargetAngle
Method GetText:String ()

Syntax:


String = ftObject.GetText ()
Description:Get the text field of an object.
Return type:String
See also:SetText
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
See also:SetTileID
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
See also:GetTileWidth
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.
See also:SetTileID
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.
See also:SetTileID
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.
See also:SetTileIDAt
Method GetTileMap:ftTileMap()

Syntax:


ftTileMap = ftObject.GetTileMap ()
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
See also:GetTilePosY
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
See also:GetTimePoX
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
See also:GetTileHeight
Method GetTouchMode:Int()

Syntax:


Int = ftObject.GetTouchMode ()
Description:Returns the touchmode of an object.
Return type:Int
See also:SetTouchMode , CheckTouchHit
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 ()
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
See also:GetVectorAngle , GetVectorDist
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
See also:GetVectorDist , GetVector
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
See also:GetVectorAngle , GetVector
Method GetVisible:Bool()

Syntax:


Bool = ftObject.GetVisible ()
Description:Returns the visible flag.
Return type:Bool
See also:SetVisible
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.
See also:SetWidth , GetHeight
Method PauseTimerAll:Void()

Syntax:


ftObject.PauseTimerAll ()
Description:Pause all timer of an object.
See also:CreateTimer , CancelTimerAll , ResumeTimerAll
Method PauseTransAll:Void()

Syntax:


ftObject.PauseTransAll ()
Description:Pause all transitions attached to an object.
See also:CancelTransAll , ResumeTransAll
Method Remove:Void(directFlag:Bool = False)

Syntax:


ftObject.Remove (directFlag:Bool = False)
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:Fixed in v1.58 regarding layer scaling.
Description:Renders an object.
Parameters:
NameTypeValue
xoffFloat0.0
yoffFloat0.0
Method ResumeTimerAll:Void()

Syntax:


ftObject.ResumeTimerAll ()
Description:Resume all paused timer of an object.
See also:PauseTimerAll , CancelTimerAll , CreateTimer
Method ResumeTransAll:Void()

Syntax:


ftObject.ResumeTransAll ()
Description:Resume all transitions attached to an object.
See also:PauseTransAll , CancelTransAll
Method SetActive:Void (activeFlag:Bool = True, children:Bool = False )

Syntax:


ftObject.SetActive (activeFlag:Bool = True, children:Bool = False)
Changes:Changed in v1.58 -> Added a flag to affect children too.
Description:Set the active flag.
Parameters:
NameTypeValue
activeFlagBoolTrue
childrenBoolFalse
See also:GetActive
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
See also:GetAlpha , SetColor
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
See also:GetAngle
Method SetAngleOffset:Void (angleOffset:Float )

Syntax:


ftObject.SetAngleOffset (angleOffset:Float)
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
See also:GetAnimFrame
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
See also:GetAnimPaused
Method SetAnimRepeatCount:Void (repeatCount:Int = -1)

Syntax:


ftObject.SetAnimRepeatCount (repeatCount:Int = -1)
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.
See also:GetAnimTime
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
See also:GetAnimated
Method SetBlendMode:Void (blendmode:Int = 0)

Syntax:


ftObject.SetBlendMode (blendmode:Int = 0)
Description:Set the blend mode of an object.
Parameters:
NameTypeValue
blendmodeInt0
See also:GetBlendMode
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.
See also:GetColGroup
Method SetColScale:Void (colScale:Float = 1.0)

Syntax:


ftObject.SetColScale (colScale:Float = 1.0)
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
See also:GetColType
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
See also:SetAlpha , GetColor
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
See also:GetDataObj
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
See also:GetFlip
Method SetFlipH:Void (hf:Bool)

Syntax:


ftObject.SetFlipH (hf:Bool)
Description:Activate horizontal image flip.
Parameters:
NameTypeValue
hfBool
See also:GetFlipH
Method SetFlipV:Void (vf:Bool)

Syntax:


ftObject.SetFlipV (vf:Bool)
Description:Activate vertical image flip.
Parameters:
NameTypeValue
vfBool
See also:GetFlipV
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
See also:GetFriction
Method SetGroupID:Void (groupId:Int)

Syntax:


ftObject.SetGroupID (groupId:Int)
Description:Set the objects group ID.
Parameters:
NameTypeValue
groupIdInt
See also:GetGroupID
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.
See also:GetHeight , SetWidth
Method SetID:Void (i:Int )

Syntax:


ftObject.SetID (i:Int)
Description:Set the object ID.
Parameters:
NameTypeValue
iInt
See also:GetID
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
See also:GetImage
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
See also:GetImage
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
See also:GetImageObj
Method SetLayer:Void(newLayer:ftLayer)

Syntax:


ftObject.SetLayer (newLayer:ftLayer)
Description:Set the layer of an object.
Parameters:
NameTypeValue
newLayerftLayer
See also:GetLayer
Method SetMaxSpeed:Void (maxSpeed:Float )

Syntax:


ftObject.SetMaxSpeed (maxSpeed:Float)
Description:Set the maximum speed of an object.
Parameters:
NameTypeValue
maxSpeedFloat
See also:GetSpeedMax
Method SetMinSpeed:Void (minSpeed:Float )

Syntax:


ftObject.SetMinSpeed (minSpeed:Float)
Description:Set the minimum speed of an object.
Parameters:
NameTypeValue
minSpeedFloat
See also:GetSpeedMin
Method SetName:Void (newName:String )

Syntax:


ftObject.SetName (newName:String)
Description:Set the name of an object.
Parameters:
NameTypeValue
newNameString
See also:GetName
Method SetParent:Void(newParent:ftObject)

Syntax:


ftObject.SetParent (newParent:ftObject)
Description:Set the parent of an object.
Parameters:
NameTypeValue
newParentftObject
See also:GetParent
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
See also:GetPos
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
See also:GetPosX
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
See also:GetPosY
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
See also:GetPosZ
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
See also:GetRadius
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
See also:GetScale
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
See also:GetScaleX
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
See also:GetScaleY
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
See also:GetSpeed
Method SetSpeedAngle:Void (newAngle:Float)

Syntax:


ftObject.SetSpeedAngle (newAngle:Float)
Description:Set the objects speed angle.
Parameters:
NameTypeValue
newAngleFloat
See also:GetSpeedAngle
Method SetSpeedX:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedX (newSpeed:Float)
Description:Set the objects X speed.
Parameters:
NameTypeValue
newSpeedFloat
See also:GetSpeedX
Method SetSpeedY:Void (newSpeed:Float)

Syntax:


ftObject.SetSpeedY (newSpeed:Float)
Description:Set the objects Y speed.
Parameters:
NameTypeValue
newSpeedFloat
See also:GetSpeedY
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
See also:GetSpin
Method SetTag:Void (t:Int )

Syntax:


ftObject.SetTag (t:Int)
Description:Set the objects tag field.
Parameters:
NameTypeValue
tInt
See also:GetTag
Method SetText:Void (t:String )

Syntax:


ftObject.SetText (t:String)
Description:Set the text of an object.
Parameters:
NameTypeValue
tString
See also:GetText
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
See also:GetTileID
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
See also:GetTileIDAt
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)

See also:GetTouchMode , CheckTouchHit
Method SetVisible:Void (visible:Bool = True )

Syntax:


ftObject.SetVisible (visible:Bool = True)
Description:Set if an object is visible.
Parameters:
NameTypeValue
visibleBoolTrue
See also:GetVisible
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.
See also:GetWidth , SetHeight
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
See also:SetWrapScreenX , SetWrapScreenY
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
See also:SetWrapScreen , SetWrapScreenY
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
See also:SetWrapScreen , SetWrapScreenX
Method Update:Void(delta:Float=1.0)

Syntax:


ftObject.Update (delta:Float=1.0)
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 1391e2f..2c79ea0 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 668d667..b86bd71 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 ) )
  • CreateTransPos   ( Method CreateTransPos:ftTrans(xt:Float, yt:Float, duration:Float, relative:Int, transId:Int=0 ) )
  • 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
See also:RemoveLayer
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)
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.
See also:CreateTransPos
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)
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.
See also:CreateTransAlpha
Method GetActive:Bool()

Syntax:


Bool = ftScene.GetActive ()
Description:Returns the active flag of the scene.
Return type:Bool
See also:SetActive
Method GetVisible:Bool()

Syntax:


Bool = ftScene.GetVisible ()
Description:Returns the visible flag of the scene.
Return type:Bool
See also:SetVisible
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
See also:AddLayer
Method SetActive:Void(activeFlag:Bool)

Syntax:


ftScene.SetActive (activeFlag:Bool)
Description:Set the active flag of the scenes layers.
Parameters:
NameTypeValue
activeFlagBool
See also:GetActive
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
See also:SetPos
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
See also:SetAlpha
Method SetVisible:Void(visibleFlag:Bool)

Syntax:


ftScene.SetVisible (visibleFlag:Bool)
Description:Set the visible flag of the scenes layers.
Parameters:
NameTypeValue
visibleFlagBool
See also:GetVisible
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 23f4cd3..a615fef 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
See also:SetPan
Method GetPaused:Bool()

Syntax:


Bool = ftSound.GetPaused ()
Description:Returns the flag of a sound.
Return type:Bool
See also:SetPaused
Method GetPitchRate:Float()

Syntax:


Float = ftSound.GetPitchRate ()
Description:Returns the pitch rate of a sound.
Return type:Float
See also:SetPitchRate
Method GetVolume:Float()

Syntax:


Float = ftSound.GetVolume ()
Description:Returns the volume of a sound. Ranges from 0.0 to 1.0.
Return type:Float
See also:SetVolume
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
See also:Stop
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.
See also:GetPan
Method SetPaused:Void(pauseFlag:Bool)

Syntax:


ftSound.SetPaused (pauseFlag:Bool)
Description:Pause/resume a sound or a music.
Parameters:
NameTypeValue
pauseFlagBool
See also:GetPaused
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.
See also:GetPitchRate
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
See also:GetVolume
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
See also:Play
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 8c06493..c35baf1 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) )
  • GetImageWidth   ( Method GetImageWidth:Float(imageName:String) )
  • GetRotated   ( Method GetRotated:Bool(imageName:String) )
  • GetWidth   ( Method GetWidth:Int(imageName:String) )
  • Load   ( Method Load:Void(imgName:String, dataName:String) )
  • 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)
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)
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)
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 a4db061..8c89d2a 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) )
  • GetTileWidth   ( Method GetTileWidth:Int(index:Int) )
  • Remove   ( Method Remove:Void() )
  • 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
See also:SetTileID
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
See also:GetTileWidth
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.
See also:SetTileID
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.
See also:SetTileID
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.
See also:SetTileIDAt
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
See also:GetTilePosY
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
See also:GetTimePoX
Method GetTileSetIndex:Int(tileID:Int)

Syntax:


Int = ftTileSet.GetTileSetIndex (tileID:Int)
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
See also:GetTileHeight
Method Remove:Void()

Syntax:


ftTileSet.Remove ()
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
See also:GetTileID
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 a2e6f36..56e7aaf 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
See also:SetPaused
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
See also:GetPaused , Update
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 14c7a95..c0ae554 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
See also:SetPaused
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

See also:SetType
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
See also:GetPaused
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

See also:SetEase
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 c81e0bb..3699d9c 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() )
  • 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 ()
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 91bcebb..18ae873 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) )
  • RenderAllWP   ( Method RenderAllWP:Void(type:Int=0) )
  • 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)
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)
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/changes.html b/docs/changes.html index 0e3526f..1d3a80b 100644 --- a/docs/changes.html +++ b/docs/changes.html @@ -8,5 +8,5 @@ changes.html -


Changes in fantomEngine



Changes in Version 1.57


New functionalities
  • GUI!!! Implemented via custom Objects and the new ftGuiMng manager class! Have fun!!!


Fixes
  • Fixed resizing arrays inside ftObject._Init and ftTileMap.Remove. Causes a compile bug in Android.
  • Fixed ftEngine.New() in the creation of the default layer and scene which could cause a crash when removed.
  • Fixed ftLayer.Remove() to take care of assigned layer transitions.
  • Fixed Index of array error under GLFW3 and possible all C++ targets.


New example
  • Canvas/VirtualResolution/VirtualResolution.monkey
  • Input/TouchInput/DragNDrop/DragNDrop.monkey
  • Gui/Joysticks/Joysticks.monkey
  • Gui/Buttons/Buttons.mokey
  • Gui/Checkbox/Checkbox.mokey
  • Gui/Label/Label.mokey
  • Gui/Listview/Listview.mokey
  • Gui/Slider/Slider.mokey
  • Gui/Switch/Switch.mokey
  • Gui/Textfield/Textfield.mokey
  • Physics/Canon/Canon.monkey



Changes in Version 1.56


New functionalities
  • fantomEngine now automatically pools ftObjects.
  • New method ftObject.GetColor:Float[]() - Returns the color of an object in an array
  • You can use custom objects now with basically all type of fantomEngine objects.
  • Added GetCam:Float[](), GetCamX:Float() and GetCamY:Float() methods to the ftEngine class.
  • When returning TRUE from ftEngine.OnObjectTouch, no further touch checks are performed this frame.
  • When returning TRUE from ftEngine.OnObjectCollision, no further collision checks of this object are done in this frame.
  • Use ftObject.GetTileMap:ftTileMap() to return the ftTileMap object of your ftObject.
  • fantomEngine now supports Tiled maps with multiple tilesets.


Changes
  • Cleanup sources from Print statements.
  • Changed all Error messages to only be checked and shown in DEBUG mode.
  • Moved ftObject tilemap properties and duplicate methods into the new ftTileMap class.
  • ftEngine.TouchCheck:Void(touchID:Int=0) will now check the layer in the backwards order. The last created layer (the top one) at first.
  • Changed all ftObject._internalPointInside... methods so the check includes the borders of an object too, not only inside the object.


Fixes
  • fixed constant ftEngine.otPivot which caused points not to be rendered since version 1.55.
  • fixed Platformer example which didn't show the whole screen anymore.
  • fixed ftObject.CheckTouchHit when object has the touchmode ftEngine.tmBox and was rotated.


New examples
  • Objects/Creation/PoolingObjects/PoolingObjects.monkey
  • TileMaps/EndlessMap/EndlessMap.monkey
  • TileMaps/Tiled/MultiTileSets.monkey



Changes in Version 1.55


New functionalities
  • Added ftAstar.GetAngle:Float() to retrieve the angle of the grid.
  • Added ftAstar.GetScaleX:Float() to retrieve the X scale factor of the grid.
  • Added ftAstar.GetScaleY:Float() to retrieve the X scale factor of the grid.
  • Added ftLayer.GetTransitionCount:Int() to retrieve the current number of transitions.
  • Added ftLayer.SetLayerScissor:Void(..) so you can set the render scissor offset for each layer.
  • Added ftEngine.GetLocalX:Float(...) and ftEngine.GetLocalY:Float(...) to convert virtual coordinates to device coordinates.
  • Added ftEngine.GetWorldX:Float(...) and ftEngine.GetWorldY:Float(...) to convert device coordinates to virtual coordinates.
  • Added ftEngine.CreateSpriteAtlas(...) to setup a sprite atlas in one step.
  • Added ftSpriteAtlas.GetImageHeight(...) and ftSpriteAtlas.GetImageWidth(...) to retrieve the proportions of a sub image.


Changes
  • Various changes regarding the calling of ftAstar.SetAngle and ftAstar.SetScale to avoid multiple calculation and floating point errors when setting grid node positions or adding grid nodes.
  • Changed ftLayer.Render to react on a layer individual scissor offset.
  • Changed ftEngine.CreateTileMap to support isometric tilemaps.
  • Changed ftObject.Render to support isometric tilemaps.
  • Changed ftEngine.LoadImage(...) to use Image.MidHandle as the default flag.


Fixes
  • Fixed ftPath.RenderAllWP and ftPath.RenderAllMarker to take virtual canvas sizes into the render calculation.


New examples
  • TileMaps/Tiled/TiledIsometric.monkey
  • SpriteSheets/SheetAnim/SheetAnim.monkey


Fixed examples
  • Objects/Behaviour/ObjectMovement/ObjectMovement2. - fixed setting the ID of a shot



Changes in Version 1.54


New functionalities
  • Added ftVec2D.Perp:Void() function
  • Added ftObject.SetAnimRepeatCount(repeatCount:Int = -1) function
  • Added _repeatCount parameter to ftObject.CreateAnim.
  • Added ftEngine.OnObjectAnim method, which is called when one loop of an animation is finished
  • Added support to load fonts create via FontMachine. They have to be "packed".
  • Added ftEngine.CreatePivot method so you can create an empty object which you can parent other objects to.
  • Added ftObject.SetAngleOffset method so you can manually set the offset for the drawing angle.


Fixes
  • Fixed collision routines regarding the usage of the collision scale factor
  • Fixed ftSpriteAtlas.Load when using a sprite atlas data file where the lines are delimited by CR13 CR10.
  • Fixed ftEngine.CreateImage when using a sprite atlas data file where the lines are delimited by CR13 CR10.
  • Fixed ftFont.Load when using a data file where the lines are delimited by CR13 CR10.
  • Fixed reading Image rotation when using ftSpriteAtlas class. Use ftSpriteAtlas.GetAngleOffset to read the rotation offset.
  • Fixed ftObject.Render with images. They had disappeared at the edges of the Canvas when scaled up.
  • Fixed ftScene.CreateTransAlpha and ftScene.CreateTransPos to return the transition object (ftTrans).


Changes
  • ftEngine.CopyObject now copies assigned children too.


New examples
  • Misc/UpdateObjects
  • Objects/Collision/Collision
  • Objects/Collision/CollisionBoxes
  • Timers/Timers


Changed examples
  • Objects/Creation/CopyObject -> added a child
  • BaseScript/BaseScript -> added new OnObjectAnim method



Changes in Version 1.53


New functionalities
  • You can create/compose animated objects now from single images.
  • Added an animation manager that will update the animation of an object now. This changed some fields of the ftEngine class and the ftObject class.
  • You can pause an animation now.
  • You can set the number of highscore list entries now via ftHighscore.Setcount(count:Int)
  • Images grabbed from a spritesheet have their handle now set to the center of the image by default.
  • Several HTML5 functions that let you resize, maximize and hide the canvas/console.
  • With ftEngine.RenderLoadingBar you can now render a spinning loading image at the start of your app.
  • You can de-/activate the sound and music playback now via one call each.
  • And object can now have several images assigned to it. See the cftImageMng.monkey for all the new functionalities.


Fixes
  • ftLayer.TouchCheck didn't took the layer position into the calculation.
  • ftBox2D.CreateObject determined the box2d angle wrong. Its was off by -90 degrees.
  • Removed a debugging PRINT command from ftLocalization.LoadFromString.
  • Fixed a bug in ftLocalization.GetString regarding the language key.
  • Fixed the removal of waypoints and markers.
  • Fixed ftObject.SetScaleY regarding assigning absolute values.


Changes
  • The objects have now an array of assigned images instead just one. This was needed to be able to compose an animated obejct of single images.


New examples
  • Misc/MultiClass
  • Physics/Raycasting
  • Scenes/SceneCreation


Changed examples
  • Objects/Creation/AnimObject
  • TileMaps/Platformer



Changes in Version 1.52


New functionalities
  • The free texture packer tool called MakeAtlas can be used now to create Sparrow compatible (.xml) sprite sheets.
  • The new ftSpriteAtlas class handles sprite sheets much easier. No need to constantly read from the device storage when you access the spritesheet files.
  • You can read TWL Theme Editor compatible font files now. Like with Hiero, just rename the font file from .fnt to .txt
  • No need to remove file paths from images in Tiled json map files as ftEngine.CreateTileMap will ignore the path if the image is not located there.
  • New ftScene class which groups layers. Then you can create a transition of set their active/visible flag in one batch.
  • You can do raycasting with the ftBox2D class now. A hit will be reported via the ftBox2D.OnRayCast method.
  • The bodies created via the ftBox2D class will now store the connected ftObject inside the body's userData field.
  • Via ftObject.GetClosestObj(), you can now determine the closest ftObject to another ftObject
  • There is a ftImageMng class now which takes care of all images loaded via fantomEngine and makes sure that no image is loaded twice.
  • For the rest, please have a look inside modules help files.


Fixes
  • Fixed a bug in ftFont.Draw that was showing up when the character you want to draw is not on the map.
  • SetCanvasSize now reads the device camvas size again so you can act on device rotation properly.
  • several more


Changes
  • Localized text needs to be formated newly. See the ftLocalization class for more info.
  • For the rest, please have a look inside modules help files.
  • When you create objects, the radius is now calculated differently. No multiplication of 1.42 from the max of height and width anymore.


New examples
  • Misc/MultiClass
  • Physics/Raycasting
  • Scenes/SceneCreation


Changed examples
  • SpriteSheets/TexturePacker
  • Localization/Localization



Changes in Version 1.51


New functionalities
  • With the new class ftKeyMapping, you can support different key maps for different controllers or user definitions.
  • With the new class ftLocalization, you can support several languages inside your app.
  • You can pause and resume transitions now.
  • You can add extra polygon fixtures now to a b2body via ftbox2D.AddPolygon (code provided by the Monkey user CalebDev).
  • Quite a few sound related commands were added.
  • You can set now the maximum sound channels to be used via ftEngine.SetMaxSoundChannel.
  • Because of a typo I had to depreciate ftEngine.GetPause and ftEngine.SetPause. Use GetPaused and SetPaused instead.
  • Added code and examples from Douglas Williams to provide more primitives (Point, Line, Oval, Polygon, Stickman) to fantomEngine.
  • Added quite a few things to the sound section of fE.
  • Added collision type ftEngine.ctLine% which you can check against now.
  • object layers of Tiled maps are read in now.
  • You can set the GUI flag of a layer via ftLayer.SetGUI. A GUI layer is not effected by the camera values.
  • New class ftMapObj that holds a Tiled map compatible map object (like a polyline, or a rectangle)


Changes
  • Several help descriptions were reworded.
  • The folder structure of the example scripts was reorganized.
  • Fixed several examples regarding useless SetUpdateRate calls in OnResume and OnSuspend events.
  • Changed the values for touch types again.
  • All sub modules were moved to the folder feModules.
  • Speed up the drawing of tilemaps big time!


New commands
  • Please look at the modules help files to see what is new.


Fixes
  • several


New examples
  • Layer/ScrollingLayers (by Douglas Williams)
  • Localization/Localization
  • Input/KeyMapping
  • Objects/Appearance/FlashObject2 (by Douglas Williams)
  • Misc/RunJump (by Douglas Williams)
  • Objects/Creation/CreatePrimitives (by Douglas Williams)
  • TileMaps/DynamicMap



Changes in Version 1.50


New functionalities
  • You can set the handle of an object now via ftObject.SetHandle.
  • You can determine the edges of an object easily now via ftObject.GetEdge. Good for platformers.
  • Box2D integration enhanced. Now support for PhysicsEditor shape files.


Changes
  • fantomEngine ships now with the Box2D module v1.0.12 from Damian Sinclair


New commands
  • Please look at the modules help files to see what is new.


Fixes
  • Made compatible again with Monkey V70 regarding removed "remove" method in lists.
  • The collision against a rotated box area didn't work correctly. Now it does!
  • subImages in TexturePacker sheets with capitalized characters in their names were not found.
  • Polygon touch check routines were fixed.


New examples
  • Physics/MouseJoint
  • Physics/RevoluteJoint



Changes in Version 1.49


Changes
  • Put the examples inside parent folders that should categorize them better.
  • Finished path/waypoint integration.
  • Finished AStar path finding.
  • The class ftTrans now lets you set the equation type and ease type of a transition.
  • ftEngine.OnSwipeDone has now an extra touchIndex parameter that tells you which touch index has fired this event. You can do now multifinger swipes.
  • Subimages in sprite sheets can be rotated now, as the flag "rotated=true" is recognized now.


New commands
  • See the ftPath and ftWaypoints class documentation for the final implementation.
  • See the ftAStar class documentation for the final implementation.
  • Various other new commands. Please look at the modules help files to see what is new.


New examples
  • Paths_Waypoints/Pathfinding

  • Object_Behaviour/ObjectTransition



Changes in Version 1.48


Changes
  • All CreateImage variants use load ftEngine.LoadImage now where it is needed. That takes care of loading an image only once.
  • Added a reset of the engine color to 255,255,255 before each render task. This should take care that the first objects color gets changed.
  • CreateTileMap:ftObject(fname:string, startX:Float, startY:Float ) now is able to load maps from a sub folder inside the data directory. Still you need to make sure, that all references of image inside the JSON file are without paths and are located inside the same folder as your JSON file.
  • All parameter types functions that don't need a return parameters were set to VOID.
  • All ftEngine.CreateSomething methods will accept an optional object parameter. This way you can extend your own object class from the ftObject class and use this. Be aware that in all event handling methods, the object will be casted into a ftObject.
  • ftObject.GetSpeed/ftObject.GetSpeedAngle now reported correct values when you used a negative speed on an object
  • layer/object transitions, object timers are not updated as long as the engine is paused (see ftEngine.SetPause)
  • Removed the "reflection" dependency by copying an object manually. That should reduce the size of the created native code again.
  • All methods are documented in a Jungle-IDE compatible style.
  • Added time scaling in timers, transitions and also object updating. Set the scale via ftEngine.SetTimeScale.


Fixes
  • ftObject.SetColWith:Int (s:Int,e:Int,b:Bool) wasn't setting an internal flag so the collision detection for all objects of a layer didn't work if you used that command.
  • Removed the double call to Cleanuplists inside ftLayer.Update.
  • ftObject.GetSpin() returned the wrong value.


New classes
  • ftBox2D  (experimental, subject of change)
    This class integrates the Box2D engine. Just make sure you have a box2D module installed. Have a look at the new example Box2DIntegration.monkey to see how it is working. Please note that you need to add another import statement "Import cftBox2D" at the top.
  • ftPath  (experimental, subject of change)
    The new path/waypoint class. It supports linear and catmull rom type of path movement between its nodes.
  • ftMarker
    A new internal class that deals with running markers on a path.
  • ftNode
    A new internal class that represends a node on a path.
  • ftImage
    A new internal class that keeps a loaded image.


New commands
  • ftEngine.CreatePath:ftPath(xp:Float, yp:Float )
  • ftEngine.GetAccelZ:Float()
    Return the accelerometer value for the Z axxis. If oyu are on a desktop, you can use the LEFT/Right key to change its values to -1/+1 accordingly.
  • ftEngine.GetObjCount:Int()
    Returns the number of objects inside the engine.
  • ftEngine.GetPause:Bool()
    Returns the isPaused flag of the engine.
  • ftEngine.GetTime:Float()
  • ftEngine.GetTimeScale:Float()
  • ftEngine.LoadImage(...)
    Loads an image from the device only if it wasn't loaded before. The image gets stored into the image list of the engine.
  • ftEngine.OnObjectSort:Int(obj1:ftObject, obj2:ftObject).
  • ftEngine.RemoveAllImages:Void(discard:Bool = False)
    Removes all images from the engines image list.
  • ftEngine.RemoveAllLayer:Void()
    Removes all layers from the engine.
  • ftEngine.RemoveImage:Void(path:string, discard:Bool = False)
    Removes the image with the given path from the image list of the engine.
  • ftEngine.RemoveImage:Void(img:Image, discard:Bool = False)
    Removes the image with the given IMAGE from the image list of the engine.
  • ftEngine.SortObjects:Void()
  • ftEngine.SortObjects:Void(layer:ftLayer)
  • ftEngine.SetPause(pauseFlag:Bool)
    Sets the isPaused flag of the engine.
  • ftEngine.SetTimeScale(timescale:Float = 1.0)
  • ftLayer.GetID:Int ()
  • ftLayer.GetTag:Int ()
  • ftLayer.SetID:Void (i:Int )
  • ftLayer.SetPosX:Void (x:Float, relative:Int = False )
  • ftLayer.SetPosY:Void (y:Float, relative:Int = False )
  • ftLayer.SetTag:Void (t:Int )
  • ftLayer.SortObjects:Void()
  • ftObject.GetPosZ:Void()
  • ftObject.GetSpeedMin:Float()
  • ftObject.GetSpeedXY:Float[]()
  • ftObject.SetMinSpeed:Void(ms:Float)
    Sets the minimum speed for objects
  • ftObject.SetPosZ(z:Float, relative:Bool = False)


New external HTML5 functions
  • GetBrowserName:String()
    Will return the name of the HTML5 browser you are playing the game on.
  • GetBrowserVersion:String()
    Will return the version number of the HTML5 browser you are playing the game on.
  • GetBrowserPlatform:String()
    Will return the platform name of the HTML5 browwser you are playing the game on.


New sample scripts
  • Box2DIntegration.monkey
  • Waypoints.monkey
  • ExtendObject.monkey
  • JuggleSoccerBall.monkey
  • SortObjects.monkey
  • ParentChild.monkey



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.


+


Changes in fantomEngine



Changes in Version 1.58


Changes
  • Added children flag to ftObject.SetActive so it affects children too.
  • ftLayer.SetLayerScissor now works with virtual values, no offsets anymore.


Fixes
  • Fixed/Changed ftLayer.Render regarding layer scaling.
  • Fixed ftObject.Render regarding layer scaling and also object culling.


New example
  • Layer/LayerScaling/LayerScaling.monkey
  • TileMaps/Platformer_Physics/Platformer_Physics.monkey



Changes in Version 1.57


New functionalities
  • GUI!!! Implemented via custom Objects and the new ftGuiMng manager class! Have fun!!!


Fixes
  • Fixed resizing arrays inside ftObject._Init and ftTileMap.Remove. Causes a compile bug in Android.
  • Fixed ftEngine.New() in the creation of the default layer and scene which could cause a crash when removed.
  • Fixed ftLayer.Remove() to take care of assigned layer transitions.
  • Fixed Index of array error under GLFW3 and possible all C++ targets.


New example
  • Canvas/VirtualResolution/VirtualResolution.monkey
  • Input/TouchInput/DragNDrop/DragNDrop.monkey
  • Gui/Joysticks/Joysticks.monkey
  • Gui/Buttons/Buttons.mokey
  • Gui/Checkbox/Checkbox.mokey
  • Gui/Label/Label.mokey
  • Gui/Listview/Listview.mokey
  • Gui/Slider/Slider.mokey
  • Gui/Switch/Switch.mokey
  • Gui/Textfield/Textfield.mokey
  • Physics/Canon/Canon.monkey



Changes in Version 1.56


New functionalities
  • fantomEngine now automatically pools ftObjects.
  • New method ftObject.GetColor:Float[]() - Returns the color of an object in an array
  • You can use custom objects now with basically all type of fantomEngine objects.
  • Added GetCam:Float[](), GetCamX:Float() and GetCamY:Float() methods to the ftEngine class.
  • When returning TRUE from ftEngine.OnObjectTouch, no further touch checks are performed this frame.
  • When returning TRUE from ftEngine.OnObjectCollision, no further collision checks of this object are done in this frame.
  • Use ftObject.GetTileMap:ftTileMap() to return the ftTileMap object of your ftObject.
  • fantomEngine now supports Tiled maps with multiple tilesets.


Changes
  • Cleanup sources from Print statements.
  • Changed all Error messages to only be checked and shown in DEBUG mode.
  • Moved ftObject tilemap properties and duplicate methods into the new ftTileMap class.
  • ftEngine.TouchCheck:Void(touchID:Int=0) will now check the layer in the backwards order. The last created layer (the top one) at first.
  • Changed all ftObject._internalPointInside... methods so the check includes the borders of an object too, not only inside the object.


Fixes
  • fixed constant ftEngine.otPivot which caused points not to be rendered since version 1.55.
  • fixed Platformer example which didn't show the whole screen anymore.
  • fixed ftObject.CheckTouchHit when object has the touchmode ftEngine.tmBox and was rotated.


New examples
  • Objects/Creation/PoolingObjects/PoolingObjects.monkey
  • TileMaps/EndlessMap/EndlessMap.monkey
  • TileMaps/Tiled/MultiTileSets.monkey



Changes in Version 1.55


New functionalities
  • Added ftAstar.GetAngle:Float() to retrieve the angle of the grid.
  • Added ftAstar.GetScaleX:Float() to retrieve the X scale factor of the grid.
  • Added ftAstar.GetScaleY:Float() to retrieve the X scale factor of the grid.
  • Added ftLayer.GetTransitionCount:Int() to retrieve the current number of transitions.
  • Added ftLayer.SetLayerScissor:Void(..) so you can set the render scissor offset for each layer.
  • Added ftEngine.GetLocalX:Float(...) and ftEngine.GetLocalY:Float(...) to convert virtual coordinates to device coordinates.
  • Added ftEngine.GetWorldX:Float(...) and ftEngine.GetWorldY:Float(...) to convert device coordinates to virtual coordinates.
  • Added ftEngine.CreateSpriteAtlas(...) to setup a sprite atlas in one step.
  • Added ftSpriteAtlas.GetImageHeight(...) and ftSpriteAtlas.GetImageWidth(...) to retrieve the proportions of a sub image.


Changes
  • Various changes regarding the calling of ftAstar.SetAngle and ftAstar.SetScale to avoid multiple calculation and floating point errors when setting grid node positions or adding grid nodes.
  • Changed ftLayer.Render to react on a layer individual scissor offset.
  • Changed ftEngine.CreateTileMap to support isometric tilemaps.
  • Changed ftObject.Render to support isometric tilemaps.
  • Changed ftEngine.LoadImage(...) to use Image.MidHandle as the default flag.


Fixes
  • Fixed ftPath.RenderAllWP and ftPath.RenderAllMarker to take virtual canvas sizes into the render calculation.


New examples
  • TileMaps/Tiled/TiledIsometric.monkey
  • SpriteSheets/SheetAnim/SheetAnim.monkey


Fixed examples
  • Objects/Behaviour/ObjectMovement/ObjectMovement2. - fixed setting the ID of a shot



Changes in Version 1.54


New functionalities
  • Added ftVec2D.Perp:Void() function
  • Added ftObject.SetAnimRepeatCount(repeatCount:Int = -1) function
  • Added _repeatCount parameter to ftObject.CreateAnim.
  • Added ftEngine.OnObjectAnim method, which is called when one loop of an animation is finished
  • Added support to load fonts create via FontMachine. They have to be "packed".
  • Added ftEngine.CreatePivot method so you can create an empty object which you can parent other objects to.
  • Added ftObject.SetAngleOffset method so you can manually set the offset for the drawing angle.


Fixes
  • Fixed collision routines regarding the usage of the collision scale factor
  • Fixed ftSpriteAtlas.Load when using a sprite atlas data file where the lines are delimited by CR13 CR10.
  • Fixed ftEngine.CreateImage when using a sprite atlas data file where the lines are delimited by CR13 CR10.
  • Fixed ftFont.Load when using a data file where the lines are delimited by CR13 CR10.
  • Fixed reading Image rotation when using ftSpriteAtlas class. Use ftSpriteAtlas.GetAngleOffset to read the rotation offset.
  • Fixed ftObject.Render with images. They had disappeared at the edges of the Canvas when scaled up.
  • Fixed ftScene.CreateTransAlpha and ftScene.CreateTransPos to return the transition object (ftTrans).


Changes
  • ftEngine.CopyObject now copies assigned children too.


New examples
  • Misc/UpdateObjects
  • Objects/Collision/Collision
  • Objects/Collision/CollisionBoxes
  • Timers/Timers


Changed examples
  • Objects/Creation/CopyObject -> added a child
  • BaseScript/BaseScript -> added new OnObjectAnim method



Changes in Version 1.53


New functionalities
  • You can create/compose animated objects now from single images.
  • Added an animation manager that will update the animation of an object now. This changed some fields of the ftEngine class and the ftObject class.
  • You can pause an animation now.
  • You can set the number of highscore list entries now via ftHighscore.Setcount(count:Int)
  • Images grabbed from a spritesheet have their handle now set to the center of the image by default.
  • Several HTML5 functions that let you resize, maximize and hide the canvas/console.
  • With ftEngine.RenderLoadingBar you can now render a spinning loading image at the start of your app.
  • You can de-/activate the sound and music playback now via one call each.
  • And object can now have several images assigned to it. See the cftImageMng.monkey for all the new functionalities.


Fixes
  • ftLayer.TouchCheck didn't took the layer position into the calculation.
  • ftBox2D.CreateObject determined the box2d angle wrong. Its was off by -90 degrees.
  • Removed a debugging PRINT command from ftLocalization.LoadFromString.
  • Fixed a bug in ftLocalization.GetString regarding the language key.
  • Fixed the removal of waypoints and markers.
  • Fixed ftObject.SetScaleY regarding assigning absolute values.


Changes
  • The objects have now an array of assigned images instead just one. This was needed to be able to compose an animated obejct of single images.


New examples
  • Misc/MultiClass
  • Physics/Raycasting
  • Scenes/SceneCreation


Changed examples
  • Objects/Creation/AnimObject
  • TileMaps/Platformer



Changes in Version 1.52


New functionalities
  • The free texture packer tool called MakeAtlas can be used now to create Sparrow compatible (.xml) sprite sheets.
  • The new ftSpriteAtlas class handles sprite sheets much easier. No need to constantly read from the device storage when you access the spritesheet files.
  • You can read TWL Theme Editor compatible font files now. Like with Hiero, just rename the font file from .fnt to .txt
  • No need to remove file paths from images in Tiled json map files as ftEngine.CreateTileMap will ignore the path if the image is not located there.
  • New ftScene class which groups layers. Then you can create a transition of set their active/visible flag in one batch.
  • You can do raycasting with the ftBox2D class now. A hit will be reported via the ftBox2D.OnRayCast method.
  • The bodies created via the ftBox2D class will now store the connected ftObject inside the body's userData field.
  • Via ftObject.GetClosestObj(), you can now determine the closest ftObject to another ftObject
  • There is a ftImageMng class now which takes care of all images loaded via fantomEngine and makes sure that no image is loaded twice.
  • For the rest, please have a look inside modules help files.


Fixes
  • Fixed a bug in ftFont.Draw that was showing up when the character you want to draw is not on the map.
  • SetCanvasSize now reads the device camvas size again so you can act on device rotation properly.
  • several more


Changes
  • Localized text needs to be formated newly. See the ftLocalization class for more info.
  • For the rest, please have a look inside modules help files.
  • When you create objects, the radius is now calculated differently. No multiplication of 1.42 from the max of height and width anymore.


New examples
  • Misc/MultiClass
  • Physics/Raycasting
  • Scenes/SceneCreation


Changed examples
  • SpriteSheets/TexturePacker
  • Localization/Localization



Changes in Version 1.51


New functionalities
  • With the new class ftKeyMapping, you can support different key maps for different controllers or user definitions.
  • With the new class ftLocalization, you can support several languages inside your app.
  • You can pause and resume transitions now.
  • You can add extra polygon fixtures now to a b2body via ftbox2D.AddPolygon (code provided by the Monkey user CalebDev).
  • Quite a few sound related commands were added.
  • You can set now the maximum sound channels to be used via ftEngine.SetMaxSoundChannel.
  • Because of a typo I had to depreciate ftEngine.GetPause and ftEngine.SetPause. Use GetPaused and SetPaused instead.
  • Added code and examples from Douglas Williams to provide more primitives (Point, Line, Oval, Polygon, Stickman) to fantomEngine.
  • Added quite a few things to the sound section of fE.
  • Added collision type ftEngine.ctLine% which you can check against now.
  • object layers of Tiled maps are read in now.
  • You can set the GUI flag of a layer via ftLayer.SetGUI. A GUI layer is not effected by the camera values.
  • New class ftMapObj that holds a Tiled map compatible map object (like a polyline, or a rectangle)


Changes
  • Several help descriptions were reworded.
  • The folder structure of the example scripts was reorganized.
  • Fixed several examples regarding useless SetUpdateRate calls in OnResume and OnSuspend events.
  • Changed the values for touch types again.
  • All sub modules were moved to the folder feModules.
  • Speed up the drawing of tilemaps big time!


New commands
  • Please look at the modules help files to see what is new.


Fixes
  • several


New examples
  • Layer/ScrollingLayers (by Douglas Williams)
  • Localization/Localization
  • Input/KeyMapping
  • Objects/Appearance/FlashObject2 (by Douglas Williams)
  • Misc/RunJump (by Douglas Williams)
  • Objects/Creation/CreatePrimitives (by Douglas Williams)
  • TileMaps/DynamicMap



Changes in Version 1.50


New functionalities
  • You can set the handle of an object now via ftObject.SetHandle.
  • You can determine the edges of an object easily now via ftObject.GetEdge. Good for platformers.
  • Box2D integration enhanced. Now support for PhysicsEditor shape files.


Changes
  • fantomEngine ships now with the Box2D module v1.0.12 from Damian Sinclair


New commands
  • Please look at the modules help files to see what is new.


Fixes
  • Made compatible again with Monkey V70 regarding removed "remove" method in lists.
  • The collision against a rotated box area didn't work correctly. Now it does!
  • subImages in TexturePacker sheets with capitalized characters in their names were not found.
  • Polygon touch check routines were fixed.


New examples
  • Physics/MouseJoint
  • Physics/RevoluteJoint



Changes in Version 1.49


Changes
  • Put the examples inside parent folders that should categorize them better.
  • Finished path/waypoint integration.
  • Finished AStar path finding.
  • The class ftTrans now lets you set the equation type and ease type of a transition.
  • ftEngine.OnSwipeDone has now an extra touchIndex parameter that tells you which touch index has fired this event. You can do now multifinger swipes.
  • Subimages in sprite sheets can be rotated now, as the flag "rotated=true" is recognized now.


New commands
  • See the ftPath and ftWaypoints class documentation for the final implementation.
  • See the ftAStar class documentation for the final implementation.
  • Various other new commands. Please look at the modules help files to see what is new.


New examples
  • Paths_Waypoints/Pathfinding

  • Object_Behaviour/ObjectTransition



Changes in Version 1.48


Changes
  • All CreateImage variants use load ftEngine.LoadImage now where it is needed. That takes care of loading an image only once.
  • Added a reset of the engine color to 255,255,255 before each render task. This should take care that the first objects color gets changed.
  • CreateTileMap:ftObject(fname:string, startX:Float, startY:Float ) now is able to load maps from a sub folder inside the data directory. Still you need to make sure, that all references of image inside the JSON file are without paths and are located inside the same folder as your JSON file.
  • All parameter types functions that don't need a return parameters were set to VOID.
  • All ftEngine.CreateSomething methods will accept an optional object parameter. This way you can extend your own object class from the ftObject class and use this. Be aware that in all event handling methods, the object will be casted into a ftObject.
  • ftObject.GetSpeed/ftObject.GetSpeedAngle now reported correct values when you used a negative speed on an object
  • layer/object transitions, object timers are not updated as long as the engine is paused (see ftEngine.SetPause)
  • Removed the "reflection" dependency by copying an object manually. That should reduce the size of the created native code again.
  • All methods are documented in a Jungle-IDE compatible style.
  • Added time scaling in timers, transitions and also object updating. Set the scale via ftEngine.SetTimeScale.


Fixes
  • ftObject.SetColWith:Int (s:Int,e:Int,b:Bool) wasn't setting an internal flag so the collision detection for all objects of a layer didn't work if you used that command.
  • Removed the double call to Cleanuplists inside ftLayer.Update.
  • ftObject.GetSpin() returned the wrong value.


New classes
  • ftBox2D  (experimental, subject of change)
    This class integrates the Box2D engine. Just make sure you have a box2D module installed. Have a look at the new example Box2DIntegration.monkey to see how it is working. Please note that you need to add another import statement "Import cftBox2D" at the top.
  • ftPath  (experimental, subject of change)
    The new path/waypoint class. It supports linear and catmull rom type of path movement between its nodes.
  • ftMarker
    A new internal class that deals with running markers on a path.
  • ftNode
    A new internal class that represends a node on a path.
  • ftImage
    A new internal class that keeps a loaded image.


New commands
  • ftEngine.CreatePath:ftPath(xp:Float, yp:Float )
  • ftEngine.GetAccelZ:Float()
    Return the accelerometer value for the Z axxis. If oyu are on a desktop, you can use the LEFT/Right key to change its values to -1/+1 accordingly.
  • ftEngine.GetObjCount:Int()
    Returns the number of objects inside the engine.
  • ftEngine.GetPause:Bool()
    Returns the isPaused flag of the engine.
  • ftEngine.GetTime:Float()
  • ftEngine.GetTimeScale:Float()
  • ftEngine.LoadImage(...)
    Loads an image from the device only if it wasn't loaded before. The image gets stored into the image list of the engine.
  • ftEngine.OnObjectSort:Int(obj1:ftObject, obj2:ftObject).
  • ftEngine.RemoveAllImages:Void(discard:Bool = False)
    Removes all images from the engines image list.
  • ftEngine.RemoveAllLayer:Void()
    Removes all layers from the engine.
  • ftEngine.RemoveImage:Void(path:string, discard:Bool = False)
    Removes the image with the given path from the image list of the engine.
  • ftEngine.RemoveImage:Void(img:Image, discard:Bool = False)
    Removes the image with the given IMAGE from the image list of the engine.
  • ftEngine.SortObjects:Void()
  • ftEngine.SortObjects:Void(layer:ftLayer)
  • ftEngine.SetPause(pauseFlag:Bool)
    Sets the isPaused flag of the engine.
  • ftEngine.SetTimeScale(timescale:Float = 1.0)
  • ftLayer.GetID:Int ()
  • ftLayer.GetTag:Int ()
  • ftLayer.SetID:Void (i:Int )
  • ftLayer.SetPosX:Void (x:Float, relative:Int = False )
  • ftLayer.SetPosY:Void (y:Float, relative:Int = False )
  • ftLayer.SetTag:Void (t:Int )
  • ftLayer.SortObjects:Void()
  • ftObject.GetPosZ:Void()
  • ftObject.GetSpeedMin:Float()
  • ftObject.GetSpeedXY:Float[]()
  • ftObject.SetMinSpeed:Void(ms:Float)
    Sets the minimum speed for objects
  • ftObject.SetPosZ(z:Float, relative:Bool = False)


New external HTML5 functions
  • GetBrowserName:String()
    Will return the name of the HTML5 browser you are playing the game on.
  • GetBrowserVersion:String()
    Will return the version number of the HTML5 browser you are playing the game on.
  • GetBrowserPlatform:String()
    Will return the platform name of the HTML5 browwser you are playing the game on.


New sample scripts
  • Box2DIntegration.monkey
  • Waypoints.monkey
  • ExtendObject.monkey
  • JuggleSoccerBall.monkey
  • SortObjects.monkey
  • ParentChild.monkey



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/classes.html b/docs/classes.html index 98c38e3..6f83c7f 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -8,5 +8,5 @@ classes.html -


Objects and classes of the fantomEngine


The following classes/objects ship with fantomEngine and will be created directly:
  • ftAStar   A* path finding
  • ftBox2D   Box2D integration
  • ftEngine   The engine class
  • ftFont   Bitmap font, based on the EZGui file format
  • Misc functions
  • ftHighScoreList   Highscore list
  • ftImageMng   fantomEngine's own image manager class
  • ftKeyMapping   Key mapping support class
  • ftLayer   Layer group objects together to handle them in one batch
  • ftLocalization   Multilanguage support class
  • Misc functions   Misc helper functions
  • ftObjAnimMng   Object animation manager class which handles the various animation of an object
  • ftObject   Object class which can be images, primitives, text, collision zones
  • ftRGBA   Class that provides color objects
  • ftScene   Class that adds scenes to fE
  • ftSound   Sound class
  • ftSpriteAtlas   Class to manage sprite sheets more easily
  • ftMapObj   Class that stores Tiled map objects
  • ftTimer   Timer class which handles ftEngine and ftObject timer
  • ftTrans   Transition class
  • ftVec2D   Class that provides 2D vector objects
  • ftPath   Path and waypoint handling

The next classes/objects are used by the fantomEngine internally:
  • ftHighScoreEntry   Highscore list entry
  • ftSwipe   Swipe class
  • ftTransEntry   Transition entry class
  • tPoints   Helper class to store a 2D vector definition
  • tLine2D   Helper class to store a 2D line definition
  • ftContactListener   Helper class for Box2D collision callbacks
  • ftMapTile   Helper class for ftObjects that represent a tile of a tile map
  • ftTileMap   Helper class for ftObjects that represent a tile map
  • ftAnimFrame   Helper class for ftAnim that represent a frame of an animation


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.


+


Objects and classes of the fantomEngine


The following classes/objects ship with fantomEngine and will be created directly:

The next classes/objects are used by the fantomEngine internally or have more of a support character:
  • ftHighScoreEntry   Highscore list entry
  • ftSwipe   Swipe class
  • ftTransEntry   Transition entry class
  • tPoints   Helper class to store a 2D vector definition
  • tLine2D   Helper class to store a 2D line definition
  • ftContactListener   Helper class for Box2D collision callbacks
  • ftMapTile   Helper class for ftObjects that represent a tile of a tile map
  • ftTileMap   Helper class for ftObjects that represent a tile map
  • ftAnimFrame   Helper class for ftAnim that represent a frame of an animation
  • ftMarker   Helper class for ftPath that represent a running object marker on a path


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/examples.html b/docs/examples.html index b941ab2..d9656d0 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -8,5 +8,5 @@ examples.html -


Example scripts


The fantomEngine module ships with some example scripts that show you the usage of a certain feature. They are located inside the examples folder located in your fantomEngine module installation.

The following topics can help you create your app with fantomEngine