Mwni / pixi-text-input

Plugin for pixi.js which provides a convenient way of adding a text input to the pixijs-stage.
161 stars 44 forks source link

PIXI v7 Support #41

Closed tolmasoft closed 1 year ago

tolmasoft commented 1 year ago

Hi. I download and modify this code for my project =)

Modify functions:

_createSurrogate()

this._surrogate_hitbox.eventMode = 'static';
if (PIXI.VERSION[0] != '7') this._surrogate_hitbox.interactive = true;

_updateSurrogateHitbox(bounds)

this._surrogate_hitbox.eventMode = this._disabled?'auto':'static';
 if (PIXI.VERSION[0] != '7') this._surrogate_hitbox.interactive = !this._disabled;

_createSurrogate()

this._surrogate_hitbox.eventMode = 'static';
if (PIXI.VERSION[0] != '7') this._surrogate_hitbox.interactive = true;

/*some code....*/        

this.addChild(this._surrogate_mask, this._surrogate, this._surrogate_hitbox);
Mwni commented 1 year ago

Hey Vladislav, thank you for sending in the updates. What's the reasoning behind opting out to set interactive=true for v7?

tolmasoft commented 1 year ago

Migration Guide

Mwni commented 1 year ago

I read that, but couldn't find anything about not setting the interactive property...

tolmasoft commented 1 year ago

Sorry) I'm find info in Release 7.2.0 PIXI.JS

tolmasoft commented 1 year ago

In version 7.2.4 when i set interactive=true i have warning image

lmagitem commented 1 year ago

You're wonderful @tolmasoft, thank you for sharing <3