problem of display.newContainer()

problem of display.newContainer()

Hi there
strange symptoms has come out in newContainer().
I run the designators in the sequence shown below.

( 1) local container = display.newContainer( display.contentWidth*2, display.contentHeight*2 )
( 2) local group = display.newGroup()
( 3) local bg1 = display.newRect( 0, 0, display.contentWidth*2, display.contentHeight*2 )
( 4) bg1:setFillColor( 1,0,0 )
( 5) group:insert( bg1 )
( 6) local bg2 = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
( 7) bg2.x = bg2.width  * 0.5
( 8) bg2.y = bg2.height * 0.5
( 9) bg2:setFillColor( 1,1,1 )
(10) group:insert( bg2 )
(11) container:insert( group )

(1), it is like to clipping the screen size
It is not by covering the entire screen if you do not double the size specified.

(11) but is the biggest problem,
(x,y,w,h) = (0,0, display.contentWidth, display.contentHeight)
part less than the x-coordinate 0 is not clipping.

y-coordinate is similar.

The symptoms or would specification.
Or Is it a known issue.

I’m using NexusOne settings simulator.
(View As NexusOne)
 

Thank you for your attention.

(I have translated into English in the Japanese google translation.)

By the way, I’m using daily build 2179.

the coordinates are of the middle.

Try this:

local container = display.newContainer( display.contentWidth, display.contentHeight ) container.x = display.contentCenterX container.y = display.contentCenterY local group = display.newGroup() local bg1 = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) bg1:setFillColor( 1,0,0 ) group:insert( bg1 ) local bg2 = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) bg2:setFillColor( 1,1,1 ) group:insert( bg2 ) container:insert( group )  

Thank you.
Sorry So it is useless …

Do not change from 0 to x-and y-coordinates of the container
exceed the range that is specified in the newContainer
The area of ​​the x-and y-coordinates less than 0
It is a problem or is clipped operating correctly.

container.x = 0
container.y = 0

Area is red bg1 Sample Code
They will be displayed beyond the range.

I leave the append part of my config.

application = {
content = {
width = 540,
height = 960,
scale = “letterbox”,
},
}を取り消す

I’m not sure using your example above what you are trying to achieve.  Containers are groups with a fixed size and a mask to clip them.  If your container is bigger than the screen (and no way to move it), then what is the purpose of clipping an area bigger than the viewport?

I think a more valid test would be to make the container half the size of the screen, or am I missing something?

Rob

not sure but seems like I had a problem with them masking correctly. i didn’t try to figure it out but kinda thought it may have been cause my content size was set to ipad size and not 320x480. I’ll try to put together an example. I may have been doing something wrong. like I said I didn’t put no effort in it when I was trying it

Was insufficient explanation.

The reason you want to clip the area that exceeds the screen size
Beyond display.contentHeight and display.contentWidth is by terminal
Terminal image from being displayed is because there.

Although I am using the SHARP IS15SH,
Symptoms that are not clipped has come out.
It does not happen in the Galaxy S2.

I was out as an example NexusOne is also a simulator on
Because I was able to confirm the same symptoms.

At the same symptoms of (1) is correct?

>>> local container = display.newContainer (display.contentWidth * 2, display.contentHeight * 2)

I think the following is correct in nature.

>>> local container = display.newContainer (display.contentWidth, display.contentHeight)

However, would have been clipped at half of the screen it’s this.

I leave the supplied sample image.

White part is the screen size.
It is a part of the red area is not clipped.

That is because you are using letterbox and the screen size is actually wider then your content area (this is to maintain aspect ration of your app). Bassically if you want to fill the whole screen you need to do this:

local container = display.newContainer (display.contentWidth - display.screenOriginX * 2, display.contentHeight - display.screenOriginY * 2)

* 2 is for left and right or top and bottom

Oh, I know!
I have appended to the code of deleurapps’s.

local container = display.newContainer (display.contentWidth, display.contentHeight)
container.x = display.contentCenterX
container.y = display.contentCenterY
local group = display.newGroup ()
local bg1 = display.newRect (display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight)
bg1: setFillColor (1,0,0)
group: insert (bg1)
local bg2 = display.newRect (display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight)
bg2: setFillColor (1,1,1)
group: insert (bg2)

-------- Add --------
group.x =-display.contentCenterX
group.y =-display.contentCenterY
-------- Add --------

container: insert (group)

As desired This red area is no longer visible.

It was not able to understand the origin of the container.
It is sorry to say that’s a problem Nantes.
Thanks to everyone!

By the way, I’m using daily build 2179.

the coordinates are of the middle.

Try this:

local container = display.newContainer( display.contentWidth, display.contentHeight ) container.x = display.contentCenterX container.y = display.contentCenterY local group = display.newGroup() local bg1 = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) bg1:setFillColor( 1,0,0 ) group:insert( bg1 ) local bg2 = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) bg2:setFillColor( 1,1,1 ) group:insert( bg2 ) container:insert( group )  

Thank you.
Sorry So it is useless …

Do not change from 0 to x-and y-coordinates of the container
exceed the range that is specified in the newContainer
The area of ​​the x-and y-coordinates less than 0
It is a problem or is clipped operating correctly.

container.x = 0
container.y = 0

Area is red bg1 Sample Code
They will be displayed beyond the range.

I leave the append part of my config.

application = {
content = {
width = 540,
height = 960,
scale = “letterbox”,
},
}を取り消す

I’m not sure using your example above what you are trying to achieve.  Containers are groups with a fixed size and a mask to clip them.  If your container is bigger than the screen (and no way to move it), then what is the purpose of clipping an area bigger than the viewport?

I think a more valid test would be to make the container half the size of the screen, or am I missing something?

Rob

not sure but seems like I had a problem with them masking correctly. i didn’t try to figure it out but kinda thought it may have been cause my content size was set to ipad size and not 320x480. I’ll try to put together an example. I may have been doing something wrong. like I said I didn’t put no effort in it when I was trying it

Was insufficient explanation.

The reason you want to clip the area that exceeds the screen size
Beyond display.contentHeight and display.contentWidth is by terminal
Terminal image from being displayed is because there.

Although I am using the SHARP IS15SH,
Symptoms that are not clipped has come out.
It does not happen in the Galaxy S2.

I was out as an example NexusOne is also a simulator on
Because I was able to confirm the same symptoms.

At the same symptoms of (1) is correct?

>>> local container = display.newContainer (display.contentWidth * 2, display.contentHeight * 2)

I think the following is correct in nature.

>>> local container = display.newContainer (display.contentWidth, display.contentHeight)

However, would have been clipped at half of the screen it’s this.

I leave the supplied sample image.

White part is the screen size.
It is a part of the red area is not clipped.

That is because you are using letterbox and the screen size is actually wider then your content area (this is to maintain aspect ration of your app). Bassically if you want to fill the whole screen you need to do this:

local container = display.newContainer (display.contentWidth - display.screenOriginX * 2, display.contentHeight - display.screenOriginY * 2)

* 2 is for left and right or top and bottom