Retrieve the stageWidth

Hello community,

I can’t retrieve the stageWidth via main.stage.stageWidth.

I have already posted an issue at github.

Is there a workaround or an alternative method for the time being?

Kind regards

The solution for that is rather simple:

The stageWidth can’t be retrieved in the main() although the main instance is already done…

I am sorry for the confusion…

You either access stageWidth by Lib.current.stage.stageWidth or first add class to display list then access stage inside of it

Ah, that’s the way…

Thank you for your reply, guruas3.

No problem. You can ask such questions in openfl discord group

1 Like

If you’re interested in joining, here’s the link:

1 Like