-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about setting the scale of a stage #1232
Comments
Scale is a Point object, so the correct assignment would be: |
Do you mean that I shouldn't use a stage, but a DisplayObjectContainer instead? |
Not at all, the Stage has to exist - it's just it's a bit of an anomaly in that while it's the root of the display list, it can't be transformed in the same way. So if you add a single DoC to the Stage, and then put your entire game contents inside of that, you'll then be able to do the things you need like scaling and rotation. |
var stage = new PIXI.Stage; |
Make sure you add all your items to |
I add all my stuff to actualWorlds instead of stage, yes. The error is weird: "Uncaught TypeError: Cannot read property '0' of undefined" |
Use the non-minified Pixi file, then you'll get an actual error + line number you have a hope of working out while keeping your sanity :) |
Using the non-minified Pixi file, it is revealed that this line is the crook: |
I'm honestly not sure without seeing your full codez :/ |
var stage = new PIXI.Stage; I only use "stage" in that very beginning. Using actualWorld for all places in my program where stage was used previously (where it worked). |
Give the Stage a color:
|
Unfortunately, giving it a color like you showed didn't have a difference. Same error, same line. |
Can we see a running example of your code and try to figure out what is wrong? |
Opps, too used to Phaser :) Try this:
|
This issue is no longer relevant due to help received in a different one. I did try to add what you said above, but I get a black screen if I change the scale of the "root". I will have to ask this differently with my new knowledge, later. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
var stage = new PIXI.Stage;
//stage.scale = new PIXI.Point(2,5);
stage.scale = 2;
Whatever I try, I can't get it to change the scale (for zooming purposes). It appears to be fixed to the default. At first, I thought this would be the same as my first question, like stage.setScale(); or something, but I've looked everywhere and can't find anything like it.
Bonus question: are all the properties readonly?
The text was updated successfully, but these errors were encountered: