Custom Keyboard Problem

Hi all,

I have a custom keyboard in my game and I'm having trouble backspacing.

I have a letter count attribute that counts up when i type and counts down when I hit the backspace button, but the letters dont disappear.

Any help would be greatly appreciated!

It’s not a bug – it’s an undocumented feature

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    To make a backspace button, you'll need to first add each letter to a table row. Use a loop that constantly rebuilds the word from the table rows and stores it in a text attribute, or if you have a limited number of characters just manually concatenate the table rows: tableCellValue(table,1,1)..tableCellValue(table,2,1).. etc. into a text attribute. Display the text attribute to the player. Then, each time backspace is pressed, you delete a row from the table.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Fal01Fal01 Member Posts: 460
    Cheers @tatiang.

    It’s not a bug – it’s an undocumented feature

  • Fal01Fal01 Member Posts: 460
    Hi @tatiang,
    I've kinda got this working now, but i'm having trouble making a spacebar.
    I've got it registering in the letter count when I press it but it doesn't actually put the space in.
    Any ideas?

    It’s not a bug – it’s an undocumented feature

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    For my custom keyboard, I entered " " (pressing option+space to make the space) in the expression editor and it worked.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Fal01Fal01 Member Posts: 460
    Thanks again @tatiang.

    One last thing :D , how do I use what i've typed as an attribute? so I can check if the word typed is the same as the word required.

    Sorry for being a pain!

    It’s not a bug – it’s an undocumented feature

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2013
    On each letter button, as you are adding the letter to the table, you also need to concatenate it to the end of a text attribute (e.g. Change Attribute game.Word to game.Word..self.Letter). Another way is to constrain game.Word to all of the tableCell Values (e.g. Constrain Attribute game.Word to tableCellValue(table,1,1)..tableCellValue(table,2,1)..etc.). Of course, that only works if you have a set maximum length for your word (otherwise, if they type 50 characters and you've only manually concatenated 20 rows, you'll lose the rest).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Fal01Fal01 Member Posts: 460
    Cheers!

    It’s not a bug – it’s an undocumented feature

Sign In or Register to comment.