Search Unity

"Guide lines" with tags, display object name above objects

Discussion in 'UGUI & TextMesh Pro' started by Word, Mar 11, 2017.

  1. Word

    Word

    Joined:
    Jan 23, 2010
    Posts:
    225
    Hey,

    there are two different things I would like to do for my project, but it's quite difficult to find anything because the UI system is still pretty new I suppose.

    1) I have a few very detailed excavation drawings with "guidelines" that give a short description of the things the lines point to (see the drawing between the videos). I plan to put refined versions of these drawings in my virtual reconstruction, so when the player selects parts of these images (I will divide them so each part is a separate object), there should be some "guidelines" appearing with text when the mouse hovers over an object with the tag "guidelines", but the text/number, length and position of guidelines should be individual and changeable in the Inspector (=public) for every object with that tag, though always close to the current object and facing the camera, with a reasonable size. [I do know how to do the Mouse-Over-part]
    By "guidelines" I actually mean straight lines with text like in the blindGUI tutorial below. Sadly, blindGUI is defunct now and I was unable to find something like that for the new UI.


    In case you're wondering, a typical excavation drawing looks like this (I found this on the internet, the overall layout of the ones I have doesn't look that different, just a little nicer and more colorful :), and there are LOTS of such guidelines, so it really makes sense to split these archaeological layers into different parts):



    2) There are other objects where I just want to display the object's name slightly above the object when the mouse hovers over them, but the name should face the camera. I already tried to use a script I found here, but a) the text doesn't face the camera and b) I have to add this stuff to every single object when it would probably be easier to do this with one script that gets the object's name and puts it on some position relative to that of the object:

    I'm assuming I have to do something with Raycasts again?

    (I somewhat announced this in my previous post on the forum, but felt like a new thread was more apt, because this is quite a lot)
     
    Last edited: Mar 11, 2017