Closed as573991874 closed 8 years ago
Agree, no cursor for me. need docs on this.
Without any code example on how you add the input to the game I'm gonna asume here you are using a custom object, and the addChild method to add the InputField to the game, because in a situation like this, it is indeed possible that update is not called.
This is, however, default Phaser behaviour as stated in the Phaser docs
@AleBles i see phaser docs about this: Remember if this Game Object has any children you should call update on those too.
my code:
this._password = game.make.inputField(395, 1190, { font: '50px Arial', fill: '#FFFFFF', cursorColor : '#FFFFFF', fillAlpha: 0, width: 600, height : 80, placeHolder: '请输入登录密码', placeHolderColor: '#999999', textAlign: 'left', focusOutOnEnter:true, type: Fabrique.InputType.password }); c.addChild(this._password);
so, i must call this._password.update() ? or use game.add.existing(this._password);
Ideally, in the update function of your custom Phaser object, you call this._password.update()
@AleBles thanks, it's work;
should add update,then the cursor will show update() { this.input_account.update() }
The cursor does not appear,Because update function are not performed, so i code like this, "this.game.time.events.loop(Phaser.Timer.SECOND/3, this.update, this);", it is right?