IOS5 Getting better performance in a moving text display - drawtext

I am creating a moving text display with a huge font size.
The faster the text moves, the less smooth the text transition becomes.
I am calling NSString drawAtPoint evere 0.01 second (NSTimer) and move the text 1 point.
Would there be a better option for the drawing? Maybe using a UILabel or UIScrollView?
Any advise is welcome!
Thanks

How about using the animation features of the system?
eg: [UIView animateWithDuration:animations:]

Related

Is it possible to make text touchable in Libgdx

I am creating a menu screen for my game and instead of creating button there I just have text font. I want to know whether it is possible to to make them touchable.as i have 3 text in main menu so three different function.
I have very little experience making GUIs in LibGDX, and I'm sure this answer is too late anyway, but:
Why not just have a clickable object surrounding the text, and just don't render this?
In other words, do what you'd do normally for a button, just don't render it.

How can I ellipsis a Text in BB 10 Cascades?

I'm developing a BlackBerry 10 mobile application using the Momentics IDE (native SDK).
I have a Label which has fixed width. If a Text does not fit in this Label, I want it to be ellipsis (elliding the text with the conventional "..." at the end) in place of a fade effect (just sort of "ghosts" into oblivion) like the Cascades designers have chosen to be in such case like presented in the image below.
Can any one help me on this ?
Since Peter doesn't seem to know how to do this in a straight forward way, the only option left would seem to be the complicated way. You may, of course, create your own control and manage the text rendering in the way you would like using an ellipsis instead of the fade. That would seem to be a great deal of work for what in the end will really only result in your program being unconventional on the platform.
Edit:
Since you think it is worth a bounty I will add the following thought.
Using the ellipsis method, instead of the fade method, may impose a performance penalty on your application. Elliding text requires the computation of how many characters may be displayed int the available area and still leave room for the ellipsis. This is not a trivial mater with variable width type faces or different character sets. The fade, on the other hand, is a simple transparency operation. Since UI graphics operations in Cascades are all done in hardware the fade is quite efficient and independent of the size of the string, text area, type face, etc.
Which version of QML? QML element Text has elide property and this is what you want.

JavaFx text resizing

What is the best way (in terms of performance) to resize a text proportionally to the size of its parent ? I want to make a undecorated window in which the text (which can span several lines) always use all the available size.
Well, I don't know if it is the best way but using scale is working fine.
You just have to listen changes to the heightProperty and widthProperty of the parents in order to compute a scale factor and apply it to the component (Here a Text or a Label). This can be done with JavaFx magic binding too :)
So, there is no need to dynamically change the Font or something like that (and I think this would be a lot more slow than scale computation).

Text below buttons in android

I have an application which has many icons (Buttons). I want to put a text below the icons (just like mainscreen). My icon size is 128x128 for high resolution, so android:drawableTop strategy doesnt work because I couldnt figure out a way of programmatically reducing the size of the drawable to 80x80dp. I would prefer not to create several little icon files.
Another idea offered was to put a text view below each button. This is possible but sounds very clunky way of achieving this.
Could someone suggest a way of achieving a text below the icons ?
Thanks
I would use this layout structure for your purpose
&ltLinearLayout>
&ltButton/>
&ltTextView/>
&lt/LinearLayout>

Large serifs in a font cause flash to measure size incorrectly

I have a textarea where I measure the textWidth and textHeight to make sure the user cannot enter more text than can fit in the text area. I also extended the textArea with a textHeightNow and textWidthNow that measure the textField's dimensions since they update w/out requiring validation. Now this works great for 90% of the embedded fonts I'm using but any fonts that have giant serifs are not measured properly, for instance look at the 'f's in this text area:
alt text http://img.skitch.com/20091101-xhm5jguma1qgukg6fxrymrwr3u.jpg
You can see they get cut off on both sides because textWidth and textWidthNow both return an incorrect size not taking into account the massive serifs. The font size, coords and dimensions of the text area are all integers so thats not the problem, any other suggestions? I looked to see if textArea has a clipContent argument but it doesn't (that would have been nice).
Thanks
I've run into this problem before and as far as I can tell you have two options, none of them very nice:
Use the new flash.text.engine in
Flash Player 10... its very hard to use but
I think it will measure such fonts
(and ligatures) properly.
Draw the textfield into a bitmapdata
and use getColorBoundsRect to
determine its real dimensions.
I ended up using the latter as changing the whole app to the new engine would have been much much harder. You will need to tweak margins and use a larger textfield (inside some container) to be able to draw it properly, but it should work.

Resources