Sprite array

SGDK only sub forum

Moderator: Stef

Post Reply
Mills
Interested
Posts: 34
Joined: Fri Apr 11, 2014 11:09 pm

Sprite array

Post by Mills » Tue Jun 02, 2015 10:19 am

Hi.
I want to load this image, so that each character is a separate sprite, is this possible in sgdk?

Image:

Image

I'm using this to write short text strings using the sprites.

Thanks.

MrTamk1s
Very interested
Posts: 75
Joined: Sun Jan 04, 2015 10:27 pm
Location: Pennsylvania
Contact:

Post by MrTamk1s » Tue Jun 02, 2015 4:42 pm

It would be a better idea to simply upload the images' tiles into the VRAM slots occupied by the built-in SDGK font, instead of making each tile its own sprite. That would save precious sprite slots and require less memory overhead than using the Sprite Engine or dealing with sprites. As for those special characters (like the ones near the end), I would make a function to grab each special tile by an ID number or #define constant.
SGDK homebrew dev and Unity3D Indie dev.
Sega does what Nintendont!

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Tue Jun 02, 2015 4:58 pm

Of course you can load the image then use it to display text from sprite but as suggested MrTamk1s i think it would be better to override the default font using your image with VDP_loadFont(..) included in SGDK so you can directly use the classic drawText methods.

Mills
Interested
Posts: 34
Joined: Fri Apr 11, 2014 11:09 pm

Post by Mills » Tue Jun 02, 2015 6:02 pm

You are right, i didn't realize i could do that.
I'll just have to print every character alone whith its own x,y, to make the effect I want.

Thanks.

Post Reply