Search Unity

[RELEASED] Flexbox (fast, easy layout, from HTML/CSS) in Unity 2018-2021

Discussion in 'Assets and Asset Store' started by a436t4ataf, Jun 23, 2019.

  1. Krstn

    Krstn

    Joined:
    Dec 30, 2012
    Posts:
    27
    hello, I bought it yesterday and already am happy with what I can do, apart from a single thing. I'm a bit worried as with this kind of assets there's always this 'one single thing' which makes it unusable... I hope you can help me and it's only something I have missed.

    What I'm trying to do, in css, would be the following: https://codepen.io/krstns/pen/LYLroPK
    The rows are centered, thanks to the align-content.
    Without it, in flexbox 4 unity, this is what I get: (see attachment)




    as you can see, the first row is centered in the container, not all of the rows as a group.

    Is there a workaround to make this work like with css?

    Thanks.
     

    Attached Files:

  2. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,303
    That's a bug, I'll fix it. It would help if you export your layout to (simplified) CSS and email / discord it to me: select the root container, and in the Hierarchy window right click it, select: "Flexbox > Flextensions > Output as HTML" (NB this is not full HTML export, but it has enough for debugging).

    Discord link on AssetStore is apparently broken again - Discord keeps changing something on their backend, even though the link is set to 'never expire'. New link here: https://discord.gg/4AkrDgu

    I'm guessing you're using the 3.4.2 layout algorithm (not the 4.x beta)?

    The problem is that multi-line Flexbox isn't properly defined anywhere in the CSS spec, and some of the options don't make sense. The 4.x beta algorithm is an attempt to follow what CSS org did in their examples, even when it is weird / inconsistent with reality. The 3.4.2 (standard) algorithm attempts to copy browsers - but that is often very difficult to get working!
     
  3. villaman

    villaman

    Joined:
    Apr 21, 2021
    Posts:
    34
    Hello, I recently bought Flexbox for Unity and am running into the following issue.

    When I compile it in the editor, it compiles fine. However, when I try to produce a build I get dozens of errors. Even if I remove the scene that contains the F4U components from the build, the build still fails!

    I am running Flexbox for Unity 3.6.2 and Unity 2020.2.19f1.

    Here's just a sampling of the dozens of errors.
    FlexForUnityErrors.png
     
  4. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,303
    This looks like a corrupt ASMDEF file somewhere in the project (Unity's asmdefs are still a bit buggy and not very well supported in the Editor). That shouldn't have happened with a fresh install!

    I'm away from home today, but tomorrow I'll install that exact version (2020.2.19) and see if I can reproduce.

    What platform are you building for? It should already be setup to correctly build by default to all platforms, but I usually test only for Windows + WebGL + MacOS.
     
  5. villaman

    villaman

    Joined:
    Apr 21, 2021
    Posts:
    34
    Windows 10, 64 bit. (Incidentally, above, I put the wrong Unity version. It should be 2020.3.19f1)
     
  6. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,303
    OK, easy solution :D - I fixed this before (it's a problem in the default setup I shipped Flexbox with), but for some reason the version on AssetStore doesn't have the fix. I was pretty sure I'd shipped this to AssetStore months ago, but ... well. Apparently I didn't :(, sorry.

    In Product view, go to:
    Flexbox4Unity > Local SOURCE > IntelligentPluginVersioning

    and select the asmdef:
    "IntelligentPluginVersioning"

    In the 'Define Constraints' box there is an entry something about 'ENABLE_UNITY_TESTS" or similar - select it, delete it (click the - button), and then scroll down to bottom of that inspector and hit Apply.

    ...should now build fine.

    (The issue here is that Unity - for some reason I don't understand - has a 'bonus' side effect that if you ever enable that flag they ALSO break your main builds (even though they shouldn't / don't need to). My plan was to remove this flag from the build completely - it means you cannot easily run the unit-tests, but most users don't care about the tests)
     
unityunity