Hi all,
First of all kudos to dyson122 on a great API that really helps to leverage Tiled so that it is pretty much a level editor.
I was wondering if anyone was seeing an issue with the FPS going insanely high? I’m using storyboards and everything works fine if I load straight into the gamescene with MTE running. However if I go from a basic menu into the game menu the FPS goes up to 1000.
This also appears to happen when using the same menu to go into the storyboard demo project so I’m not sure if it’s my misunderstanding of storyboards or an issue with MTE. I’ve attached the code of the menu I go into first before the game. If you change the RotateConstrainStoryBoard demo project to load this scene first it ‘should’ replicate.
his only seems to happen when I use the widget to create buttons. If I just create an imagerect for a button it seems to be fine
cheers
local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local myData = require ("mydata") local widget = require( "widget" ) ---------------------------------------------------------------------------------- -- -- NOTE: -- -- Code outside of listener functions (below) will only be executed once, -- unless storyboard.removeScene() is called. -- --------------------------------------------------------------------------------- local buttonHandler = function( event ) myData.prevMap = nil myData.nextMap = "map1" storyboard.gotoScene("scene") end -- Called BEFORE scene has moved onscreen: function scene:willEnterScene( event ) local group = self.view local button1 = widget.newButton { id = "button2", defaultFile = "buttonYellow.png", overFile = "buttonYellowOver.png", label = "Load map", labelColor = { default = { 51, 51, 51, 255 }, }, font = "Arial", fontSize = 22, emboss = true, onEvent = buttonHandler, } button1.x = 410; button1.y = 290 group:insert(button1) end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) end -- Called when scene is about to move offscreen: function scene:exitScene( event ) end -- Called prior to the removal of scene's "view" (display group) function scene:destroyScene( event ) end --------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- "willEnterScene" event is dispatched before scene transition begins scene:addEventListener( "willEnterScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) --------------------------------------------------------------------------------- return scene