Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Endrit on April 09, 2012, 06:30:54 PM

Title: Use Buttons like keyboard !
Post by: Endrit on April 09, 2012, 06:30:54 PM
Hi guys ,
How are You ?
I have a little problem !!!

Here's my problem : I have a some buttons and a editor in a window , I'd like to use this buttons like the numbers in the keyboard .
But I have no idea how to do it .

on "one" {

code ????

}

what should insert ??

thanks guys !
Title: Re: Use Buttons like keyboard !
Post by: Spellbreaker on April 09, 2012, 07:33:35 PM
You can do something like "Game.ApplyEvent("Keypress");" . Then you can edit the on "Keypress" section in your game.script file.

Greets,

Spellbreaker
Title: Re: Use Buttons like keyboard !
Post by: Endrit on April 10, 2012, 12:20:00 PM
Thanks spellbreaker
but i really don't understand nothing about scripting can you explain step by step  ::slug ::slug ::slug ::slug
Title: Re: Use Buttons like keyboard !
Post by: Spellbreaker on April 10, 2012, 06:23:21 PM
You should read the WME Wiki. Otherwise you will get lost in keycodes, eventhandling and stuff. I already wrote what you have to do:

In the Button you make something like

on "LeftClick" {
Game.ApplyEvent("Keypress");".
}

Then you have to edit the Keypress section in your game.script file. You then have to check in which scene you currently are, and then check the keys. That way you can check both keypresses and mousclicks on your buttons.

Greets,

Spellbreaker