pdiddles03 Posted September 9, 2015 Share Posted September 9, 2015 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*/ Quote Link to comment Share on other sites More sharing options...
xerver Posted September 10, 2015 Share Posted September 10, 2015 https://github.com/pixijs/pixi.js/issues/1825 Quote Link to comment Share on other sites More sharing options...
pdiddles03 Posted September 10, 2015 Author Share Posted September 10, 2015 Let me just make sure, from the main stage, it is not possible to perform an action on it? That's a little goofy... Quote Link to comment Share on other sites More sharing options...
pdiddles03 Posted September 10, 2015 Author Share Posted September 10, 2015 For anyone who runs into this issue. My game is initiated by touch end. So instead of using the pixijs touchend, I used "window.ontouchend" and it worked fine. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 10, 2015 Share Posted September 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
pdiddles03 Posted September 10, 2015 Author Share Posted September 10, 2015 I just thought if I would specify, "stage.height = 500" it would be 500 pixels tall. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 10, 2015 Share Posted September 10, 2015 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. Quote Link to comment Share on other sites More sharing options...
caymanbruce Posted December 12, 2016 Share Posted December 12, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.