Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Moox on Fri 01/10/2004 20:44:01

Title: Suggestion: Flip and rotate
Post by: Moox on Fri 01/10/2004 20:44:01
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
Title: Re: Suggestion: Flip and rotate
Post by: SSH on Fri 01/10/2004 20:48:32
You mean like the existing left-right flip option?
Title: Re: Suggestion: Flip and rotate
Post by: Pumaman on Fri 01/10/2004 21:48:53
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.
Title: Re: Suggestion: Flip and rotate
Post by: fovmester on Thu 07/10/2004 06:01:10
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.
Title: Re: Suggestion: Flip and rotate
Post by: Pumaman on Thu 07/10/2004 22:25:05
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.
Title: Re: Suggestion: Flip and rotate
Post by: fovmester on Fri 08/10/2004 06:56:18
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.

Title: Re: Suggestion: Flip and rotate
Post by: Kinoko on Fri 08/10/2004 14:25:02
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.
Title: Re: Suggestion: Flip and rotate
Post by: Radiant on Fri 08/10/2004 14:54:18
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.
Title: Re: Suggestion: Flip and rotate
Post by: fovmester on Mon 11/10/2004 06:08:38
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!
Title: Re: Suggestion: Flip and rotate
Post by: Goot on Thu 14/10/2004 01:59:56
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.
Title: Re: Suggestion: Flip and rotate
Post by: Radiant on Thu 14/10/2004 10:49:02
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.
Title: Re: Suggestion: Flip and rotate
Post by: Quintaros on Sat 16/10/2004 17:07:01
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.
Title: Re: Suggestion: Flip and rotate
Post by: Scummbuddy on Sat 16/10/2004 20:26:16
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.
Title: Re: Suggestion: Flip and rotate
Post by: Pumaman on Sat 16/10/2004 21:17:51
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?
Title: Re: Suggestion: Flip and rotate
Post by: Radiant on Sat 16/10/2004 22:54:40
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
Title: Re: Suggestion: Flip and rotate
Post by: Pumaman on Sun 17/10/2004 14:40:15
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.
Title: Re: Suggestion: Flip and rotate
Post by: MrColossal on Sun 17/10/2004 21:36:08
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
Title: Re: Suggestion: Flip and rotate
Post by: Jay on Sun 17/10/2004 22:45:55
I'd use rotate, for a clock I'd been thinking about.
Title: Re: Suggestion: Flip and rotate
Post by: Radiant on Sun 17/10/2004 23:45:57
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.
Title: Re: Suggestion: Flip and rotate
Post by: Pumaman on Wed 03/11/2004 20:10:51
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?
Title: Re: Suggestion: Flip and rotate
Post by: strazer on Wed 03/11/2004 21:15:02
That would be nice. I could use it for my rain script, if transparency is possible as well.
Title: Re: Suggestion: Flip and rotate
Post by: Maestro on Fri 05/11/2004 13:12:30
I think that rotating a sprite saves memory, 'cause you would use even more memory if you had to import all the rotated sprites you need in to AGS.
Title: Re: Suggestion: Flip and rotate
Post by: stuh505 on Fri 05/11/2004 15:35:17
QuoteI think that rotating a sprite saves memory, 'cause you would use even more memory if you had to import all the rotated sprites you need in to AGS.

that's true, for the rotating compass in my game that means I have 360 32-bit sprites...and that could be reduced down to 1 32-bit sprite.
Title: Re: Suggestion: Flip and rotate
Post by: MrColossal on Fri 05/11/2004 22:55:16
Personally I'm all about rotating objects and characters...

but whichever you decide on is, of course, fine