Implement FPS counter toggle; Refactor options

This commit is contained in:
Saalvage
2021-03-29 01:14:51 +02:00
parent 83750098f0
commit b06e23529e
4 changed files with 207 additions and 84 deletions

View File

@ -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;
}
}