TextInput restricts spaces


#1

Hello,

I would like to know, why does TextField restrict spaces? where restrict property is null, it should accept any text, but it does not accept space character…

Any idea? how can I debug it?


#2

I just tested the “AddingText” sample, using textField.type = INPUT;, it worked fine with spaces, perhaps your font doesn’t have space characters embedded? Is this on the Flash target, or other targets?


#3

Its html target, the type is input, I tried Arial font, but it does not accept spaces… what do you recommend to debug it?

Here is my attempt:

var tt:openfl.text.TextField;
tt=new openfl.text.TextField();
tt.width= 500;
tt.height= 500;
tt.type= “input”;
tt.text= “Here…”;

Is it a known issue with openFL 4.8.1 ?


#4

Oh, I can’t say about OpenFL 4.8.1. Could you test the latest, on your end, to see if it also appears to behave this way for you?


#5

The latest version works fine with TextField as input, I can add spaces … but unfortunately its not easy for me to upgrade as you can see below, most graphics rendered incorrect:

while, they should appear like this:

Is there an easy fix to make upgrade from 4.8.1 to latest be easy? or at least, to know what’s going on?
Also, how can I set the basePath of assets at the latest lime?


#6

Hmm, maybe there’s some way we could try and validate what’s going on here.

In the latest, you should be able to set the base path using something like this in your index.html template file:

lime.embed ("::APP_FILE::", "openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, { rootPath: "/sharedAssets/worldsBestApplication/", parameters: {} });

#8

how can I set the id of the resulted canvas? I tried parameters: {id: "lab_canvas"} but it did not work…


#9

“openfl-content” in the sample code is the ID of the element you wish to embed in. You should currently be able to choose either a DIV element (which we do by default) or you should also be able to pass an element, even a canvas element, and I think it would still work


#10

I didn’t mean the element in which the openfl canvas will be embedded into. Its the openfl canvas it self, can I set its id ?


#11

If you create a canvas element first, and assign it an ID, then you should be able to make your OpenFL project use that canvas instead of creating its own, I haven’t tested it in a while, but it worked last I tried :slight_smile: