Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: editor & text speed  (Read 3839 times)

0 Members and 1 Guest are viewing this topic.

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
editor & text speed
« on: April 12, 2003, 07:59:38 PM »

OK... last question on this topic (I promise! I don't want you to spend your time answering only to my questions.).

I have ceated a settings.window which defines an
EDIT { } with the name "sub_speed". It also calls the settings.script. What I don't know is how to check if the player has entered a number and how I can check if this number is (for example) between 40-150.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:editor & text speed
« Reply #1 on: April 13, 2003, 08:29:15 AM »

The easiest scenario would be calling the following piece of code when the player presses "OK" on your settings dialog:

Code: [Select]
   var Editor = self.GetWidget("sub_speed");
    var Number = ToInt(Editor.Text);
   
    if(Number < 40) Number = 40;
    if(Number > 150) Number = 150;
   
    if(Number!=Editor.Text) Editor.Text = Number;

(providing your editor is called "sub_speed")

You could also check the validity "online" (while the player types the number in), because everytime the editor contents are changed, the parent window recieves an event (with the same name as the editor's name) but that would be more complicated and it's probably not necessary.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.034 seconds with 23 queries.