Search Unity

Draw lines between UI elements

Discussion in 'Scripting' started by rimiki, Sep 18, 2015.

  1. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    I was looking for a while how I could rely between my UI elements image or buttons.
    And I found recently a good example for what I want to do:
    https://www.assetstore.unity3d.com/en/#!/content/22988


    Please could any body tell me the way on how I could arrive at a similar result ?

    Thank you.
     
  2. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
  3. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    I'm using Unity 5.1.3f1
     
  4. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
  5. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    I don't see the utility of the script, I attach it to the scene and nothing happen.
    Sorry I'm newbies.
     
  6. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
    add en empty gameobject wit the script attached as a child of a UI canvas

    you can add more vertices, and change the positions that way you can have your line
     
  7. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    The script draw an image in the canvas and nothing else..
     
  8. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    The goal is to draw an hierarchy of UI elements !
     
  9. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
    yes it's true!!

    you have to change it as you need
     
  10. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    What's mean I change it as I need, I mean I could create it using graphics what's the advantage?
     
  11. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
    I mean it depend on the application

    for example relying between my UI elements image or buttons

    if the buttons and the UI elements are in static position yes you can use a static graphics line

    if your UI elements change there positions (by drag or any other events) maybe using graphics is not appropriate
     
  12. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    I see. If I do static position for example to avoid problems. Could I arrive at the end to get a flexible hierarchy ?
     
  13. Simo

    Simo

    Joined:
    Sep 16, 2012
    Posts:
    85
    static position / flexible hierarchy ?!

    if you can give a simple example, would be better
     
  14. rimiki

    rimiki

    Joined:
    Dec 30, 2014
    Posts:
    102
    Sorry, it would be flexible not static..
    The example would be the video above