transhumandesign / kag-base

King Arthur's Gold base folder.
257 stars 119 forks source link

Functions to Easily Convert Sprites and Animations to vertices xy and uvs. #342

Open Shadowblitz16 opened 5 years ago

Shadowblitz16 commented 5 years ago

ok so I have been messing around with trying to convert a sprite animation to drawable raw Vertices, however this is more difficult to do then it seems.

I suggest that function like these to be added.. Animation::getVertices(), Animation::getVerticesXys(), Animation::getVerticesUvs(), CSprite::getAnimationVertices(string name) CSprite::getAnimationVerticesXys(string name) CSprite::getAnimationVerticesUvs(string name)

these functions would convert a sprite animation to a format that can be used in the render functions.

I know alot of people can make their own conversion functions, however doing so isn't very easy and this would make newer users able to use rendering functions even though they are low level and difficult to understand and convert to.

Shadowblitz16 commented 5 years ago

I just realized that scaling and rotations would have to be able to be applied so maybe doing something like..

note these would rotate the xys not the uvs Vertex::RotateBy(float angle) Vertex::ScaleBy(Vec2f scale)

it would also be nice if there was something for inserting array into arrays like.. Array::insertAt(uint, const T[]&in) Array::insertLast(const T[]&in) Array::insert(uint, const T[]&in)