Can a slice be rotated?

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
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?

Post by sheamkennedy »

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
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

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.
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

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.
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.
⊕ 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
User avatar
marionline
Metal Slime
Posts: 673
Joined: Sat Feb 26, 2011 9:23 pm

Post by marionline »

For a slice maybe you can rotate is manually and add it to the collection? Or do you want a rotating animation?
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

marionline wrote:For a slice maybe you can rotate is manually and add it to the collection? Or do you want a rotating animation?
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.
⊕ 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
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

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. :)
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

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. :)
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.
⊕ 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
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

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.
Post Reply