[HELP] GL2D Backgrounds?

Post Reply
ILOVEPIE
Posts: 2
Joined: Mon Sep 12, 2011 2:33 am

[HELP] GL2D Backgrounds?

Post by ILOVEPIE » Mon Sep 12, 2011 2:37 am

Is there any way i can display an image as the background of gl2d?

mtheall
Posts: 210
Joined: Thu Feb 03, 2011 10:47 pm

Re: [HELP] GL2D Backgrounds?

Post by mtheall » Mon Sep 12, 2011 10:05 pm

You could always use one of the background layers as a background....

mtheall
Posts: 210
Joined: Thu Feb 03, 2011 10:47 pm

Re: [HELP] GL2D Backgrounds?

Post by mtheall » Mon Sep 12, 2011 10:11 pm

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.

ILOVEPIE
Posts: 2
Joined: Mon Sep 12, 2011 2:33 am

Re: [HELP] GL2D Backgrounds?

Post by ILOVEPIE » Wed Sep 14, 2011 1:33 am

How can i do a 3d background then?

mtheall
Posts: 210
Joined: Thu Feb 03, 2011 10:47 pm

Re: [HELP] GL2D Backgrounds?

Post by mtheall » Wed Sep 14, 2011 5:33 pm

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.

relminator
Posts: 84
Joined: Sun Apr 11, 2010 10:43 am

Re: [HELP] GL2D Backgrounds?

Post by relminator » Thu Sep 22, 2011 8:11 am

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests