• What are you working on? V2
    2,001 replies, posted
I finally did it guys. When I handle a WM_KEYDOWN event in my program, I check against a boolean variable for whether text input is currently allowed, then I just get it to execute a method (passing the key parameter) that checks if the input is valid (through character codes) and adds that to a char array. [code]void CGameMain::EnterText (WPARAM wChar) { if ( (wChar>=64 && wChar<=91) || (wChar>=97 && wChar<=122)) { m_cName[m_iNameIndex] = wChar; m_iNameIndex++; m_cName[m_iNameIndex] = '\0'; } }[/code] As with most problems I face in programming, the solution is actually quite simple.
That's not a good solution. What happens when you run out of space in your array?
[QUOTE=blankthemuffin;17225332]That's not a good solution. What happens when you run out of space in your array?[/QUOTE] I could make it a dynamic array, but for the purposes of high scores and map names I want a character limit. I know it's a little crude and basic at the moment, but I was just happy to get the foundations in place. I've still got a lot of stuff to add to it, like backspace and confirmation, more validation etc.
-snip, didn't read well- Anyway, I'll probably should do more explosion-sprites. The ones I use now begin to get way too dull. Not to mention about the explosion-sound.
[QUOTE=Sasupoika;17225564]-snip, didn't read well- Anyway, I'll probably should do more explosion-sprites. The ones I use now begin to get way too dull. Not to mention about the explosion-sound.[/QUOTE] For game objects that's the best solution, I do the same. It wouldn't work too great with text though :v: Ninja'd :(
Somebody should collect the highlights of this thread for v3.
Yeah, another thread will be biting the dust soon. :-(
[QUOTE=Maurice;17226810]Somebody should collect the highlights of this thread for v3.[/QUOTE] bags not doing it again
I'll do it, I'm bored anyway.
[QUOTE=Vampired;17212476][img]http://i31.tinypic.com/5as8rd.png[/img] I'm not an artist so my gradients suck, yes. But it's supposed to look like it gets darker further into the tunnel.[/QUOTE] I really like the purple.
I hope my red man sidescroller is in there :D.
[QUOTE=Vampired;17212476][img]http://i31.tinypic.com/5as8rd.png[/img] I'm not an artist so my gradients suck, yes. But it's supposed to look like it gets darker further into the tunnel.[/QUOTE] Is that font bitstream vera sans? I want to use fonts but I'm scared to include any with my apps because of how tight the copyright stuff on them is.
Just use open source ones.
[QUOTE=Jallen;17228189]Is that font bitstream vera sans? I want to use fonts but I'm scared to include any with my apps because of how tight the copyright stuff on them is.[/QUOTE] It's actually Verdana. I guess it's just a placeholder, I haven't really thought about copyright yet
[QUOTE=nos217;17228181]I hope my red man sidescroller is in there :D.[/QUOTE] I think I missed that one, can I has link? I did scan all 50 pages though, maybe it was media tagged.
Yeah it's a video. I'll post it again as soon as my router allows me on websites other than facepunch.
Copyrights on fonts suck. Also, don't threads get closed at 2000 posts?
It should soon close.
Sorry, you need to Log In to post a reply to this thread.