soop Posted April 22, 2020 Share Posted April 22, 2020 (edited) Hello!I want to center the Container with the preservation of the perspective and so that it always fits into the window. But Pixi Container doesn't have a constant size. How do I achieve this? Edited April 22, 2020 by soop Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 22, 2020 Share Posted April 22, 2020 (edited) Pixi doesnt have elements that have fixed width/height, containers are based on flash DisplayObjectContainer. There were many threads like this, please use search or try to read everything Basically, you have to assign width somewhere else, in your variable. If you have screen size, and you have your wanted "width" of container (which is not pixi container width), you can calculate scale to fit or cover the screen. That scale can be assigned to pixi element because scale is first-class citizen in pixi. Width isn't. This is also a basic transform exercise - one of reasons we dont provide scaling window solution. If you dont exercise with transforms, you will fail later on more difficult tasks. It wont be easy for us to explain you how to use those things later. Edited April 22, 2020 by ivan.popelyshev soop 1 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.