Hi,
Just wondering if the rect transform could anchor a sprite, I tried doing it but the presets box/menu isn’t clickable anymore, so what would be a good alternative to glue the sprites on the screen?
Thanks.
Hi,
Just wondering if the rect transform could anchor a sprite, I tried doing it but the presets box/menu isn’t clickable anymore, so what would be a good alternative to glue the sprites on the screen?
Thanks.
Any reason why you can’t use the UI.Image with a screen space canvas? This is kind of what its designed for.
He/She maybe needs to use sprites for physics or etc. UI images are UIs.
You can do it definitely.
I wrote my own script to adjust orthographic or perspective camera. You only need default ortho size, default aspect ratio and screen aspect ratios and simple multiplication math.
Finally I wrote my own SpriteTransform that can handle anchors like LeftUp,RightUp,Center,etc. You need to change the position of the object (2D or 3D) with respect to the anchor type and previous procedure.
Can you tell us more about what you’re trying to achieve?
My off-the-cuff response is to add a parent GameObject at the position you want to “anchor” from, but I don’t know if that’s actually helpful because I don’t know what you’re trying to do, or why the presets box “isn’t clickable anymore” (which implies that it is present but not working, which could be for a number of reasons).
OP was last seen six months ago. Question was 18 months ago. They have either figured it out or moved on.
I do not write for a specific person!! It can help other developers as well!
Hello! Can you show the Anchor script for the sprite?