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.

DS development > Copying images to the screen

#166166 - TheMagnitude - Sat Jan 31, 2009 11:59 pm

Hey, it's been a while since I've done DS dev but I've started a new project and all I need to do is make a GUI.

The program is a calculator and I have made png images (with their respected .grit counterparts) of things like pi, cos, sin, tan, +, - etc. So that when the user presses the cos button on the touch screen the respected image is appended to the current equation at the top. So...

user presses 4

equation reads 4

user presses cos

equation reads 4cos (an image of "4" followed by an image of "cos")

user presses the pi button

equation reads 4cospi (an image of "4" followed by an image of "cos" followed by the pi symbol)

and so on and so forth.

I don't want to make all the numbers, functions, and other math symbols into sprites since they won't be doing anything, all they will be doing is sitting there in the same space.

Is there an easy way to copy the pixels from the image into either one of the DS's screens without the complex management of the OAM?

#166221 - Pete_Lockwood - Mon Feb 02, 2009 12:00 pm

If your images align on 8 pixel boundaries, sounds like tiles are an easy solution to this. I'm new to DS development so there may be a better way but I can say for sure that the tile approach will work because that's the approach I've used for something pretty similar.
_________________
It's not an illusion, it just looks like one.