getSceneName("overlay") error.

Hello,

I am trying to determine if there is an overlay opened or no. Only method I found which could help me is 

composer.getSceneName(“overlay”) which I thought will return nil or empty string in case if there is no overlay opened, but it throws error:

I/Corona  (13958): Runtime error

I/Corona  (13958): ?:0: attempt to index field ‘_currentOverlayScene’ (a nil value)

I/Corona  (13958): stack traceback:

I/Corona  (13958):     [C]: ?

I/Corona  (13958):     ?: in function 'getSceneName’

I/Corona  (13958):     ?: in function 'GoBack’

I/Corona  (13958):     ?: in function <?:258>

I/Corona  (13958):     ?: in function <?:218>

I am currently using pcall to determine is there an overlay or not, but thats not looks right.

Can you please fix this?

Looks like you have found a bug.  Can you put together a simple sample project and use the “Report a bug” link above?  Please make sure to include a build.settings and config.lua with it.

Thanks

Rob

Reported Case: 30267 if anybody else is interested.

Thanks Rob.

Looks like the error may have answered your question though. Not sure if it’s on the root object but give it a shot. To test if there is an overlay scene check if composer._currentOverlayScene is assigned. I can not check as I don’t have access to composer API.

Any method or attribute starting with an _ underscore is intended to be a private method, which means it’s subject to change in a future release.  In talking with engineering, I asked that we get a way to check if an overlay is active or not.  This specific bug is pending code review and deployment in a daily build, so hopefully soon.

Rob

Looks like you have found a bug.  Can you put together a simple sample project and use the “Report a bug” link above?  Please make sure to include a build.settings and config.lua with it.

Thanks

Rob

Reported Case: 30267 if anybody else is interested.

Thanks Rob.

Looks like the error may have answered your question though. Not sure if it’s on the root object but give it a shot. To test if there is an overlay scene check if composer._currentOverlayScene is assigned. I can not check as I don’t have access to composer API.

Any method or attribute starting with an _ underscore is intended to be a private method, which means it’s subject to change in a future release.  In talking with engineering, I asked that we get a way to check if an overlay is active or not.  This specific bug is pending code review and deployment in a daily build, so hopefully soon.

Rob