Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotating character and object graphics #995

Closed
ericoporto opened this issue Nov 26, 2019 · 4 comments
Closed

Rotating character and object graphics #995

ericoporto opened this issue Nov 26, 2019 · 4 comments
Labels
ags 4 related to the ags4 development context: graphics context: script api type: enhancement a suggestion or necessity to have something improved

Comments

@ericoporto
Copy link
Member

Sometimes, I find myself in need of rotating sprites in AGS.

In AGS though, the ags object graphics is defined by either their graphic property or the current view applied (along with frame and loop), and a character has a view set, that also decides which sprite to use for that character (again, depending on that character frame and loop). Thus, for me, rotating sprites in an AGS script api level, belongs either to the view or the viewframe - I would argue the view itself is better.

For the backend implementation of this, it appears it's best to have #968 and #967 solved so that the code is simpler to deal with.

I also found an alternative algorithm for CPU based rendering that could work IF rotated sprites were to be supported by software renderer at all (or if it still existed). https://www.ocf.berkeley.edu/~fricke/projects/israel/paeth/rotation_by_shearing.html

@ivan-mogilko ivan-mogilko added context: graphics context: script api type: enhancement a suggestion or necessity to have something improved labels Nov 26, 2019
@ghost
Copy link

ghost commented Nov 26, 2019

I also found an alternative algorithm for CPU based rendering

Just to make sure, do you know there's DynamicSprite.Rotate? CPU based rotation of a sprite is already in AGS.

The point is probably in assigning a "Rotation" property to engine objects and make that hardware accelerated. Ideally, in the end, all of them, from Character to GUI (and Cameras), should have full transform set (position, scaling and rotation).

#968 is definitely a must have.

@ericoporto
Copy link
Member Author

ericoporto commented Nov 26, 2019

Just to make sure, do you know there's DynamicSprite.Rotate? CPU based rotation of a sprite is already in AGS.

I did not knew that, thanks :)

Edit: my needs are solved by the above information, so I am using Dynamic Sprites.

@ivan-mogilko ivan-mogilko added the ags 4 related to the ags4 development label Feb 1, 2021
@ivan-mogilko
Copy link
Contributor

Ah, right, there is already a ticket; so for the reference there's a wip PR opened: #1229

@ivan-mogilko
Copy link
Contributor

Should be resolved by #1229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ags 4 related to the ags4 development context: graphics context: script api type: enhancement a suggestion or necessity to have something improved
Projects
None yet
Development

No branches or pull requests

2 participants