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
Arnim

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…
:wink:

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.
:slight_smile:

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

1 Like

If you’re interested in joining, here’s the link: https://discord.gg/tDgq8EE

1 Like