Difference between display properties

What’s the difference between display.contentWidth and display.actualContentWidth?

Welcome to the forums.

When you define a width & height in your config.lua, you are creating the values for display.contentWidth and display.contentHeight. In most cases, this is not going to match the actual device your app runs on.  Corona provides display.actualContentWidth, display.actualContentHeight as the computed actual values for what your defined content area covers.

Example: you set your width and height to 320 and 480 in config.lua. That content area is stretched to fill the actual pixels of the screen.

Let’s say you are on a 16:9 phone. Your full screen is going to be on the same scale but the extra pixels works out to 320 x 570 with the defined 320x480 in the middle of the screen and 40 extra content points on either side of center on the height side. (Config.lua is always talked about in portrait mode).  

Corona uses the content points you define rather than actual pixels as a measure of where x, y, width and height of objects are concerned.

Rob

Welcome to the forums.

When you define a width & height in your config.lua, you are creating the values for display.contentWidth and display.contentHeight. In most cases, this is not going to match the actual device your app runs on.  Corona provides display.actualContentWidth, display.actualContentHeight as the computed actual values for what your defined content area covers.

Example: you set your width and height to 320 and 480 in config.lua. That content area is stretched to fill the actual pixels of the screen.

Let’s say you are on a 16:9 phone. Your full screen is going to be on the same scale but the extra pixels works out to 320 x 570 with the defined 320x480 in the middle of the screen and 40 extra content points on either side of center on the height side. (Config.lua is always talked about in portrait mode).  

Corona uses the content points you define rather than actual pixels as a measure of where x, y, width and height of objects are concerned.

Rob