Problem with Getting Started Option 1

After using getting started option 1 (NPM) and choosing Haxe:

mkdir NewProject
cd NewProject
yo openfl

A project is created that has a stage that has a frameRate of 0. Setting the frameRate property of stage to 60 does nothing.

I then looked at other example projects and see that they have a project.xml file where you can easily set the fps and other properties.

How can I set the frame rate in this getting started option 1 haxe project? Why doesn’t it have a project.xml file?

Thanks

I got a very basic example working, but for some reason the project I’m trying to convert from Flash AS3 to OpenFL Haxe is not working correctly.

Edit: Now I’m having issues with my class variables being immutable. Maybe that has been the issue from the start.

Edit 2: I found a bug in my code that was causing the issue (unrelated to both issues I was asking about).

It’s worth mentioning that setting the frame rate to 0 when targeting html5 is a special case. It means that OpenFL should use the native JS requestAnimationFrame() API. That’s what most people will want.

1 Like