Help with native.showWebPopup

n00b here. This is most likely not a bug and I’m just missing something simple here, so I’m posting on this forum.

I have this very simple program, taken from Hello World:

native.showWebPopup( “http://developer.anscamobile.com/demo/hello.png” )

local textObject = display.newText( “Hello World!”, 50, 50, native.systemFont, 24 )
textObject:setTextColor( 255,255,255 )

When I run in the simulator, I see the Hello World! text, but not the Corona png.

I see this on Beta8, Beta7 and Game Edition Alpha 3. Am I doing something wrong?

Thanks. [import]uid: 7026 topic_id: 1796 reply_id: 301796[/import]

WebPopUp is not supported in the Simulator. This will work in Xcode simulator or on a device but but the image will be full screen and you won’t see the “Hello World”. Check out the online documentation to size the WebPopUp.

-Tom [import]uid: 7559 topic_id: 1796 reply_id: 5345[/import]

Thanks for the quick reply, Tom.

There were two mentions of “Note: Only available on device builds.” in the documentation of native.showWebPopup but I assumed it was referring to the parameter, not the method itself. Maybe a comment in italics below the method name on https://developer.anscamobile.com/content/native-ui-features#native.showWebPopup_ will be helpful. [import]uid: 7026 topic_id: 1796 reply_id: 5346[/import]

I agree that our documentation could be better and as we clear away our bug and feature to-do list we will have more time to clean it up.

If you start “Corona Terminal” instead of “Corona Simulator” the terminal window will display warning messages when features are not available in the Simulator. (I’m not sure if that’s widely known and maybe should be documented better.)

I’ve also updated a number of the sample apps in Beta 8 to display warning messages on the screen when something will not work in the Simulator.

Thanks,

-Tom [import]uid: 7559 topic_id: 1796 reply_id: 5350[/import]

@Tom,
I know you guys are working hard trying to cover everything, but the documentation is a little limited for WebPopups. The documentation only says this about the size of the WebPopup:

Web popups can optionally be limited to part of the screen, as opposed to the default full-screen mode. The boundaries of the webpopup are given in four optional numerical parameters:

native.showWebPopup( 10, 10, 300, 300, "http://www.anscamobile.com", {urlRequest=listener} )  

Does that mean the four optional numerical properties are boundaries like stageBoundaries (xMin, xMax, yMin, yMax)?

Also I thought I read somewhere that WebPopups would rotate when the device is rotated. That is not happening for me when I set the boundaries.

Dave
[import]uid: 8194 topic_id: 1796 reply_id: 5463[/import]

The four numeric values are x, y, width, height. Webpopup does rotate if you enable auto rotation in build.settins file. The only problem with webpopups is you can’t move the object once it’s created or rotated. You can see an example in the NativeDisplayObject sample code in Beta 8 DMG. To reposition the webpopup after rotation, I had to close and reopen the object after the rotation – not the best solution. We are looking into changing this in a future release.

-Tom [import]uid: 7559 topic_id: 1796 reply_id: 5730[/import]