Jump to content

Container Size


pdiddles03
 Share

Recommended Posts

I am using Pixi 3 and here is the issue. I am programming my game and set touch events to the stage.   Only problem is, touch events don't seem to work on the stage itself and i found out, it might be because the width and height of the stage are both 0, but yet my graphics display onscreen.  What is the issue here? even if i set the container to hav a height and width, it still returns 0. To do that i used stage.width = /*whatever size*/

Link to comment
Share on other sites

Let me just make sure, from the main stage, it is not possible to perform an action on it?  That's a little goofy...

 

No that isn't true, its just that the container is the size of its children (like a normal container) not the size of the viewport. To do viewport-level events, just bind to the canvas.

Link to comment
Share on other sites

I just thought if I would specify, "stage.height = 500" it would be 500 pixels tall.

 

Depends on what the local bounds of the object is. Containers don't have dimensions on their own, they are just arrays of children. The children define the "bounds" of the container, and we fake size information from that.

Link to comment
Share on other sites

  • 1 year later...
On 9/11/2015 at 3:48 AM, xerver said:

 

Depends on what the local bounds of the object is. Containers don't have dimensions on their own, they are just arrays of children. The children define the "bounds" of the container, and we fake size information from that.

Does that mean setting width and height of the Container will always fail? I have tried setting them in v4 but they are always 0.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...