Search Unity

9-slice textured plane (in 3D)?

Discussion in 'Scripting' started by JoeStrout, Aug 29, 2014.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I want to make a sort of alert appear in 3D space, using TextMesh Pro for the text and some sort of textured plane or quad for the background.

    My question is about the background... I'd like to use a 9-slice texture, so the texture size itself can be kept small while still having smooth edges. This should be easy enough; a mesh of 9 quads (18 triangles) with the UV values set appropriately would do it. No need for actually slicing the image or anything.

    But before I run off and code something, I always google for existing solutions, and was surprised that I couldn't find any. Surely others have done this before? Or is there a built-in feature I'm overlooking?

    Thanks,
    - Joe
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    If you're comfortable with jumping to a beta (which is pretty stable for a beta), you could use the newly built-in GUI with a World Space Canvas to accomplish this.

    Failing that, it's not hard to code yourself (I've done it a couple of times) and you're clearly on the right track if you want to continue on that route.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Thanks for the tip about the World Space Canvas — I am excited about the new beta, but for this project I think I'm going to stick to 4.5.