123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|537|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> NES Name Entry Screen

Sun, 05 Apr 2009, 11:29
LostUser
Hi there.

Does anybody have a NES name entry screen code for Blitz?

I am writing a game in a NES theme, and I'm wanting to re-create a NES name entry screen, similar to what you'd see in Zelda.

I can recreate everything except the cursor moving around and selecting letters to create a name.

What I'm missing are:
* The ability to move the pink rectangle cursor selector in rows and columns.
* The ability to add a letter to a name.
* There is no way at the moment to "END" character name entry or "DEL" a letter from the name.

Here's what I have.

Notes: You will require the EMULOGIC.TTF font (which is similar to the one on NES) and a keyboard scancode list.




Sun, 05 Apr 2009, 12:57
Evil Roy Ferguso

The comments try to explain what's going on. It probably isn't exactly what you want, but hopefully it would be a good starting point.

This is a good candidate for functionizing later -- it could return the name, so you could do something like player\name = NES_Name()
Tue, 07 Apr 2009, 03:57
LostUser
Thanks for the starting point, its better than what I have!

Thanks.
Thu, 09 Apr 2009, 12:27
LostUser
This NES character selection screen works really well! Thanks.

I'm wondering -- how do you prevent the hotpink cursor from selecting any blank spaces.

I have some code to capture if the name is blank, and present an error message.

I also trim the name too (to prevent lots of white spaces at the end).

However, ideally I'd like it so that the pink cursor does not select any blank spaces and just stops, or wraps around.

Thanks.
Thu, 09 Apr 2009, 18:51
Evil Roy Ferguso
What might be the easiest way to do this is to use Mod Len(letter_rows(sely)) instead of Mod ROW_LENGTH. Then, when the cursor is being moved up or down, after changing sely, check if selx >= Len(letter_rows(sely)), and if so, set it to Len(letter_rows(sely))-1.

IIRC, Blitz stores the length of strings internally, so Len() is O(1).
Sun, 12 Apr 2009, 04:12
LostUser
OK I will try this out.

What does IIRC mean?
Sun, 12 Apr 2009, 05:07
Phoenix
If I remember correctly.