Suggestion: Flip and rotate

Started by Moox, Fri 01/10/2004 20:44:01

Previous topic - Next topic

Moox

Im tired of making sprites for every angle, how about an option to flip or rotate objects in game, the object windo, or the sprite windoq

SSH

You mean like the existing left-right flip option?
12

Pumaman

Generally speaking, the only thing you can do automatically is a left-right flip, which AGS currently supports in Views.

For the vast majority of sprites, any other kind of flip or rotation won't look right.

fovmester

I have one use for the rotate-thingie:

If a character for example throws something (and it isn't a dart or something similar) it'll probably rotate while flying. It will actually look kind of stiff if it DOESN'T rotate! Of course you can do an animationloop for it but it'd be much easier to just rotate one sprite.

Another use for it:
If you have some kind of pendulum which moves back and forward the rotate-command would also be useful. The pendulum doesn't necessarily have to be a grandfatherclock-pendulum but could just as well be something hanging from a thread, like a human or something. A rotate command would actually make it possible to have the human speak or do some other animation while dangling back and forward. Which would be quite hard to do with animations.

Pumaman

Rotating 90, 180 and 270 degrees would be easy enough, but rotating by any angle would create all sorts of problems -- for example, where would the pivot point be, etc.

Feel free to convince me that this would be a useful feature, but I remain skeptical for now.

fovmester

#5
Since a rotate-feature would be most useful for flying objects you could put the pivot in the center of the sprite.

Or you could tell the user to specify the pivotcoordinates as a parameter.

But what would REALLY be a good solution would be to add a pivot to every sprite. The pivot could then be specified when importing the sprite. Then you could use the pivot not only for rotating but also for aligning different size sprites in animationsequences. But I can understand if that's to much to do in one step.


Kinoko

While I can see the uses for this function, I hate the idea of specifying the pivot when importing. That really just sounds like a pain in the ass ^_^

I'd only go as far as recommending a "flip" (up/down) to go with the current "mirror" (left/right). I mean, that's just my opinion though.

Radiant

I think the easiest would be to assume the pivot is the center of the image. If the user wants it in a different position, he can always go modifying the object's x and y. I can see some use for this functionality, but you could also export your image to a paint program, rotate there, and import back. Photo Editor for instance.

fovmester

But if you have to rotate the sprite in a paint-program you'll get a lot of sprites if you want to do a spinning animation. With rotation in ags you could do it with only one sprite!

I think the pivot should be put at the bottom center of an image as default. I think this is the spot ags use as the coordinate of sprites at the moment and it works fine for characters. So if you write

player.x=100;'
player.y=100;

then the player's sprite will have its bottom center at (100,100). But it would be REALLY useful to be able to change this for reasons stated before!

Goot

When you rotate something by an angle that isn't a multiple of 90 doesn't it sort of fuzz up and look all funny? If you do it in a paint-program (assuming you have one which can do that, which I don't) you can fix up the edges where it goes all weird.

Radiant

Generally yes, but that's less of a problem in high resolutions and/or high-color environment. It's a matter of pixel alignment and anti-aliasing.

Quintaros

This is certainly a feature I would use  but one I never expected to be implemented so never bothered to suggest.  I agree that an up/down flip would be a good addition though.

Scummbuddy

look everyone, we could all just animate whatever sprite we wanted to be, in any direction, but to cause the editor to do it, is in my opinion a waste, i could see the flip horizontal, but only if its easy.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Pumaman

The rotation itself would be fairly easy to implement, but there are more practical questions as to how it would work -- would it modify the existing sprite, or would it create a dynamic sprite of the source sprite rotated to a certain angle? Or would the functionality be in the editor?

Radiant

Does Allegro have something like a BlitRotated function? I think it would be most suitable if there was a RawDrawRotated() function in AGS, and maybe a rotate_angle variable for characters (just like the .z variable). That would mean a dynamic sprite, as several characters could have the same sprite but only one would be rotated. Hm, would that be a memory hog? Just my $.02

Pumaman

Yeah, some sort of rotate_angle variable could do the trick. I'm still not sure whether enough people would find this useful in order to justify adding it, so please do reply anybody who would seriously use this in their game.

Also, just to let you guys know, I'm about to go and move house, so I won't be around here for a few weeks until I get things working at my new place.

MrColossal

rotate and resize I could use for things like credits and for my menu in Time Out

along with some sekrit things that are being worked on it could come in mega handy, mostly the rotate.

Also people could make paratrooper clones in AGS! But I think it's a feature that may not make much sense at the moment [like rawdrawing] but will be discovered by people and used quite a bit for things we've never thought of.

eric
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Jay

I'd use rotate, for a clock I'd been thinking about.

Radiant

Actually that is a good point, for anything from safecracking to Dr. Brain related games, a rotating dial would be nice. Of course you can use RawDrawLine and some sine/cosine bits to do the same, but a DrawRotated clock hand would be useful. I did a clock puzzle once and simply drew thirteen hands (yes, 13) and imported them as separate sprites.

Pumaman

So in terms of rotate, would RawDrawImageRotated be enough for most of what you guys want to do with it? Is having a rotation angle for characters really necessary?

SMF spam blocked by CleanTalk