Log In  

Hi, I'm interested in adding a fullscreen title page to my game if possible, but since my spritesheet is full of sprites used in the game, I obviously can't fill that space with a big 128x128 image!

My current idea is to convert the cover art into ints and store it in a hardcoded array, and while on the title screen it renders the image manually pixel by pixel, but some quick maths showed me I'd probably be using over 1000 symbols for this! No good!

If anyone has any ideas I'm all ears.

Also, in the case that it's not really feasible, is there a way to at least set the cartridge's art to be an image not stored on the rom to save a bunch of space? I'd rather have the cute title screen, but if it's not possible it's not possible.

P#51979 2018-04-24 22:54 ( Edited 2018-04-25 11:58)

1

The cart image is actually just a screenshot taken while your cart is executing at the time of your choosing, meaning you can render whatever you want to the screen and set that as the image for the cart.

As for making a title screen, you're going to want to use maths to generate something or you'll want to look into graphics compression. Typically you can store a lot of data in strings then just parse the string and execute commands.
For instance:

s="L,0,0,0,15,L,0,15,15,15,L,15,15,15,0,L,15,0,0,0"

then just write a function that take's a string as an argument and reads it.

so basically when it comes to "L," it knows to draw a line, for the coordinates of the line it reads until it counts 4 more commas, so "0,0,0,15," then draws a line(0,0,0,15)

you can also encode color data and whatever else you want in the string. Since all of the instructions and data is mostly in these long strings, it doesn't take up a bunch of tokens.

P#51980 2018-04-25 00:26 ( Edited 2018-04-25 04:26)

Alright thanks, that's basically what I thought I'd have to do.

P#51993 2018-04-25 07:52 ( Edited 2018-04-25 11:52)
1

Alternative to vectors:
https://www.lexaloffle.com/bbs/?tid=27892
(same trick of using a string to store the image but in compressed format)

P#51994 2018-04-25 07:58 ( Edited 2018-04-25 11:58)

[Please log in to post a comment]