Still loving the love here, but now I have a feature request.
I generally use a single texture sheet and pull subsprites off of it. I use square texture sheets exclusively, to map to the texture beffer of Sony consoles. Since the texture space is limited, I'm always trying to save unnecessary textures.
love has the ability to rotate and scale sprites and subsprites already, which is great. But I would also really appreciate the ability to flip a sprite around the vertical axis. (flipping left to right). Most textures and characters have L/R symmetry, which means this is very broadly applicable.
Currently there are multiple cases of the draw (and draws) function. (incidentally, why is the "rotate around a non-center point" function not available for regular sprites?) And adding yet another optional parameter, while easy enough, would be potentially a bit much.
I have two options here, either of which would be fine for me:
1 - provide a function which lets me create a new image object by flipping a defined picture. Something like: flipv(myImage)
2 - define negative angles in existing draw functions as a flip, plus rotation in the positive direction. This might offend some sensibilities, since you're essentially overloading a single value with two meanings, but I feel that the two meanings complement one another well.
Thoughts?
Request new feature for draw function. - flip sprite
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 101
- Joined: Mon Aug 11, 2008 5:19 am
Re: Request new feature for draw function. - flip sprite
You should be able to flip images by using negative scaling, but for some forgotten reason, this is not implemented for subsprites.
In general, I feel that the sprite system needs a major update ... I don't think it's flexible enough. As always, suggestions towards this are welcome.
EDIT: Yes, I know this is a prime example of features that should be in the documentation. 8-)
In general, I feel that the sprite system needs a major update ... I don't think it's flexible enough. As always, suggestions towards this are welcome.
No good reason. Added to task list.(incidentally, why is the "rotate around a non-center point" function not available for regular sprites?)
EDIT: Yes, I know this is a prime example of features that should be in the documentation. 8-)
Re: Request new feature for draw function. - flip sprite
I thought rotating around a non-centre point was done using image:setCenter() and then rotating.
Or is the question "why do we have to call setCenter() on the image (stateful) and we don't have a function for that (stateless)"?
Or is the question "why do we have to call setCenter() on the image (stateful) and we don't have a function for that (stateless)"?
- Attachments
-
- rotate.love
- (76.61 KiB) Downloaded 201 times
-
- Party member
- Posts: 101
- Joined: Mon Aug 11, 2008 5:19 am
Re: Request new feature for draw function. - flip sprite
Hmmm... that's a bit unintuiative - I would have guessed that negative scale numbers would be inverses (-10 would be 1/10, -0.1 would be 10) but since inverse scale numbers can just be entered manually, I suppose they are unnecessary and thus ripe for overloading.rude wrote:You should be able to flip images by using negative scaling, but for some forgotten reason, this is not implemented for subsprites.
In general, I feel that the sprite system needs a major update ... I don't think it's flexible enough. As always, suggestions towards this are welcome.
No good reason. Added to task list.(incidentally, why is the "rotate around a non-center point" function not available for regular sprites?)
EDIT: Yes, I know this is a prime example of features that should be in the documentation. 8-)
Anyway, I look forward to the expanding functionality.
--Mr. Strange
Re: Request new feature for draw function. - flip sprite
No good reason. Added to task list.(incidentally, why is the "rotate around a non-center point" function not available for regular sprites?)
[/quote]
I was going to suggest something like setHotSpot, but if there is a setCenter, that should be adequate. I don't think it is good for the API to have a billion ways of doing the same thing. I also don't think there would be any reason to set the center (of rotation) more then once for each sprite, making it a little redundant with yet another function... but i could be wrong?
Who is online
Users browsing this forum: No registered users and 7 guests