Giter VIP home page Giter VIP logo

Comments (12)

player-03 avatar player-03 commented on August 24, 2024

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.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

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 .

image

from advanced-layout.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

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.

player-03 avatar player-03 commented on August 24, 2024

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.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

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

image

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.

image

but when i modify the resolution to other it looses
image

from advanced-layout.

player-03 avatar player-03 commented on August 24, 2024

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.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

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();

image

from advanced-layout.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

trying your fix !

the only thing worked is view.preserve();

Update
Result with : the new fix
image

from advanced-layout.

player-03 avatar player-03 commented on August 24, 2024

Any chance you can send me the assets for this screen so I can play around with them?

from advanced-layout.

player-03 avatar player-03 commented on August 24, 2024

If you want to send it privately, contact me here.

from advanced-layout.

Gamezpedia avatar Gamezpedia commented on August 24, 2024

Sent you a message there !

from advanced-layout.

player-03 avatar player-03 commented on August 24, 2024

Closing this since we resolved it in private.

from advanced-layout.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.