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

Rotate coordinate space #52

Open
ronaaron opened this issue Jan 21, 2020 · 5 comments
Open

Rotate coordinate space #52

ronaaron opened this issue Jan 21, 2020 · 5 comments

Comments

@ronaaron
Copy link
Contributor

It's useful to be able to rotate the coordinate space; for example, when drawing an analog clock.

I don't see any support for that in NK; did I miss it, or is it simply not there?

@dumblob
Copy link
Member

dumblob commented Jan 21, 2020

Affine transformations are not supported currently - see vurtun/nuklear#844 (comment) and vurtun/nuklear#841 (comment) .

@ronaaron
Copy link
Contributor Author

I see. Well, it would be incredibly useful to have at least rotate and translate.

It's not currently possible to draw text at an arbitrary angle or on a path. I mean, it could be made to work by manually applying transforms, but that should be in the API IMO.

@dumblob
Copy link
Member

dumblob commented Jan 21, 2020

It's not currently possible to draw text at an arbitrary angle or on a path.

That's very advanced stuff actually.

when drawing an analog clock.

Affine transformations for arbitrary vector graphics (lines, curves, ...) is a very different world than affine transformations for fonts. So you're actually proposing significantly increase the size of the library, the API, etc. I'm not sure this'll happen any time soon. But PRs are always welcome 😉.

@ronaaron
Copy link
Contributor Author

Ah, well.

@ronaaron
Copy link
Contributor Author

ronaaron commented Aug 9, 2021

I've implemented support for rotation etc in my fork. The "NK_SPECIAL" command holds the information necessary (x,y,z,theta), and you need to add support in the back-end to handle the commands appropriately.

Here you can see an example of what the end result looks like, as implemented in 8th.

Feel free to merge my changes if you like them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants