Hi,
I have a GuiTexture.the pixelinset.width is 512.when change it to 100,it’s position move to left!but in inspector positions does not change!
What is the problem?how can fix it?
Thanks
Hi,
I have a GuiTexture.the pixelinset.width is 512.when change it to 100,it’s position move to left!but in inspector positions does not change!
What is the problem?how can fix it?
Thanks
EDITED (again…): GUITexture.pixelInset is the rectangle where the texture will be drawn, and its bottom-left corner coordinates are relative to the point defined by Position. If you modify width, x must be modified too in order to keep the alignment. This will keep the GUITexture at the position already defined:
guiTexture.pixelInset.width = newWidth;
guiTexture.pixelInset.x = -newWidth/2;
The same applies to height and y:
guiTexture.pixelInset.height = newHeight;
guiTexture.pixelInset.y = -newHeight/2;