Comments (8)
Interesting. I don't know what would cause that.
from feathersui-starling.
I've replicated this in a simple project and determined the cause -- when creating the sample project, I first used a basic rectangle and scale factor of 2 and I couldn't replicate the issue.
However, in my project is using the recommended screen setup: https://raw.githubusercontent.com/Gamua/Starling-Framework/master/samples/scaffold_mobile/src/utils/ScreenSetup.as
Once I added this to the test project, then sure enough, I was able to replicate. This is the setup I used that doesn't account for the devices actual scale and uses a value of 2 -- and everything works as expected, no truncation.
this._starling = new Starling(BlackScreenTest , this.stage, new Rectangle(0, 0, this.stage.fullScreenWidth, this.stage.fullScreenHeight));
this._starling.stage.stageWidth = this.stage.fullScreenWidth/2;
this._starling.stage.stageHeight = this.stage.fullScreenHeight/2;
As you know, ScreenSetup calculates the actual scale from the device:
var screen :ScreenSetup = new ScreenSetup(this.stage);
this._starling = new Starling(BlackScreenTest , this.stage, screen.viewPort)
this._starling.stage.stageWidth = screen.stageWidth;
this._starling.stage.stageHeight = screen.stageHeight;
In my project, in order to place everything on the screen at exactly the same position, I assume a width of 416 and height of 736, then I scale everything up or down in order to fit on screen.
For example, the far right of the screen is always sX(416) -- I allow for different aspect ratios, so taller/shorter devices by calculating the extra/reduced height, then the very bottom of the screen is sY(736) + bufferedHeight. This allows me to specify exact x,y positioning, and have a consistent look across all screen sizes, font sizes etc. Everything looks great from tiny Android devices through large screens -- the only issue is what is happening on Android devices. Honestly I'm not sure if this has always been an issue or since a new AIR release..
So, the TextInput I apply a scale like this:
textInput1.scaleX = this.coreModel.scaleFactorX;
textInput1.scaleY = this.coreModel.scaleFactorY;
I've opened this issue on Adobe-Runtime-Support but I wanted to ask you if this could in fact be something to do with Feathers or Starling? I'm assuming something like this is going to be a runtime issue but what do you think?
from feathersui-starling.
@urthling Are scaleFactorX
and scaleFactorY
equal, or are they different values?
from feathersui-starling.
They're slightly different.. On my Samsung Note 8 they are:
0.8653846153846154
0.8654891304347826
I just tried setting the same value for scaleX
and scaleY
and also instead tried using textInput1.scale
-- seeing same truncation just fyi..
Interestingly enough, this doesn't happen in the TextArea
component...
from feathersui-starling.
Those two scale factors seem close enough that they wouldn't cause any noticeable issues. If they were more different, that might have caused issues. However, that usually involves the editable text being out of bounds, rather than the texture/bitmap snapshot being clipped.
It may simply be that setting scaleX
and scaleY
is enough to cause this issue. StageText
does not offer the ability to scale because it's not a real display object, and that's what TextInput
uses in its default text editor, StageTextTextEditor
. It might be worth trying TextFieldTextEditor
instead, especially considering that you mentioned that TextArea
is fine. TextArea
uses TextField
instead of StageText
by default.
from feathersui-starling.
Ah, interesting, I'll give it a go, thank you!
from feathersui-starling.
Ah, thank you so much for your support Josh! That was it -- with a few tweaks (changes in where to set softKeyboard
etc) problem has been resolved.
I guess I'm not seeing it on my iOS device because I'm not scaling very much.. a ticket is open with Harman at the moment, hopefully they can offer a solution to this by allowing StageText
to scale so I can take advantage of native copy/paste etc..
Anyway, thank you again!
from feathersui-starling.
Just in case anyone comes across this thread, I realize, I simply need apply a scale to the width, height AND fontSize, rather than trying to scale the whole thing after the fact, and everything looks great and I can continue to use StageText throughout my project..
from feathersui-starling.
Related Issues (20)
- how to creat Vertica TextBlockTextRenderer? HOT 4
- Hidden rendering bug
- Null Object Reference when removing feathers control while parent is added to stage HOT 1
- BottomDrawerPopUpContentManager ignored panel.headerFactory
- Callout at borderline forgets to override arrowSkin
- LayoutGroup visible property HOT 11
- Is that a way to position the 'Toast' on top? HOT 1
- SoundChannelPeakVisualizer Implementation HOT 2
- VideoPlayer and screen rotation. HOT 2
- Error #1009 on Scroller/focusOutHandler HOT 2
- Default scale factor of MetalWorksDesktopTheme? HOT 1
- SDK Manager HOT 1
- extending the Label class HOT 4
- Object not removed from Stage on Android - Starling maybe? HOT 1
- VerticalLayout without virtual layout throws error on drag/drop HOT 2
- TextInput promptTextRenderer has no stateContext added
- Getting quite a few of these 3768 HOT 4
- Space triggers the last pressed button HOT 2
- Possible minor tweening issue in `BaseEffectContext` @ `playReverse()` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feathersui-starling.