Text boxes and sprites don't mix

darkhog

New member
TEq6my6.png


IMO engine should hide sprites while a text box is being displayed to avoid stuff like with above picture.

While I'm waiting for an official fix, does anyone know how can I disable the sprites for duration of the text box?
 

RadJunk

Administrator
Staff member
Wow. Um...the fact you are ALREADY trying to use textboxes? You are a madman! In the best possible way. I have not even mentioned how to do this yet anywhere, so that's fairly impressive!

Here's the deal. Textboxes are backgrounds. There are no "layers" proper for the NES. So nothing is being drawn "over the top" of the player like in modern game engines. The textbox engine is one of those miracles of coding that it even works somewhat dependably as it is, considering how I had to bash it around all of the other things.

If you look at where you are using the macro to invoke the box drawing, the very last byte is to show or hide sprites. The problem is, currently, it disables screen updates when drawing the box...and the screen update is the thing that hides the sprites! So...that's why the sprites don't disappear until after the box is drawn, even if you have that ticked. I'm aware of this and will get back to it soon.

Other issues with textboxes:
- if they don't line up to attributes table (a 32x32 pixel grid, rather than 16x16 of the tiles), the colors of the screen on its edges will be screwed up when the hide box routine is called.
- If you have invoked any tiles that have changed (like a door that has unlocked after defeating all the monsters), and then a text box covers that area, and then restores, it will restore the original graphics of the locked door. The collision will still be right, but the graphics are calling from the original screen that loaded.
- Overlapping the HUD area is not set to restore properly yet.
- it's slow. And it might be for a while.
- You're limited to 256 characters, and that includes next, end, etc. Eventually you'll be able to link additional text strings at the end.


Hope this helps for now! I'll be working on solutions. But I'll say it again....I'm super proud to see that it's at least intuitive enough to get this far without me even discussing it!!!!!
 

darkhog

New member
I remember some alpha/beta tutorial mentioning these (in which you made "evil wizard" npc that player was able to talk to) and I went from there. Anyway, I know that there are backgrounds, since I'm aware of NES limits and quirks pretty well, that's why I've asked for a way to disable sprites. Which file is the macro located at though? Maybe sprites can be disabled before screen updates are disabled and then later re-enabled when screen updates are enabled. Also I can see my character animating on top of textbox after it is fully displayed so maybe updates aren't disabled THAT well.
 

RadJunk

Administrator
Staff member
Unfortunately it's not that easy. But I'm aware of this as a thing, and trust me I'm on it :)
 

darkhog

New member
I see, thanks. BTW. boxes are fast enough, so don't worry about optimizing them until you don't have anything else to fix. And the way they're showing up is pretty cool as well.
 

darkhog

New member
Hm... Can you give me location in the code of the following:

- code that is doing displaying of the text box
- code that hides/restores sprites

I want to do few experiments to see if I can get it working, but need to know where these routines are located (my own research proved unfruitful).
 

Pwnu2noob

New member
I’m using my text box directly over m hud similar to the wizard tutorial. It pops up the dialog when i interact with the npc and when i close out of the dialog my hud reappears but, is missing the information. It reappears if i leave the screeen and return though.
I did the text box this way to keep it out of the play area.
Not sure if that helps at all
 

darkhog

New member
Textbox over hud is buggy right now, that's why I've put it in the playable area. Devs are aware of the issue.
 
Top Bottom