clearifing something up with sprites [SOLVED!]
clearifing something up with sprites [SOLVED!]
ok, because i was a palibber and i want to code something with sprites i'm asking here something:
first:
does 256 colors mean that you have a static specific colorset of 256 colors or that you only can use 256 different colors? i'm always saving images in 256 colors with paint without the knwoledge of what i'm doing
second:
i want to use grit, but if i look in the nds examples i can't find something that use grit. i know that the makefile has to be different but could someone provide me here a little easy example to show just one sprite using the grit converter?
first:
does 256 colors mean that you have a static specific colorset of 256 colors or that you only can use 256 different colors? i'm always saving images in 256 colors with paint without the knwoledge of what i'm doing
second:
i want to use grit, but if i look in the nds examples i can't find something that use grit. i know that the makefile has to be different but could someone provide me here a little easy example to show just one sprite using the grit converter?
Last edited by Tomdev on Fri Jan 16, 2009 4:16 pm, edited 1 time in total.
Re: clearifing something up with sprites
A 256 color sprite, also referred to as 8 bit, means that that sprite can contain up to 256 different colors. Paint is probably the worst program you can use to save to 256 color because it only uses it's own palette and does not optimize based on the colors you've used. I like mtPaint for a free simple alternative, although many use a program called Gimp, or even Photoshop, and there are several others. The key is that you can convert from 24 bit down to 8 bit and retain a great deal of your original quality, or all of it if you've used less than 256 colors.
Not real clear on grit's usage myself yet, still just getting into libnds, too. If you want to just get something on screen, you can still use the output from PAGfx if you want.
Not real clear on grit's usage myself yet, still just getting into libnds, too. If you want to just get something on screen, you can still use the output from PAGfx if you want.
Re: clearifing something up with sprites
Download the patater tutorialTomdev wrote: second:
i want to use grit, but if i look in the nds examples i can't find something that use grit. i know that the makefile has to be different but could someone provide me here a little easy example to show just one sprite using the grit converter?
http://patater.com/manual
It uses grit for all the image conversion. Look at the .grit files in the gfx folders. They're commented so it should give you a good idea of were to start.
I've never used mtPaint, so I don't know about that, but you could also check out usenti for image creation.
Re: clearifing something up with sprites
for using grit, you can look at the beginners tutorial made bij wintermute in the grit subforum:
http://forums.devkitpro.org/viewtopic.php?f=22&t=17
in short, grit takes the images from the gfx map and a grit rulefile for each image, and converts it into the right binary file and a header file that you can include in your code
http://forums.devkitpro.org/viewtopic.php?f=22&t=17
in short, grit takes the images from the gfx map and a grit rulefile for each image, and converts it into the right binary file and a header file that you can include in your code
Re: clearifing something up with sprites
ok, thanks vuurrobin, but where is this line for:
and if i want to use sprites do i have to change this line or throw it away
Code: Select all
BGCTRL[0] = BG_TILE_BASE(0) | BG_MAP_BASE(4) | BG_COLOR_256 | TEXTBG_SIZE_256x256;
Re: clearifing something up with sprites
Well, that line has nothing to do with grit nor sprites. That's a line of code that sets some registers in the background control and tells the DS some information about a particular background layer, in this case layer 0 on the main engine.
Particularly, in order of appearance, Where the graphics are located by offset amount, where the map is located by offset amount, colors and size.
Particularly, in order of appearance, Where the graphics are located by offset amount, where the map is located by offset amount, colors and size.
Re: clearifing something up with sprites
so this inits a background with the highest priority on the main graphics engine? it use the tile base 0 (where does this stands for?) is 256 colors and has a size of 256x256 if i'm right. when i looked in the patater tutorial i didn't saw this inits, they were a bit easier. so this can be done different and so yes which is the easiest way?
Re: clearifing something up with sprites
http://patater.com/files/projects/manua ... #id2613436
This is basically what corresponds to that other code, but there are some notable differences. Patater's tutorial doesn't cover a tiled background, but a 16 bit Bitmap background instead. One of the main differences between tiled and bitmap backgrounds is that a bitmap doesn't have tiles and a map, but simply a starting location for the graphics to begin. This is still referenced as the tile base or character base in some cases where a function (like the new bgInit()) can cover both types of backgrounds yet the function parameter name doesn't change. Dovoto's tutorial covers tiles backgrounds. The information on what those values mean and do are covered there (they are basically offsets to tell the DS where in memory (VRAM) to look for that data). I'm actually writing up some information on just this subject myself, as it is an area I struggled with immediately when getting into libnds. You're welcome to check my website periodically if you like (link is in my sig).
Here's Dovoto's tutorial. You want Day 4.
http://www.dev-scene.com/NDS/Tutorials
Code: Select all
REG_BG2CNT = BG_BMP16_128x128 |
BG_BMP_BASE(8) | // The starting place in memory
BG_PRIORITY(2); // A higher priority
Here's Dovoto's tutorial. You want Day 4.
http://www.dev-scene.com/NDS/Tutorials
Re: clearifing something up with sprites
thanks sylus for al your help here, i'm gonna read that and make soms notes so i don't forget anything. i wanted to know this because graphics are really important i think and i follow your site sometimes. i think it's very handy and maybe you could write some tutorials for palibbers who are switching over to libnds
Re: clearifing something up with sprites
That is entirely the idea of the site, and secondarily to make libnds easier to understand for noobs in general, with focus on learning and using the new sprite and background API functions.
I'll try to get the ball rolling a little faster on the site, but as with most people this is a hobby and I can't put near as much time into it as I'd like.
I'll try to get the ball rolling a little faster on the site, but as with most people this is a hobby and I can't put near as much time into it as I'd like.
Who is online
Users browsing this forum: No registered users and 0 guests