Can't change target fps



  • Hey, this is a bit of a weird issue but I can't convince the target frame rate to change. for example my current project.xml has the framerate set to 1 but as shown in the following images the fps that the game runs at is, in fact, way greater than 1.
    alt text
    http://image.prntscr.com/image/ac3b5af1e74c4ad0bf0c467076619625.png
    Displayed build is neko but this happens on the windows cpp target aswell

    I've tried setting vsync to false but that's no use (the massive dip in fps on the graph is from when the game was paused.).

    If anyone knows how to change that target fps in a haxeflixel project or has any idea what I'm doing wrong help would be greatly appreciated



  • How about 25, 30, 45? 1 may be too low for it to take effects


  • administrators

    You need to change the FPS via the parameter passed to new FlxGame() in Main.hx:

    http://api.haxeflixel.com/flixel/FlxGame.html?#new



  • @Gama11 That worked. I can't believe it was something so simple. what does the fps attribute in the project.xml do though. is it just a vestigial leftover from an older version?

    Also thanks a lot for your help this was driving me slowly insane.


  • administrators

    I don't think the FPS from the Project.xml affects Flixel at all. It normally sets the stage's framerate (FlxG.stage.frameRate), but Flixel overrides this value:

    https://github.com/HaxeFlixel/flixel/blob/4.2.1/flixel/FlxGame.hx#L310

    It's not so much that it's a "leftover", and more that OpenFL / Lime is responsible for the Project.xml format. It might be a good idea to at least remove it from the <window> tag of the default template to avoid confusion.



  • @Gama11 that makes sense. Either way thanks for your help I'll just make a note of this somewhere for if it comes up in the future.


Log in to reply