I want to draw lines in a program I am currently experimenting with. I notice that Citro2d has built in functions for rectangles, triangles, and ellipses, but not for basic lines. Is there an easy way to do this? I had one idea, where I took a 1x1 white png and I was going to draw it to the display and rotate and stretch it, and I was going to shade it different colors, but I don't know how to make a C2D_ImageTint.
So again, is there any easy way to draw lines from (x1, y1) to (x2, y2)? Preferably with different colors.
1x1 rectangles next to each other is not an option, as the lines will be dynamic (moveable), and I can't have that much of a performance hit.
Best way to draw a line Citro2d
Re: Best way to draw a line Citro2d
Like I said on GitHub, lines cannot be drawn efficiently on the PICA200. You'd have to either draw degenerate triangles (I'm not sure if those work at all), or draw rotated rectangles. That is the reason why there is no DrawLine command. The main motivation for citro2d was creating a helper library that would allow users to perform common 2D tasks _efficiently_ on the PICA200. Adding a feature that is inefficient is against the design goals of citro2d.
Donate to devkitPro - help us stay alive!
-
- Posts: 2
- Joined: Mon Feb 11, 2019 6:48 pm
Who is online
Users browsing this forum: No registered users and 0 guests