Box node with only border?

Hi, i want to have a box node where only the border is colored while the inside is transparent. Is there a way to do this? I tried gui.set_outline() but all I get are fully filled white boxes with no visible border. Here’s what I’ve tried:

local node = gui.new_box_node(vmath.vector3(100,100,0), vmath.vector3(100,100,0))
gui.set_outline(node, vmath.vector4(1,0,0,1))

You could use a little graphic like the one below as a texture, and add slice 9 parameters. You could then set the box to any size you need.
boxoutline

2 Likes

Benjames approach is 100% the way to do it.

You could do it without an image if you used a stencil, but there is a lot of downsides (worse performance, clunky to work with, etc) to doing it that way and zero upsides.

1 Like

Looks like the gui.set_outline() api has been removed but is still not reflected in the documentation.

gui.set_outline() works only for text nodes. Box nodes do not have this property.

Really? I’ve checked the Defold sourcecode and didn’t see this api :thinking:

Ah, sr, there is it. Thanks to know it only works for text nodes

1 Like