So, I have a grid of rectangles in my scene and I want to give it a border to visually seperate it to the others. I am currently using grid.setGridLinesVisible(true); and that works fine, but I am sure this isn't supposed to be used for that.
I tried setting a border with nodes[j][i].setStroke(Color.BLACK); and this works too, but now my whole grid is getting a lot bigger because it's drawing the border on the outside of the rectangle and therefore resizing it.
Is there a way to draw a border/stroke inside of a rectangle to keep the transformation? I already looked up the documentation but there isn't such a function.
Thanks for the help!
You can use setStrokeType for your rectangles to draw the border inside using StrokeType.Inside:
nodes[j][i].setStrokeType(StrokeType.Inside);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With