Comments (12)
Hmm... I may have omitted a step. Does this help?
view = new LanguageScreenBase();
Layout.setStageBaseDimensions(Std.int(view.width), Std.int(view.height));
addChild(view);
view.preserveChildren();
from advanced-layout.
thank you for the quickest reply i am able to get the correct size of the container but the objects aren't in the middle .
from advanced-layout.
also i forgot to mention the resolution i am using in flash - is 1280 x 720
.
Edit:
i thought may be if i convert all name and label to movie clips but it won't work.
then i tested with the single object in the middle and it is scaling and positioning perfectly.
but when i added more objects it lost positions.
from advanced-layout.
Well, it's an improvement. I'll add that to the instructions.
In the meantime, can you check the exact width and height of each object? One of them might be wider than the rest of the screen, messing up the calculation of where the center is.
from advanced-layout.
there is a bg layer filled with a white shape for the container : 1280 x 720.
and after the bg the biggest one is this title Movieclip : 653 x 66
i traced out every objects width and height in the console .
if i load it using responsive and on 1388 x 905
it seems closer to correct.
but when i modify the resolution to other it looses
from advanced-layout.
I guess my "intelligent" algorithm is even less intelligent than I thought. I'll have to look into it later.
Until I fix this, you'll just have to spell out where things should go:
//Preserving the background works fine.
//(I assume that's at index 0.)
view.getChildAt(0).preserve();
//Everything else should stay near the center.
for(i in 1...view.numChildren) {
view.getChildAt(i).stickToCenter();
}
from advanced-layout.
I found the fix : [it still needs to be fixed because if you notice it is pressing the height, but i am good with the current result, will do some hacks to make it look not pressed].
i just switched to view.preserve();
and it just scales everything correct [except height] and maintain the children's positions too.
how ever i still have an option to create the whole layout using LayoutCreator
which works good but that is really a lengthy process for me to tackle every asset from the library. [i used that in my last game].
this game have allot of screens and i am trying to save my time :D anyways if you need more tests i will try my best to provide results.
thanks
view = new LanguageScreenBase();
Layout.setStageBaseDimensions(Std.int(view.width), Std.int(view.height));
addChild(view);
//view.preserveChildren();
view.preserve();
from advanced-layout.
trying your fix !
the only thing worked is view.preserve();
Update
Result with : the new fix
from advanced-layout.
Any chance you can send me the assets for this screen so I can play around with them?
from advanced-layout.
If you want to send it privately, contact me here.
from advanced-layout.
Sent you a message there !
from advanced-layout.
Closing this since we resolved it in private.
from advanced-layout.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advanced-layout.