(Tutorial) Showing how to make a text match your last key pressed (Useful for making custom controls)

First of all. This image will be useful,


2. make sure you have a text object. or you wont have away to display the text:( the text can be whatever in the editor, as you can edit it with events by making them track their X and Y positions. recommended you only use one text object if you can do that;) 3. make a global variable number that tracks what control text you clicked on, and once you press a button it will set back to 0 (0 is when none of selected) 4. With the combination of the following conditions: Y position of “object” (Tracks Y Position to know which to select) Global Variable (Any variable number. and whatever number is) Then finally, Any key pressed (Without this the actions will make the control the last key you pressed. with this it is the last key you pressed when you first clicked on the object). now that’s as simple as I could’ve explained the conditions. just make sure the action is the variable wanted and have the expression there, if you have any questions. I don’t mind answering. I hope this is useful

1 Like

NOTE: This uses the “ButtonStates” Extension. this can be found normally by searching in gdevelops extension search. otherwise you can use these two conditions. the Cursor/touch is on an object. and Mouse button “Left” being pressed. and that should work too. either way is about the same i beileve

1 Like