How to positioning guitexture always in the center ?

hi, i try to make a guitexture (like popup) that shown after a collect something

the thing that i've done, is parenting the texture to my camera GUI,i positioned it in inspector panel, but if the layer aspect is different, my teksture does'nt center, it's like drawn from the left alignment,

what must i do?


I must UN-Child

the GUITEXTURE first to ROOT and edit the inspector panel

transform : X: 0.5 Y: 0.5

Pixel inset

X : -(sizeWidth/2)

Y : -(sizeheight/2)

width : width

height :height

and below is up to you thank for FRHAYWORKS for the answer

I'm using a lot of GUITextures centered by setting their position to 0.5 X and 0.5 Y (GUITexture's position spans from 0 to 1 with 0 is the left edge and 1 the right one) and setting the pixel inset to -(size / 2), so the position 0.5/0.5 will be referred to its center.

For example if you have a texture 300x200 you should position it at 0.5/0.5/0 (Z is for layering more textures) and set the pixel inset to -150 X and -100 Y...

I hope this can help you... :)