Page 1 of 1

[HELP] GL2D Backgrounds?

Posted: Mon Sep 12, 2011 2:37 am
by ILOVEPIE
Is there any way i can display an image as the background of gl2d?

Re: [HELP] GL2D Backgrounds?

Posted: Mon Sep 12, 2011 10:05 pm
by mtheall
You could always use one of the background layers as a background....

Re: [HELP] GL2D Backgrounds?

Posted: Mon Sep 12, 2011 10:11 pm
by mtheall
If you really, really, really wanted, you could also use a 256x256 texture as one of your gl2d sprites and just have that sitting in the back. You could also use the "rear-plane image" texture as an alternative to using the DS's built-in 2D background engine.

Re: [HELP] GL2D Backgrounds?

Posted: Wed Sep 14, 2011 1:33 am
by ILOVEPIE
How can i do a 3d background then?

Re: [HELP] GL2D Backgrounds?

Posted: Wed Sep 14, 2011 5:33 pm
by mtheall
There are a few options. If you only want to do it in gl2d, then you can simply create a 256x256 sprite or a 256x192 sprite (if gl2d supports it). Then you would just do whatever needs to be done to make it appear behind all the other sprites. Alternatively, if gl2d does not support sprites of this size or it fails because of difficulty allocating space for them, you could split the background into smaller sprites (64x64 for example) and line them up together.

If you want to do it the 'real' way with the DS's built-in support for a 3D texture backdrop, you will need to allocate a VRAM bank for Texture Slot 2 and 3. Texture Slot 2 will hold a bitmap of the backdrop you want to display. Texture Slot 3 will hold the depth data about each pixel in the backdrop. However, this will use half of your maximum available texture memory.

Re: [HELP] GL2D Backgrounds?

Posted: Thu Sep 22, 2011 8:11 am
by relminator
The easiest way is to use a 256x256 bitmap and draw it before everything as mtheall said.
Using a bunch of 64x64 tiles would be more efficient though.
What do you mean by 3d backgrounds?