Best way to draw a line Citro2d

Post Reply
Magicrafter13
Posts: 2
Joined: Mon Feb 11, 2019 6:48 pm

Best way to draw a line Citro2d

Post by Magicrafter13 » Mon Feb 11, 2019 7:29 pm

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.

User avatar
fincs
( ͡° ͜ʖ ͡°)
Posts: 38
Joined: Mon Jul 12, 2010 9:45 pm

Re: Best way to draw a line Citro2d

Post by fincs » Mon Feb 11, 2019 9:24 pm

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!

Magicrafter13
Posts: 2
Joined: Mon Feb 11, 2019 6:48 pm

Re: Best way to draw a line Citro2d

Post by Magicrafter13 » Mon Feb 11, 2019 9:32 pm

fincs wrote:
Mon Feb 11, 2019 9:24 pm
Like I said on GitHub,
Yeah, I posted here before asking on GitHub. Also sorry for submitting 2 forum posts, I didn't read the message that it had to be reviewed first, and thought the first post hadn't gone through. :lol:

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests