Can a slice be rotated?
Moderators: Bob the Hamster, marionline, SDHawk
- sheamkennedy
- Liquid Metal Slime
- Posts: 1110
- Joined: Mon Sep 16, 2013 9:29 pm
- Location: Tama-shi, Tokyo, Japan
- Contact:
Can a slice be rotated?
I was wondering if an image represented by a slice can be rotated at 90, 180 and 270 degrees. I wanted to see if I could simply use code to rotate a slice rather than drawing the image in all 4 positions.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
- sheamkennedy
- Liquid Metal Slime
- Posts: 1110
- Joined: Mon Sep 16, 2013 9:29 pm
- Location: Tama-shi, Tokyo, Japan
- Contact:
Hmm, is it perhaps possible to rotate a sprite? I can't find anything in the Plotscripting Dictionary so far. I'm assuming there must be some way to do that since it can be performed in the editor. Though I don't want to overcomplicate things if the code is too complexed.BMR wrote:To my knowledge, no they can't unfortunately.
I could be wrong though. I think they can be flipped though, but again, I could be wrong.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
- marionline
- Metal Slime
- Posts: 673
- Joined: Sat Feb 26, 2011 9:23 pm
- sheamkennedy
- Liquid Metal Slime
- Posts: 1110
- Joined: Mon Sep 16, 2013 9:29 pm
- Location: Tama-shi, Tokyo, Japan
- Contact:
Yeah I figured manually may be the way to go. It's unfortunate there isn't a simple coding function for it but I'll make due with the manual method, it'll just take me a fair bit of time to perform manual rotations of 100's of images so I thought I'd ask.marionline wrote:For a slice maybe you can rotate is manually and add it to the collection? Or do you want a rotating animation?
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
No rotation support right now.
I imagine that it would be possible. We do already have some code that is used internally for rotating sprites in the editor, but it would need a lot of clean-up and changes before it could be usable for slices.
Also, making rotation work nicely with the slice cache could be tricky also.
So no promises, but maybe someday down the line. :)
I imagine that it would be possible. We do already have some code that is used internally for rotating sprites in the editor, but it would need a lot of clean-up and changes before it could be usable for slices.
Also, making rotation work nicely with the slice cache could be tricky also.
So no promises, but maybe someday down the line. :)
- sheamkennedy
- Liquid Metal Slime
- Posts: 1110
- Joined: Mon Sep 16, 2013 9:29 pm
- Location: Tama-shi, Tokyo, Japan
- Contact:
Awesome, that would be great to see at some future point in time. Doing it manually shouldn't be a problem, it'll just take a while.Bob the Hamster wrote:No rotation support right now.
I imagine that it would be possible. We do already have some code that is used internally for rotating sprites in the editor, but it would need a lot of clean-up and changes before it could be usable for slices.
Also, making rotation work nicely with the slice cache could be tricky also.
So no promises, but maybe someday down the line.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
We already have code for rotating sprites (separate to what James mentioned) so I thought would this would be simple to add, and started doing so. Then I realised that rotating a sprite changes its width and height (unlike flipping), which is quite a large complication. I think I would like the positions of child slices anchored to the sides of a sprite to be updated when the sprite is rotated, but have the "slice width" and "slice height" commands return the original size. That's important for if we ever go ahead with the plan to allow arbitrary rotating and scaling of slices or even slice trees (like the map).
Last edited by TMC on Fri Nov 08, 2013 11:23 am, edited 1 time in total.