okay im retarded - ive been fiddling around with gui texture layout for 2 hours and I can’t seem to get it to work.
I have 4 textures, one for each corner,
I have managed to position them as 1,0 1,1 0,1 0,0 and they seem to be in the right corners - but they are off screen. pixelInset is set to
Xmin:-15
Ymin:-15
Xmax:15
Ymax:15
and all border’s are 0
further more i would like to turn a cameras guilayer off (so it stops rendering all gui objects attached to it)
I have tried GUILayer.enabled = false; but its obviously wrong
Are the gui textures completely offscreen or only partially offscreen? I’m assuming that they are partially offscreen (the midpoint of each texture is at each corner) and as such you’ll need to modify the pixel inset values for each corner separately:
left side: xmin=0, xmax=30
right side: xmin=-30, xmax=0
Using those values should place your gui textures in the corners properly. As far as disabling the GUI Layer by scripting goes I too am a bit puzzled… (sorry, still a bit of a noob myself )
Try “GetComponent(GUILayer).enabled = false;” Technically I think that’s how all components are referenced, but some stuff you can refer to directly. “GetComponent(Camera).enabled = false;” can be written as “camera.enabled = false;” for example. So when it doubt, GetComponent.
If you create a default texture (UnityWatermark-small) and set its top and left border to 800 and 600 and x position 0 and y position 1 - you will see it tile, and it seems to tile normally, it seems the problem occurs where theres transparency
The texture has to be Repeat instead of Clamp
Yes thats correct, in my tests I have also created a 6x6 texture (power of two) and have made pixel inset -3, -3, 3, 3
and i still get the same trouble
I think the border values prevent the texture from scaling,
in the case, because its not scaling it draws a larger canvas and forces the texture to fill it.
Ive been fiddling around with this all weekend - changing the pixel inset seems to produce different effects but the seem between tiles is abit wonky no matter what I do
6x6 is not a power of two. I just tried 8x8 (which is a power of two) and was able to successfully tile a GUITexture using this method. 6x6 doesn’t work right as you note. Interesting concept…not sure if it’s a bug or a feature though.