what happen to width?

this happen in my default images during flash screen

Code:

  1. obj.goundline = display.newRect(0,0,display.contentWidth,10)
  2. obj.goundline.anchorX = 0.5
  3. obj.goundline.x = display.contentWidth*0.5
  4. obj.goundline.y = display.contentHeight*0.9

What is the problem? Is it not centering?   It may be due to scaling issues. Use display.contentCenterX.

its centering, but my problem is the width did not fillup all width space cause i use display.contentWidth to fillup all space in width also during the flashscreen using default.png

Ah, try this

local LEFT\_X = display.screenOriginX local RIGHT\_X = display.contentWidth - display.screenOriginX local realWidth = RIGHT\_X - LEFT\_X obj.goundline = display.newRect(0,0,realWidth, 10)

ok Renato thanks :smiley:

The same may happen vertically, so here are the for 4 “real” corners…

LEFT\_X = display.screenOriginX RIGHT\_X = display.contentWidth - display.screenOriginX TOP\_Y = display.screenOriginY BOTTOM\_Y = display.contentHeight - display.screenOriginY

What is the problem? Is it not centering?   It may be due to scaling issues. Use display.contentCenterX.

its centering, but my problem is the width did not fillup all width space cause i use display.contentWidth to fillup all space in width also during the flashscreen using default.png

Ah, try this

local LEFT\_X = display.screenOriginX local RIGHT\_X = display.contentWidth - display.screenOriginX local realWidth = RIGHT\_X - LEFT\_X obj.goundline = display.newRect(0,0,realWidth, 10)

ok Renato thanks :smiley:

The same may happen vertically, so here are the for 4 “real” corners…

LEFT\_X = display.screenOriginX RIGHT\_X = display.contentWidth - display.screenOriginX TOP\_Y = display.screenOriginY BOTTOM\_Y = display.contentHeight - display.screenOriginY