Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Source] FlexLayoutGroup (aka Flexbox)/ MaxLayoutElement and Other Commons

Discussion in 'UGUI & TextMesh Pro' started by Rafael_CS, Dec 18, 2019.

  1. Rafael_CS

    Rafael_CS

    Joined:
    Sep 16, 2013
    Posts:
    161
    Hello guys,

    Just want to share my implementation of some useful UGUI elements that was missing in default unity UI.

    feel free to send me any bug/comments.

    Download: kyub.uicommons_1.0
    Support: raf.csoares@kyubinteractive.com
    Page: www.kyubinteractive.com
    License: MIT


    Flex Layout Group

    upload_2019-12-18_16-45-42.png
    upload_2019-12-18_16-46-32.png

    Flex Layout will act as a Horizontal/Vertical Layout until the row/collumn does not fit the element. In that case the element will overflow to next row/collumn.

    Max Layout Element

    upload_2019-12-18_16-41-7.png

    Max Layout Element is a wrapper of Layout Element that makes possible configure Max Values.
    ps: If you want configure a MaxValue of a Text (or TextMeshProUGUI), Set Layout Priority > 1.

    Nested Scroll Rect

    upload_2019-12-18_16-48-49.png

    Send drag axis event not captured by this ScrollRect to its parent (if 'Nested Drag Active' enable).
    If ScrollRect only capture Vertical Axis, the horizontal value will be sended Upward.

    Linear Layout Group
    upload_2019-12-18_16-50-39.png

    Like default Vertical/Horizontal LayoutGroup. Switch between just checking 'Is Vertical' Field
     
    Last edited: Dec 18, 2019
    AtlinxNet and brn_ghs like this.
  2. alexanderlarsen

    alexanderlarsen

    Joined:
    Feb 26, 2015
    Posts:
    13
    Just what I needed. That FlexLayoutGroup component should be shipped with Unity. Also always wondered why the LayoutElement doesn't support max width/height out of the box. Great work!