-
Notifications
You must be signed in to change notification settings - Fork 14
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
How to make a polygon from points? #3
Comments
There may be a better way to do this and if there is, I would LOVE to know! But here is what I've come up with so far.... In TFTShapeBuilder.h I added this inside the struct:
In TFTShapeBuilder.cpp I added this at the end of the file:
Then in my .ino file I can do this:
My plan is to be able to store those points in a json packet, then just deserialize the arrays and pass them into the buildPolygon() method. |
One problem I've run into is the .fill() method doesn't seem to work with this. This doesn't work:
But this DOES work:
Also this DOES work:
So there is something wrong with my buildPolygon() function or the .fill() method. |
@zenmanenergy would this help ? [edit] also this |
I am struggling to figure out how to make a polygon from an array of points (that will ultimately come from a json packet). From looking at the code it appears the "ngon" is essentially what I'm looking for but I don't want a standarnd: triangle, rectangle, pentagon etc. I just want to pass in an array of x's and y's and have it draw it. Can you point me in the right direction?
The text was updated successfully, but these errors were encountered: