Home > other >  Consult the cocos creator editbox data acquisition and comparison
Consult the cocos creator editbox data acquisition and comparison

Time:09-30

I'm new to do a crossword puzzle, first will be the prefab precast body editbox, then three editbox, is generated by scripting prefab by players in each editbox to fill in a word, consult: I want the effect is same as scheduled the answer if fill in the word, the font turn green, the implementation of this? How to get user input, and compares with the default answer, answer genuflect is begged! Thank you very much!!!!! Cc. Class ({
Extends: cc.Com ponent,
Properties: {
EditBox: {
Default: null,
Type: cc Prefab,
}
},
OnLoad () {
Enclosing spawn ();
},
Spawn: function () {
for(var i=0; i<3; I++) {
Var edit=cc. Instantiate (enclosing editBox);
This. The node. The addChild (edit);
Edit. SetPosition (cc) v2 (0100 * I));
Edit. GetComponent (cc) EditBox)) placeholder="input";
}
}
});
  • Related