[CLASS] Display FPS stats, memory usage and more

In these days I am experimenting to understand Haxe and OpenFL better.

I’ve developed this simple class that shows:

  • your logo (optional)
  • the app info (optional)
  • last 30 seconds FPS graph (optional)
  • current fps
  • memory usage and peak

It’s very easy to implement (just two lines of code) and it looks good.

Check it out here
https://github.com/yupswing/akifox-lib/tree/master/com/akifox/lib/debug

if you have suggestions or comments I am here
cheers
yup

6 Likes

@singmajesty sorry Joshua, is there any reason why these fields are not available in flash target (neko, mac and ios work)

openfl.Lib.packageName
openfl.Lib.version
openfl.Lib.company

I’m using them in this class and I’ve just noticed an error building for flash

com/akifox/lib/debug/Performance.hx:114: characters 18-33 : Class<openfl.Lib> has no field packageName
com/akifox/lib/debug/Performance.hx:114: characters 51-62 : Class<openfl.Lib> has no field version
com/akifox/lib/debug/Performance.hx:114: characters 72-83 : Class<openfl.Lib> has no field company

is it better not to use them or just a bug?

On the native target, there were changes (a long time ago) that made the new native window include options for the package, version and company name. These values are then read at runtime.

I think there is a need to get information about your project/project file at runtime, more than just these values. I have been wondering if there should be access to a Haxe-based interpretation of the entire project file – not just the meta package, version and company name.

This API (openfl.Lib.packageName, etc) seems sort of wrong to me, but I cannot think exactly what API should be used, and what it should be called.

The link is broken, please re upload I want it.
Edit:
I found it: https://github.com/yupswing/plik/tree/master/com/akifox/plik/debug