Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBPro] Input Text Using BMP Font Tutorial

Author
Message
Canine FIsh
17
Years of Service
User Offline
Joined: 17th Jul 2007
Location: Australia
Posted: 12th Aug 2008 17:25 Edited at: 18th Aug 2008 13:55
Hi all,
This is my first time script I post hope you might find it useful. I use this for my game project because DBPro entry()$ command only works for string letters which is good, but no option to keyboard typing only numbers.

Please realised that I do not have Caps Lock and NumLock checking if they are active or not, which means that assuming Caps Lock always off and NumLock always on.
Also I did not use entry$() command either.
I tested on DBPro 1.68.

This code needs "Bmp Font Tutorial" Script to run.

Functions I've got so far:


Of course if you think you can make the code much cleaner and much concise, you are welcome to post your snippet here because i am not a superior coder after all and this will benefit for everyone.

Update 18/08/2008:
---------------------------
- I have fixed the code that cause of error array index out of bound
- I make code much cleaner thanks to WindowsKiller.
- Now the input_textbox has maximum number of letters in the textbox
- I modified the "BMP Font Tutorial" script that set the spacebar to display "Size / 8" instead of "Size", set both sprite and images index start at 5500 instead of 255, and set the sprites priority to 99
- Lastly I have upload examples.

http://lianjoon.tripod.com

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Aug 2008 05:26
Why are you calling this a tutorial? And I'm not sure what you mean by "DBPro does not have functions to input only numbers".


Canine FIsh
17
Years of Service
User Offline
Joined: 17th Jul 2007
Location: Australia
Posted: 13th Aug 2008 06:10
I apologized for the title. I should stated "BMP Font script" instead of "BMP Font Tutorial" because the script is taken from newsletter 59 called "BMP Font Tutorial". It is not a tutorial, but snippet. I added my input_textbox script which needed BMP Font scipt.

Quote: "
"DBPro does not have functions to input only numbers".
"

What I meant that DBPro 'entry$()' can be used to type letters, but I want to type numbers only, not letters.
I want to use this, eg. Player want to store some of his money into the bank.

http://lianjoon.tripod.com
Canine FIsh
17
Years of Service
User Offline
Joined: 17th Jul 2007
Location: Australia
Posted: 17th Aug 2008 18:33 Edited at: 17th Aug 2008 18:36
Thanks, I didnt know that about SELECT and CASE can work the way you code, that makes my life easier. The ENDIF i must have accidentally left there, sorry. I will amend and update the code soon. The one thing i need is the CapLocks and NumLock checks for this code, but i'll try to browse around this forum.

http://lianjoon.tripod.com

Login to post a reply

Server time is: 2024-11-22 07:31:13
Your offset time is: 2024-11-22 07:31:13