playMaker

Author Topic: [solved] Textfield and button  (Read 3379 times)

gordonramp

  • Playmaker Newbie
  • *
  • Posts: 5
[solved] Textfield and button
« on: April 11, 2011, 07:58:54 PM »
Just purchased Playmaker and am trying to get to grips with it. Here is a question.. Can I set up a Textfield and a button in Playmaker so that when a User Types text into the field and clicks the button and if the text is correct then an event takes place.  Thanks.

« Last Edit: April 15, 2011, 04:23:17 PM by alexchouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Textfield and button
« Reply #1 on: April 13, 2011, 11:35:29 AM »
Hi,

 Totally possible :)

String comparison action to trigger an event can be found here: https://hutonggames.fogbugz.com/default.asp?W408

Then you have a lot of different possibilities to get the string from the user. Let's keep it all in playmaker :)

You first need to create a variable that will hold the content of the textfield at start AND when the user is editing it.

You can display a gui text field with the following action : https://hutonggames.fogbugz.com/default.asp?W436
You can display a button using the following action :https://hutonggames.fogbugz.com/default.asp?W427

Look for the playmaker testLab samples on how to use GUI actions. The testlab samples are the first stop to learn playmaker.

Then you simply wire an event when the user is clicking on the button . That event triggers the State where you then compare the text of the textField with the string you want, and if equal, you trigger another event and do whatever you need on the State triggered by the successful comparison event.

 Does that make sense?

 Bye,

 Jean
 


gordonramp

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Textfield and button
« Reply #2 on: April 14, 2011, 10:02:06 PM »
Yes, that helps, thanks.