Skip to content

Commit

Permalink
Fixes for current release
Browse files Browse the repository at this point in the history
Fixes for current release
  • Loading branch information
MikeHart66 committed Apr 22, 2018
1 parent acf4949 commit 82d4fce
Show file tree
Hide file tree
Showing 68 changed files with 590 additions and 144 deletions.
20 changes: 18 additions & 2 deletions cftEngine.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -1503,14 +1503,18 @@ The layerIndex tells fantomCX to load the tileLayer at that index. Index starts
newTileSet.spacing = spacing
newTileSet.tileheight = tlH
newTileSet.tilewidth = tlW


If obj.objImg.Length() = 0
obj.objImg = obj.objImg.Resize(1)
Endif

If tileSheetIndex > 0 Then
Local currSize:Int = obj.objImg.Length()
obj.objImg = obj.objImg.Resize(currSize + 1)
currSize = obj.tileMap.tileSets.Length()
obj.tileMap.tileSets = obj.tileMap.tileSets.Resize(currSize + 1)
Endif

obj.tileMap.tileSets[tileSheetIndex] = newTileSet

If Image.Load(dataTileSet.GetItem("image"),0.5,0.5,Image.Filter)<> Null Then
Expand Down Expand Up @@ -2546,6 +2550,17 @@ The current default file formats are:
#End
'seeAlso:OnObjectRender,RenderFlush,ftObject.ActivateRenderEvent
Method Render:Void()
Local sc:Int[4]
Local _scissor:Bool = False
Local sx :Int
Local sy :Int
Local sw :Int
Local sh :Int
sc = Self.currentCanvas.Scissor()
sx = sc[0]
sy = sc[1]
sw = sc[2]
sh = sc[3]
'#If TARGET="html5"
Self.red = 255
Self.green = 255
Expand All @@ -2562,6 +2577,7 @@ The current default file formats are:
For Local layer := Eachin layerList
If layer.isVisible And layer.isActive Then layer.Render()
Next
Self.currentCanvas.SetScissor( sx, sy ,sw , sh )
Self.currentCanvas.PopMatrix()
End
'------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion cftImageMng.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ Class ftImageManager
If newImg.img[0] = Null Then Error ("~n~nError in file cftImageMng.cxs, Method ftImageManager.LoadImage~n~nCould not load image~n~n"+path)
#End
newImg.imageNode = Self.imageList.AddLast(newImg)
tmpImg.Discard()
Endif

Return newImg
Expand Down
4 changes: 2 additions & 2 deletions cftObject.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ The returned value is the stored width multiplied by the X scale factor.
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
Expand Down Expand Up @@ -1713,7 +1713,7 @@ The returned value is the stored width multiplied by the X scale factor.
If tileIDx <> - 1 Then
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 - (Self.tileMap.tiles[tilePos].sizeY/2-Self.tileMap.tileSizeY/2)
'Print( tileSetIndex+":"+tileIDx+":"+tlxPos+":"+tlyPos+":"+tempScaleX+":"+tempScaleY)
'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)
Self.engine.currentCanvas.DrawImage( Self.objImg[tileSetIndex].img[tileIDx], tlxPos, tlyPos, drawAngle, tempScaleX, tempScaleY)
Endif
Expand Down
6 changes: 4 additions & 2 deletions examples/BaseScript/BaseScript.cxs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Class cGame Extends App
fE = New cEngine

'Set the virtual size of the canvas
fE.SetCanvasSize(800,600)
fE.SetCanvasSize(600,600)

' Get the default scene of the engine
defScene = fE.GetDefaultScene()
Expand Down Expand Up @@ -92,11 +92,13 @@ Class cGame Extends App
fE.Render()

' Now draw the current FPS value to the screen
fE.SetColor(255, 255, 0)
fE.SetColor(255, 255, 255)
fE.GetCanvas().DrawText( "FPS= "+fE.GetFPS(),fE.GetLocalX(10), fE.GetLocalY(10))
' Last, flip the previously drawn content to the screen, make it visible
fE.RenderFlush()
Else
fE.Clear( 255,0,0)
fE.SetColor(255, 255, 255)
fE.GetCanvas().DrawText("**** PAUSED ****",fE.GetLocalX(fE.GetCanvasWidth()/2.0),fE.GetLocalY(fE.GetCanvasHeight()/2.0),0.5, 0.5)
' Last, flip the previously drawn content to the screen, make it visible
fE.RenderFlush()
Expand Down
4 changes: 2 additions & 2 deletions examples/Canvas/VirtualResolution/VirtualResolution.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: VirtualResolution.monkey
Script: VirtualResolution.cxs
Description: A sample script to show how to deal with a virtual canvas size/resolution
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Buttons/Buttons.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Buttons.monkey
Script: Buttons.cxs
Description: fantomCX sample script that shows how to use the custom gui button object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Checkbox/Checkbox.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Checkbox.monkey
Script: Checkbox.cxs
Description: fantomCX sample script that shows how to use the custom gui checkbox object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
6 changes: 3 additions & 3 deletions examples/Gui/Gui_Complete/Gui_Complete.cxs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Strict

#rem
Script: Gui_Complete.monkey
Script: Gui_Complete.cxs
Description: fantomCX sample script that shows how to use the gui objects
Author: Michael Hartlef
Version: 2.01
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
#MOJO_AUTO_SUSPEND_ENABLED=True
#MOJO_IMAGE_FILTERING_ENABLED=True
#GLFW_WINDOW_TITLE="Gui_Complete.monkey"
#GLFW_WINDOW_TITLE="Gui_Complete.cxs"

'Set to false to disable webaudio support for mojo audio, and to use older multimedia audio system instead.
#HTML5_WEBAUDIO_ENABLED=True
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Joysticks/Joysticks.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Joysticks.monkey
Script: Joysticks.cxs
Description: fantomCX sample script that shows how to use the custom gui joystick object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Label/Label.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Label.monkey
Script: Label.cxs
Description: fantomCX sample script that shows how to use the custom gui label object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Listview/Listview.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Listview.monkey
Script: Listview.cxs
Description: fantomCX sample script that shows how to use the custom gui listbox object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Listview/Listview2.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Listview2.monkey
Script: Listview2.cxs
Description: fantomCX sample script that shows how to use the custom gui listbox object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Slider/Slider.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Slider.monkey
Script: Slider.cxs
Description: fantomCX sample script that shows how to use the custom gui slider object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Switch/Switch.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Switch.monkey
Script: Switch.cxs
Description: fantomCX sample script that shows how to use the custom gui switch object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Gui/Textfield/Textfield.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Textfield.monkey
Script: Textfield.cxs
Description: fantomCX sample script that shows how to use the custom gui textfield object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Input/KeyMapping/KeyMapping.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: KeyMapping.monkey
Script: KeyMapping.cxs
Description: Sample script that shows how to use the ftKeyMapping class
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Input/SwipeDetection/SwipeDetection.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: SwipeDetection.monkey
Script: SwipeDetection.cxs
Description: Example script on how to use ther swipe detection And its OnSwipeDone event
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Input/TouchInput/DragNDrop/DragNDrop.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: DragNDrop.monkey
Script: DragNDrop.cxs
Description: Sample script to show how to drag and drop and object
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Input/TouchInputEX/TouchInputEX.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: TouchInputEX.monkey
Script: TouchInputEX.cxs
Description: Sample fantomCX script, that shows how to use the extended touch events
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Layer/ScalingLayers/ScalingLayers.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: ScalingLayers.monkey
Script: ScalingLayers.cxs
Description: fantomCX sample script that shows how to scale and position layers
Author: Michael Hartlef
Version: 2.01
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Layer/ScrollingLayers/ScrollingLayers.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: ScrollingLayers.monkey
Script: ScrollingLayers.cxs
Description: This fantomCX sample script shows how to use multiple scrolling layers
Author: Douglas Williams
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Localization/Localization.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: Localization.monkey
Script: Localization.cxs
Description: Sample script that shows how to use the ftLocalization class
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Misc/MultiClass/MultiClass.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: MultiClass.monkey
Script: MultiClass.cxs
Description: This sample script shows how to split your project into several classes and files
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Misc/RunJump/RunJump.cxs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Strict

#rem
Script: RunJump.monkey
Script: RunJump.cxs
Description: This fantomCX sample script shows basics of run & jump game
Player stays in place, while clouds and enemy move
Author: Douglas Williams
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Misc/UpdateObjects/UpdateObjects.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: UpdateObjects.monkey
Script: UpdateObjects.cxs
Description: Sample script to show how to update objects based on their category
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
4 changes: 2 additions & 2 deletions examples/Objects/Appearance/9SliceScaling/9SliceScaling.cxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Strict

#rem
Script: 9ScliceScaling.monkey
Script: 9ScliceScaling.cxs
Description: Sample script that shows how to use the 9-slice image scaling feature
Author: Michael Hartlef
Version: 2.0
Version: 3.0
#End

' Set the AutoSuspend functionality to TRUE so OnResume/OnSuspend are called
Expand Down
Loading

0 comments on commit 82d4fce

Please sign in to comment.