Simulator Not Displaying Correctly in Adaptive Mode

Hi guys,

In ‘adaptive’ mode (see config.lua).

I notice a big difference in the simulator screen and the real device (screen shots shown are for Samsung S3, simulator and real device).

Project : Sample Code NativeDisplayObjects

Simulator Version : 2014.2511

Is there some sort of configuration that must be done in the simulator (besides config.lua) ?

Here’s the config.lua file :

application = {         content =         {                 width = 320,                 height = 480,                 scale = "adaptive"         }, } 

Thanks

Can you put in some print statements and see what values you are getting for display.contentWidth and display.contentHeight?

Logs :

In Simulator : display.contentWidth    480 display.contentHeight   800 display.actualContentWidth      480 display.actualContentHeight     800 display.viewableContentWidth    480 display.viewableContentHeight   800 Real Device : I/Corona  (30544): display.contentWidth 360 I/Corona  (30544): display.contentHeight        640 I/Corona  (30544): display.actualContentWidth   360 I/Corona  (30544): display.actualContentHeight  640 I/Corona  (30544): display.viewableContentWidth 360 I/Corona  (30544): display.viewableContentHeight        640

thanks Rob. Seems there is a difference in the display width & height.

When I set the simulator to a custom screen (360x640), it looks like the real device (screen shot attached).

Why is the simulator Samsung S3 set to 480x800 ?

Can you do the same thing getting the values for the system.getInfo() entries for everything doing with the Android device size DPI’s, Inches, etc.

Thanks

Rob

Sorry for the lateness. Here’s the print out from the real device :

I/Corona  (19867): androidDisplayApproximateDpi 320 I/Corona  (19867): androidDisplayDensityName    xhdpi I/Corona  (19867): androidDisplayWidthInInches  2.3622048190141 I/Corona  (19867): androidDisplayHeightInInches 4.1732416493955 I/Corona  (19867): androidDisplayXDpi   304.79998779297 I/Corona  (19867): androidDisplayYDpi   306.71600341797 I/Corona  (19867): architectureInfo     ARM Neon I/Corona  (19867): GL\_VENDOR    ARM I/Corona  (19867): GL\_RENDERER  Mali-400 MP I/Corona  (19867): GL\_VERSION   OpenGL ES 2.0 I/Corona  (19867): GL\_SHADING\_LANGUAGE\_VERSION  OpenGL ES GLSL ES 1.00 I/Corona  (19867): GL\_EXTENSIONS        GL\_EXT\_debug\_marker GL\_OES\_texture\_npot GL\_OES\_compressed\_ETC1\_RGB8\_texture GL\_OES\_standard\_derivatives GL\_OES\_EGL\_image  GL\_OES\_depth24 GL\_ARM\_rgba8 GL\_ARM\_mali\_shader\_binary GL\_OES\_depth\_texture GL\_O ES\_packed\_depth\_stencil GL\_EXT\_texture\_format\_BGRA8888 GL\_EXT\_blend\_minmax GL\_OE S\_EGL\_image\_external GL\_OES\_EGL\_sync GL\_OES\_rgb8\_rgba8 GL\_EXT\_multisampled\_rende r\_to\_texture GL\_EXT\_discard\_framebuffer GL\_OES\_get\_program\_binary GL\_ARM\_mali\_pr ogram\_binary GL\_EXT\_shader\_texture\_lod GL\_EXT\_robustness GL\_OES\_depth\_texture\_cu be\_map I/Corona  (19867): gpuSupportsHighPrecisionFragmentShaders      false I/Corona  (19867): iosIdentifierForVendor       nil I/Corona  (19867): model        GT-I9300 I/Corona  (19867): platformName Android I/Corona  (19867): platformVersion      4.3 I/Corona  (19867): maxTextureSize       4096 I/Corona  (19867): maxTextureUnits      nil I/Corona  (19867): targetAppStore       google I/Corona  (19867): textureMemoryUsed    0 I/Corona  (19867): version      3.0.0

For those who are searching for this function that prints out all the getInfo :

local function printAllInfo() print( "androidDisplayApproximateDpi", system.getInfo( "androidDisplayApproximateDpi" ) ) print( "androidDisplayDensityName", system.getInfo( "androidDisplayDensityName" ) ) print( "androidDisplayWidthInInches", system.getInfo( "androidDisplayWidthInInches" ) ) print( "androidDisplayHeightInInches", system.getInfo( "androidDisplayHeightInInches" ) ) print( "androidDisplayXDpi", system.getInfo( "androidDisplayXDpi" ) ) print( "androidDisplayYDpi", system.getInfo( "androidDisplayYDpi" ) ) print( "architectureInfo", system.getInfo( "architectureInfo" ) ) print( "GL\_VENDOR", system.getInfo( "GL\_VENDOR" ) ) print( "GL\_RENDERER", system.getInfo( "GL\_RENDERER" ) ) print( "GL\_VERSION", system.getInfo( "GL\_VERSION" ) ) print( "GL\_SHADING\_LANGUAGE\_VERSION", system.getInfo( "GL\_SHADING\_LANGUAGE\_VERSION" ) ) print( "GL\_EXTENSIONS", system.getInfo( "GL\_EXTENSIONS" ) ) print( "gpuSupportsHighPrecisionFragmentShaders", system.getInfo( "gpuSupportsHighPrecisionFragmentShaders" ) ) print( "iosIdentifierForVendor", system.getInfo( "iosIdentifierForVendor" ) ) print( "model", system.getInfo( "model" ) ) print( "platformName", system.getInfo( "platformName" ) ) print( "platformVersion", system.getInfo( "platformVersion" ) ) print( "maxTextureSize", system.getInfo( "maxTextureSize" ) ) print( "maxTextureUnits", system.getInfo( "maxTextureUnits" ) ) print( "targetAppStore", system.getInfo( "targetAppStore" ) ) print( "textureMemoryUsed", system.getInfo( "textureMemoryUsed" ) ) print( "version", system.getInfo( "version" ) ) end printAllInfo()

Interesting, I just changed the NativeDisplayObjects sample app to adaptive and looked at it in the S3 skin and it matches the device.  It appears to work on my Mac.  You’re on Windows.  Let me see if I can get someone else to test this.

Rob

Engineering is on this.

Rob

Can you put in some print statements and see what values you are getting for display.contentWidth and display.contentHeight?

Logs :

In Simulator : display.contentWidth    480 display.contentHeight   800 display.actualContentWidth      480 display.actualContentHeight     800 display.viewableContentWidth    480 display.viewableContentHeight   800 Real Device : I/Corona  (30544): display.contentWidth 360 I/Corona  (30544): display.contentHeight        640 I/Corona  (30544): display.actualContentWidth   360 I/Corona  (30544): display.actualContentHeight  640 I/Corona  (30544): display.viewableContentWidth 360 I/Corona  (30544): display.viewableContentHeight        640

thanks Rob. Seems there is a difference in the display width & height.

When I set the simulator to a custom screen (360x640), it looks like the real device (screen shot attached).

Why is the simulator Samsung S3 set to 480x800 ?

Can you do the same thing getting the values for the system.getInfo() entries for everything doing with the Android device size DPI’s, Inches, etc.

Thanks

Rob

Sorry for the lateness. Here’s the print out from the real device :

I/Corona  (19867): androidDisplayApproximateDpi 320 I/Corona  (19867): androidDisplayDensityName    xhdpi I/Corona  (19867): androidDisplayWidthInInches  2.3622048190141 I/Corona  (19867): androidDisplayHeightInInches 4.1732416493955 I/Corona  (19867): androidDisplayXDpi   304.79998779297 I/Corona  (19867): androidDisplayYDpi   306.71600341797 I/Corona  (19867): architectureInfo     ARM Neon I/Corona  (19867): GL\_VENDOR    ARM I/Corona  (19867): GL\_RENDERER  Mali-400 MP I/Corona  (19867): GL\_VERSION   OpenGL ES 2.0 I/Corona  (19867): GL\_SHADING\_LANGUAGE\_VERSION  OpenGL ES GLSL ES 1.00 I/Corona  (19867): GL\_EXTENSIONS        GL\_EXT\_debug\_marker GL\_OES\_texture\_npot GL\_OES\_compressed\_ETC1\_RGB8\_texture GL\_OES\_standard\_derivatives GL\_OES\_EGL\_image  GL\_OES\_depth24 GL\_ARM\_rgba8 GL\_ARM\_mali\_shader\_binary GL\_OES\_depth\_texture GL\_O ES\_packed\_depth\_stencil GL\_EXT\_texture\_format\_BGRA8888 GL\_EXT\_blend\_minmax GL\_OE S\_EGL\_image\_external GL\_OES\_EGL\_sync GL\_OES\_rgb8\_rgba8 GL\_EXT\_multisampled\_rende r\_to\_texture GL\_EXT\_discard\_framebuffer GL\_OES\_get\_program\_binary GL\_ARM\_mali\_pr ogram\_binary GL\_EXT\_shader\_texture\_lod GL\_EXT\_robustness GL\_OES\_depth\_texture\_cu be\_map I/Corona  (19867): gpuSupportsHighPrecisionFragmentShaders      false I/Corona  (19867): iosIdentifierForVendor       nil I/Corona  (19867): model        GT-I9300 I/Corona  (19867): platformName Android I/Corona  (19867): platformVersion      4.3 I/Corona  (19867): maxTextureSize       4096 I/Corona  (19867): maxTextureUnits      nil I/Corona  (19867): targetAppStore       google I/Corona  (19867): textureMemoryUsed    0 I/Corona  (19867): version      3.0.0

For those who are searching for this function that prints out all the getInfo :

local function printAllInfo() print( "androidDisplayApproximateDpi", system.getInfo( "androidDisplayApproximateDpi" ) ) print( "androidDisplayDensityName", system.getInfo( "androidDisplayDensityName" ) ) print( "androidDisplayWidthInInches", system.getInfo( "androidDisplayWidthInInches" ) ) print( "androidDisplayHeightInInches", system.getInfo( "androidDisplayHeightInInches" ) ) print( "androidDisplayXDpi", system.getInfo( "androidDisplayXDpi" ) ) print( "androidDisplayYDpi", system.getInfo( "androidDisplayYDpi" ) ) print( "architectureInfo", system.getInfo( "architectureInfo" ) ) print( "GL\_VENDOR", system.getInfo( "GL\_VENDOR" ) ) print( "GL\_RENDERER", system.getInfo( "GL\_RENDERER" ) ) print( "GL\_VERSION", system.getInfo( "GL\_VERSION" ) ) print( "GL\_SHADING\_LANGUAGE\_VERSION", system.getInfo( "GL\_SHADING\_LANGUAGE\_VERSION" ) ) print( "GL\_EXTENSIONS", system.getInfo( "GL\_EXTENSIONS" ) ) print( "gpuSupportsHighPrecisionFragmentShaders", system.getInfo( "gpuSupportsHighPrecisionFragmentShaders" ) ) print( "iosIdentifierForVendor", system.getInfo( "iosIdentifierForVendor" ) ) print( "model", system.getInfo( "model" ) ) print( "platformName", system.getInfo( "platformName" ) ) print( "platformVersion", system.getInfo( "platformVersion" ) ) print( "maxTextureSize", system.getInfo( "maxTextureSize" ) ) print( "maxTextureUnits", system.getInfo( "maxTextureUnits" ) ) print( "targetAppStore", system.getInfo( "targetAppStore" ) ) print( "textureMemoryUsed", system.getInfo( "textureMemoryUsed" ) ) print( "version", system.getInfo( "version" ) ) end printAllInfo()

Interesting, I just changed the NativeDisplayObjects sample app to adaptive and looked at it in the S3 skin and it matches the device.  It appears to work on my Mac.  You’re on Windows.  Let me see if I can get someone else to test this.

Rob

Engineering is on this.

Rob