Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2021-02-21 02:56:28

Multifaceted.Abnormal
Member
Registered: 2021-02-21
Posts: 10

There HAS to be a better way ... that I don't know. Yet. Right?

I'm building a game with GBDK.  I want the main menu selections to come in all fancy like (text popping in one tile at a time).  Right now, I create a bunch of sprites, load them fanciful, then quickly turn off the display, change the background to one with those sprites pre-rendered, then turn the display back on and show the selector behind the first possible option.

This works well, except there is a quick flash as the screen turns off and back on.  I figure there must be a better way to do this, right?

I am vaguely aware that it is possible to manipulate tiles directly on the background layer but I don't know how I'd cause the tiles to appear one after the other from nothingness.  In order to play with the background tiles, wouldn't they have to already be in place and then altered?  Meaning that a background tile can be changed to a nothing or blank tile, but a blank or nothing time cannot be changed to a tile that doesn't already exist and therefore already rendered to the screen.  Right?  I don't know about this right now.

It'd be neat if I could remove the need to turn off the display by causing "NEW GAME" to appear on the background layer one tile at a time.  Any pointers to how to do that would be cool, but even just a straight up yes or no on if what I'm trying to do is possible or not would be super helpful.  This FEELS like it's something that SHOULD be possible but maybe isn't?  Like just nuking tiles that aren't needed anymore really isn't a thing.

All help would be appreciated.

Thanks,
Multifaceted.Abnormal

Offline

 

#2 2021-02-21 08:23:18

Ardis
Member
From: USA
Registered: 2019-06-06
Posts: 58
Website

Re: There HAS to be a better way ... that I don't know. Yet. Right?

I can think of a few ways:
-Make the text on the sprite layer and draw the tiles individually that way. If you need the sprites freed up after that, you could switch to a background layer that has the completed text after it's completed.
-Change the specified tiles in VRAM. Have "NEW GAME" stored as a separate tilemap and make those letters the last few tiles on your completed background. Then run set_bkg_data() to partially load the text every time you want it to update the text. I haven't tested this approach, so I don't know if it will work. Just make sure that you have your initial background tiles load blank tiles where NEW GAME should go or you'll see old tiles or garbage data there.

I hope those make sense.


Also known as Arvex in other places.

Interceptor (Demo)
https://arvex.itch.io/interceptor

Offline

 

#3 2021-02-21 10:16:39

M2m
Member
Registered: 2021-02-18
Posts: 27

Re: There HAS to be a better way ... that I don't know. Yet. Right?

I think maybe something here is helpful https://github.com/Smartis2812/gbdk-text-system ?
Like the text in the Zelda textboxes ?

Offline

 

#4 2021-02-28 21:15:50

Multifaceted.Abnormal
Member
Registered: 2021-02-21
Posts: 10

Re: There HAS to be a better way ... that I don't know. Yet. Right?

M2m wrote:

I think maybe something here is helpful https://github.com/Smartis2812/gbdk-text-system ?
Like the text in the Zelda textboxes ?

No!  That's not what I was looking for at all but thanks for sharing that!  I'll have fun playing with it!

I solved the issue I was having by loading in a background that had the text and before showing the background, I set the appropriate locations to zero.  Then, I show the background with a fade in and follow that immediately with loading the text in by resetting the previous tiles to their original values.  I've created a a function that saves the tile location and information (until you overwrite it by turning another set of tiles to zero) allowing to quickly replace the tile locations with the previously used tiles.  It makes opening and closing a door an easy thing.

Cheers.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson