Pages: 1
  Print  
Author Topic: How do I get user input  (Read 10013 times)
Offline (Male) hpg678
Posted on: May 23, 2017, 01:21:54 am

Member
Location: Barbados
Joined: Mar 2017
Posts: 283

View Profile Email
I know that one can use 'get string' but it doesn't work even though the WIKI says it should. I have also highlighted GUI and gamemaker 5 compatibility, still doesn't work. I want to create a highscore table with the player's name + his score as the no1 highscore.

Any help will be appreciated
Logged
[compromised account]
Offline (Unknown gender) time-killer-games
Reply #1 Posted on: May 23, 2017, 05:14:45 am
"Guest"


Email
I believe what you are looking for is keyboard_string

https://docs.yoyogames.com/source/dadiospice/002_reference/mouse,%20keyboard%20and%20other%20controls/keyboard%20input/keyboard_string.html

I could be wrong, but last time I checked this worked in enigma.

Code: [Select]
//Create Event - clear keystrokes for highscore table input
keyboard_string=""

//Draw Event - draw keyboard input
draw_text(x,y,keyboard_string) // I can't remember if these arguments are in the right order

//Enter Key Pressed Event - submit text entry
your_name=keyboard_string // use your_name as your resulting high score name to be recorded
keyboard_string="" // clear keyboard entry again
Logged
Offline (Male) hpg678
Reply #2 Posted on: May 24, 2017, 11:10:51 am

Member
Location: Barbados
Joined: Mar 2017
Posts: 283

View Profile Email
thanks TKG .... I'm going to use it and create a dialog box for the user to input their name and record their score which will be displayed on a custom highscore table.


Logged
[compromised account]
Offline (Male) faissaloo
Reply #3 Posted on: June 26, 2017, 08:01:17 am

Contributor
Location: Britbongistan
Joined: Jan 2013
Posts: 87

View Profile WWW Email
I know that one can use 'get string' but it doesn't work even though the WIKI says it should. I have also highlighted GUI and gamemaker 5 compatibility, still doesn't work. I want to create a highscore table with the player's name + his score as the no1 highscore.

Any help will be appreciated
None of the GUI stuff works on Linux atm because the GTK devs are idiots. If you're on Windows however, go to Game Settings->WinAPI (or something to that effect like 'Windows', I forget the exact name) and get_string should work fine.
Logged
Offline (Male) hpg678
Reply #4 Posted on: June 26, 2017, 03:43:38 pm

Member
Location: Barbados
Joined: Mar 2017
Posts: 283

View Profile Email
thanks faissaloo  for the tip. I am attempting to create my own dialog functions but am having some difficulty  in parsing it to EML. For my project I have opt to create a sprite, use the keyboard string function and save it as a variable. however, I have realized that any characters typed on the keyboard during game play, end up as part of the string. Another problem stems from pressing "Enter" to save the string. It creates a line break which is kinda frustrating.



Logged
[compromised account]
Offline (Unknown gender) The_Watcher
Reply #5 Posted on: August 05, 2018, 12:39:05 pm
Member
Joined: Aug 2018
Posts: 6

View Profile
You have a myriad of professionally designed tools in the marketplace on the other side of the pond, why reinvent the wheel here when you have everything there.
Logged
Pages: 1
  Print