Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on November 02, 2015, 11:14:08 PM

Title: Keypad
Post by: Rabagast on November 02, 2015, 11:14:08 PM
Hi!

I want to make a keypad in my game, so I will be able to write a code, etc. when I click on the numbers, like a normal keypad 0-9.
Is that possible with playmaker? And if it is, how would I start? I have the keypad ready. I just need the Playmaker Actions.
Title: Re: Keypad
Post by: djaydino on November 03, 2015, 03:15:17 AM
Hi,
so you mean like an onscreen keypad?

if you are on u4.6+ you can use ugui buttons or if you want it to be in your game (3d) you can use mouse pick event
Title: Re: Keypad
Post by: Rabagast on November 03, 2015, 10:48:59 AM
Hi!

Yes, I mean onscreen keypad! I have the buttons ready, but one thing I don't understand. How can I make it so the numbers will appear in a textfield? Like when I'm writing here on the forum. :)
Title: Re: Keypad
Post by: KellyRay on November 03, 2015, 01:34:48 PM
I think I would do it with a ugui Text game object that looks at a string variable every frame. I'd probably use the Set Property action for this.

Then I would update that string variable with my keypad buttons. I'd probably use a build string action for that.

Hope that helps!
Title: Re: Keypad
Post by: djaydino on November 03, 2015, 05:01:03 PM
Hi,
I made a sample that you can try out.
you need to have playmaker and the ugui proxy full package

you can get the package on the EcoSystem (https://hutonggames.fogbugz.com/default.asp?W1181).
Title: Re: Keypad
Post by: djaydino on November 03, 2015, 06:27:02 PM
oops i forgot to add the attachment.... here you go :)
Title: Re: Keypad
Post by: Rabagast on November 04, 2015, 08:10:00 AM
Hi,
I made a sample that you can try out.
you need to have playmaker and the ugui proxy full package

you can get the package on the EcoSystem (https://hutonggames.fogbugz.com/default.asp?W1181).

Thank you! :)

Did this really work for you?
Because I got this loop error "KeyPad : FSM : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector."

I had to put a wait action in the state "Set Text", then it worked fine. :)
Title: Re: Keypad
Post by: djaydino on November 04, 2015, 09:18:05 AM
Hi,
Yes it works for me but when i tried with my double click button i also got a loop count so i added a next frame action :

Title: Re: Keypad
Post by: Rabagast on November 04, 2015, 09:28:06 AM
Strange!
I got the error even if I clicked only once.
But it worked with Next Frame. :)

Thank you so much for helping me with this. It works fine with the rest of the logics in the game. :)