Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use FlxUIInputText .resize() in create. #217

Open
kamilko opened this issue Apr 28, 2019 · 0 comments
Open

Can't use FlxUIInputText .resize() in create. #217

kamilko opened this issue Apr 28, 2019 · 0 comments

Comments

@kamilko
Copy link

kamilko commented Apr 28, 2019

Haxe version: 3.4.7
Lime version: 7.3.0
Flixel version: 4.6.1
Build: html5
OS: macOS 10.14.4
Browsers: FF66.0.3, Opera58.0.3135.132, Safari12.1

If I try set the width for newly created component of FlxUIInputText like this:

input = new FlxUIInputText(10, 580, 200);

or this:

input = new FlxUIInputText(10, 580);
input.resize(200, 24);

and start to write whatever in such input field I get this error in browser and game hangs:

Called from module __handleError@http://127.0.0.1:3000/SimpleGame.js:116020:40
Called from module __broadcastEvent@http://127.0.0.1:3000/SimpleGame.js:115848:7
Called from module __onLimeRender@http://127.0.0.1:3000/SimpleGame.js:116828:3
Called from module f@http://127.0.0.1:3000/SimpleGame.js:130999:233
Called from module dispatch@http://127.0.0.1:3000/SimpleGame.js:75636:16
Called from module handleApplicationEvent@http://127.0.0.1:3000/SimpleGame.js:351:6
Called from module f@http://127.0.0.1:3000/SimpleGame.js:130999:233
Called from module

TypeError: shader is null[Learn More] SimpleGame.js:37658:3
    render http://127.0.0.1:3000/SimpleGame.js:37658
    render http://127.0.0.1:3000/SimpleGame.js:8313
    draw http://127.0.0.1:3000/SimpleGame.js:11506
    onEnterFrame http://127.0.0.1:3000/SimpleGame.js:11334
    f http://127.0.0.1:3000/SimpleGame.js:130999
    __dispatchEvent http://127.0.0.1:3000/SimpleGame.js:1179
    __dispatch http://127.0.0.1:3000/SimpleGame.js:1941
    __broadcastEvent http://127.0.0.1:3000/SimpleGame.js:115844
    __onLimeRender http://127.0.0.1:3000/SimpleGame.js:116828
    f http://127.0.0.1:3000/SimpleGame.js:130999
    dispatch http://127.0.0.1:3000/SimpleGame.js:75636
    handleApplicationEvent http://127.0.0.1:3000/SimpleGame.js:351
    f http://127.0.0.1:3000/SimpleGame.js:130999

Safari even hangs while you try to open such scene where in create is input.resize().
But when I remove all the size setup from create method and put in update - besides ugly flickering sometime while you typing fast, everything works fine.
Maybe not everything. You can't erase first letter, it stays and if you start write again, it will be overwritten.
Another workaround is to set some input.text while you create the component. But if you need it empty at beginning, then you must use update workaround.

You can easily check this bug with online demo: http://haxeflixel.com/demos/Calculator/ but you don't want to use number buttons but enter number from keyboard. If you first press some button number, and then work with keyboard it will be all fine (except that bug with first number left after delete).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant