Hi, I was wondering how I can offset a costume in the Snap! editor. I noticed how it automatically centers the image I've created, however I want an image to not be in the center.
Here is an example problem:
I am making a game and I want my character to appear above my mouse. I know this is possible by moving the sprite, but that is not what I want. I want the center of the sprite to be at the feet of the character. That way I can move the sprite to my mouse, but it will appear above it.
I am moving here from Scratch, and it was possible to do this on Scratch. So I am wondering if it is also possible on Snap!.
maybe try setting an anchor to another sprite.
But then wouldn't I have to move the second sprite to a position at the feet of my character?
You can change the rotation center by right clicking on the sprite on the stage, and then clicking on pivot.
This will then show a crosshair that you can drag anywhere on the stage. This is the rotation center.
However since moving it by hand doesn't provide the best accuracy, you can actually set it through code.
Just drag out a set [ V] to [] block, and select either my > rotation x or my > rotation y
The value you set these to are coordinates on the stage, but it's still very easy to set it to the bottom of the sprite.
I will try this and will get back to you.
Alternatively, to set the rotation center for a particular costume, click on the crosshair symbol in the paint editor:
I knew that was there, I just couldn't find it for some reason, lol.
But setting it through code is still the best way to make sure that it's at a specific location.
Hi, thank you both. Mark that is what I was trying to find haha, but batman yours also solved the issue. My game is now working as I want it to, thank you!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.