dciabrin / ngdevkit

Open source development for Neo-Geo
GNU Lesser General Public License v3.0
262 stars 26 forks source link

How to convert Sprites via ngdevkit? #100

Open NeoGeoFreak2004 opened 11 months ago

NeoGeoFreak2004 commented 11 months ago

hey guys so anyways i am making a simple game with ngdevkit. so far i got hello world down, but now i am doing a sprite display program, but how do i convert images (ie png jpg) for graphics in my game?

dciabrin commented 11 months ago

There is no asset management in the devkit. The only tool available is titletool.py. You give it one gif whose size is a multiple of 16x16 pixels, and it converts it into a series of 16x16 tiles which can then be accessed by the hardware during rendering. Once you have your raw data chopped into blocks of 16x16 tiles, you can concatenate all your files to build the C-ROM of your cartridge. As there is no asset management per se, you need to record manually the offset of each tile in the C-ROM to configure the hardware graphics chip for rendering it on screen.

Have a look at https://github.com/dciabrin/ngdevkit-examples, there are a couple of examples that precisely cover your questions regarding sprite rendering, animated sprites rendering, background rendering.