Home Forums IRC Chat Resources FAQ

Welcome Guest ( Log In | Register )

modding *chan irc utilities downloads filehost pastebin[Big|Medium|Small] -
 Menu
Content
Board index
Register
The team
Help
FAQ
BBCode FAQ
Terms of use
Privacy policy

 Board style

 Affiliates
Image

Image

Image

Image

 Top Posters
Username Posts
Venetia 24133
mouse 20476
Alan Davies 13583
blink_ 10661
moog 10088

 Newest members
Username Joined
aliatom 02 Sep
ghostinthemachine 02 Sep
da_aya 02 Sep
powerhcm8 01 Sep

Welcome
Welcome to Home Brew Games. Registration is simple and free, and gives you access to the whole site. Why not check out our resource manager, our scripting forums, project boards, and everything else we have to offer? We have a team of dedicated staff at hand who are interested and experienced in indie gaming. Any game engine is allowed, though our RPG Maker boards have been the largest of their kind for many years. We have a rich history, and promise a rich future too!

Latest news
View the latest post Gus' Text Input Module
Posted by: Gu574v0 » Wed Sep 01, 2010 10:40 am Forum: Scripts

Gus' Text Input Module Version: 1.00
By: Gustavo Bicalho (Gu574v0; Gust)


Introduction

Gus' Text Input Module (GTI) is an input module to complement the old ones. It provides a way to capture key presses like a text editor would: with special signs, diacritical marks and respecting the keyboard layout. The old input modules can't do that, so they are not appropriate for text input (like allowing the player to write a name or a memo).
On the other side, this input module doesn't track key-ups and downs, so it's not really appropriate for normal game play because you can't get the current state of a key, you can only know which characters were typed since the last update; and it will only pick key presses that create characters.
But anyway, GTI won't break any input system, so it can be used together with them.

That said, my advice: use a good old input module (or just the default one) for general gameplay, and activate GTI whenever you need text input.

I don't know exactly how many people out there wanted to let the player type something and couldn't, but I hope this can be used to make user interface friendlier.

Features

  • Characters typed are read correctly, accordingly to the keyboard layout.
  • Won't break the old input modules (unless they have a DLL that also messes with the window procedures, but I don't think any of them does that. Anyway, if that is the case, placing GTI under those scripts should solve the problem.)
  • The module is updated automatically by the Input module.


Script
Download of the DLL
DLL Source Code (if you want to check it out)

Expand to see the code.


Instructions

Place this script above Main, and below the default scripts (and below any scripts with custom DLLs that mess with the window). Place the GusTextInput.dll in the same directory as Game.exe.
Whenever you need text input, call GTI.start to start the event processing. You can just leave it running through the whole game, or activate it only in Scenes where you need it and then call GTI.stop to stop it. The latter is probably the best if you need performance.
Anyway, once you activate it, you can get the event list (an array) from GTI.events at each update. The list is cleared when the module is updated, so each frame you get only the event of that frame. You can then iterate through the list, processing each event (the first of the list happened first and therefore should be processed first. Just use an each statement).

Below is an example of how Scene_Name could be implemented using GTI:
Expand to see the code.


Terms and Conditions


  • You can redistribute and change this script and the DLL as you wish, as long as you give credit to me (Gustavo Bicalho) as the original creator.


Views: 106  •  Comments: 15  •  Write comments [ Back ] Top


Who is online
Who is online In total there are 137 users online :: 39 trolls, 0 hidden and 98 guests (based on users active over the past 120 minutes)
Most trolls ever online was 521 on Wed Apr 02, 2008 6:25 am

Registered users: Alexander Morou, Ask Jeeves [Bot], Baidu [Spider], benos, berka, blink_, calvin624, Celesinator, Charlie Fleed, creamdonut, dadevster, demuirge, dricc, eatpie75, Exabot [Bot], Fayte, Fenwick, fox5, friend, Glitchfinder, Google [Bot], Google Adsense [Bot], Gu574v0, HarryE, J.D. Slasha, Kelg, Landarma, Loofah, Maria1, MicKo, MSN [Bot], MSNbot Media, showpei, SnowHero, Spooky, swick, Tassadar, windsaver, Yahoo [Bot]
Legend :: Administrators, Contest Winner, Global moderators, Moderators, Sponsors, Technical Administrator

Jump to:  



 Login
Username:


Password:


Remember me


 Links
 ohsk
 slacked
 xieke


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Hosted By: