gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Line Drawing

#60361 - thegamefreak0134 - Wed Nov 09, 2005 4:49 pm

How do you draw just plain old regular lines (and points and such) to the display? I want to use a line drawing function to do the time in bejeweled, since it would be easier than using sprites or anything else I can think of. I'm using mode 4 for now, but will be switching to a tiled mode as I become more comfortable with the modes, so I can do other effects and stuffses. Thanks!
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#60370 - ScottLininger - Wed Nov 09, 2005 6:25 pm

I'm pretty sure some people have posted algorithms for line drawing in the past. You might try doing a forum search and see what's buried in there.

-Scott

#60381 - thegamefreak0134 - Wed Nov 09, 2005 8:10 pm

You mean there's not a function to do it already? Well, I suppose the happy register based interface would be hard pressed to work with that... oh well. I'll take a look.

Really, I don't need any diagonal lines. The bar is going to be vertical and the line needs to be fixed at the bottom and mobile at the top. I'm thinking it could be done by setting up an interupt of some sort, but that's a little too complicated for my current taste. I would much rather have a simple way to do it.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#60383 - poslundc - Wed Nov 09, 2005 8:19 pm

Line-drawing becomes significantly more complicated in tile mode. But then you can assemble a status bar by having 9 different tiles for the 9 different states of an 8-pixel vertical line segment (ranging from empty to full) and just construct your gauge by using the "full" tile for every 8 pixels up to the final segment, and then use whichever of the 9 is appropriate for the remainder.

This can be done with either a BG layer or with sprites, and consumes very little VRAM.

Dan.

#60551 - thegamefreak0134 - Fri Nov 11, 2005 6:08 pm

That sounds like a good idea. I'll be making the switch to tiles now, so I can try that. Once I get the time in, the game will be able to have a true point and purpose. Yay! It will take a while to actually test, as I have to get used to actually using tiles first. Thanks!

Um, which program would y'all recommend for actually putting a tilemap together? I want simplicity here. I don't need to worry about rotation and such, I just need tiles in one file and tile maps in another. It would also be nice to be able to determine what tiles to alter for my effect without having to go code hunting... but wait, I can do that with math... nm.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]