Implement FPS counter toggle; Refactor options
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxGame;
|
||||
import flixel.FlxState;
|
||||
import openfl.Assets;
|
||||
@ -70,7 +71,15 @@ class Main extends Sprite
|
||||
addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
|
||||
|
||||
#if !mobile
|
||||
addChild(new FPS(10, 3, 0xFFFFFF));
|
||||
fpsCounter = new FPS(10, 3, 0xFFFFFF);
|
||||
addChild(fpsCounter);
|
||||
toggleFPS(FlxG.save.data.fps);
|
||||
#end
|
||||
}
|
||||
|
||||
var fpsCounter:FPS;
|
||||
|
||||
public function toggleFPS(fpsEnabled:Bool):Void {
|
||||
fpsCounter.visible = fpsEnabled;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user