Understanding layouting with advanced-layout



  • @player_03 I'm testing layout building with the advanced-layout lib and I'm having problems understanding few things. First of all when I'm using

    using layout.LayoutCreator.ForFlixel;
    

    The scaleMode of the app changes to PixelPerfect or Fixed, i'm not sure but it certainly is not the default Ratio mode. There is nothing about that in the documentation.
    Moreover I have created two FlxButtons in the state and I want one of them to scale with the screen so i invoke the

    .simpleScale();
    

    The effect however is that the button with the simpleScale is initially scaled down instead of being the same size as the other button without simpleScale. If I enlarge the window the button scales up but only up to a certain point.
    Can someone or @player_03 help me understand why flixel objects scale that way?
    Cheers



  • After some debugging I have found that advanced-layout uses a default scale setting where it sets the reference screen size to 800x600 no matter what window size you set for your game. The solution is to create a new instance of Layout and Scale with proper width and height, then set the layout to our custom one. It didn't take me very long time to figure that out but I wish there was a thing about it in advanced-layout documentation so I could spend that time more productively.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.