Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Text animation & screen tearing with Tweener class

I'm using the caurina Tweener class to animate some text, and getting some screen tearing in the simulator.

 

We'll see if the actual device does this but in the meantime, is there anyone with experience animating the position of a TextField object using Tweener who knows how to prevent screen tearing?  All I am doing is scrolling the text across the screen.  The tearing gets worse as the scroll speed increases, as would be expected.

 

(Here's a video with an example of what screen tearing looks like, for those not familiar:  http://www.youtube.com/watch?v=XJyH4Lu8U1U )

Please use plain text.
Developer
Brandon_Appetizer
Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook

Re: Text animation & screen tearing with Tweener class

Screen tearing is when some updated pixels on the screen are drawn before other pixels, leading to disconnects in an image or mis-aligned pixels which make an object appear skewed - essentially, part of the screen is drawn 1 frame behind. The video you linked is NOT screen tearing, it is some sort of graphical artifact. See this video for actual screen tearing: http://www.youtube.com/watch?v=aQXppnkj2qY

 

If what you see is like what is in the video you linked, you probably have some video card issues.

 

Assuming that you are experiencing screen tearing, I unfortunately don't have much advice for you. I assume the Playbook will have some sort of vertical sync which keeps this from happening, but I haven't heard any facts on the matter.

----------------------------------------
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Please use plain text.
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Text animation & screen tearing with Tweener class

Thanks, yep the video I linked was not actually what I'm seeing, and the one you linked is closer to what I'm seeing.  I just did a quick search on Youtube & grabbed one of the first few videos labeled 'screen tearing'; should have watched it closer.

Please use plain text.
Developer
Brandon_Appetizer
Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook

Re: Text animation & screen tearing with Tweener class

Yeah, I figured =)

 

How bad is the tearing you're seeing? Even with fast-moving objects I'm not able to create a lot of tearing. Maybe this is a common problem with the tweener? I do most of my movement with the ENTER_FRAME event, so maybe it syncs with the redraw better. Who knows.

----------------------------------------
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Please use plain text.
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Text animation & screen tearing with Tweener class

 


Brandon_Appetizer wrote:

 I do most of my movement with the ENTER_FRAME event, so maybe it syncs with the redraw better. Who knows.


 

Hmm now that you mention it, that could be the problem.  I am just using a tween time in the Tweener class, that likely results in the movement of the object not being some clean fraction of the frame rate.

 

So with your ENTER_FRAME based animations, are you just not using the Tweener class at all?

 

 

Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook

Re: Text animation & screen tearing with Tweener class

i'm wondering if you are experiencing the bug with embeded open-type fonts with the recent Mac OS X 10.6.7 update.  i've posted about it here:  Font Render Error + Flash CS5 + Mac OS X


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
Brandon_Appetizer
Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook

Re: Text animation & screen tearing with Tweener class

Nope, I'm old-school. I like having control over exactly what my stuff is doing. I was fairly new to event-based programming when I started my project and this was the most obvious to implement. As well, most of the animation I've been doing doing involves real-time physics so it doesn't make sense to use a tweener.

----------------------------------------
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Please use plain text.
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Text animation & screen tearing with Tweener class

 


TheDarkIn1978 wrote:

i'm wondering if you are experiencing the bug with embeded open-type fonts with the recent Mac OS X 10.6.7 update.  i've posted about it here:  Font Render Error + Flash CS5 + Mac OS X


Thanks for the heads up.  I should have posted more details in my original post, but I'm on Windows (XP).

 

 

 

Please use plain text.
Developer
UberschallSamsara
Posts: 1,029
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: Text animation & screen tearing with Tweener class

 


Brandon_Appetizer wrote:

Nope, I'm old-school. I like having control over exactly what my stuff is doing. I was fairly new to event-based programming when I started my project and this was the most obvious to implement. As well, most of the animation I've been doing doing involves real-time physics so it doesn't make sense to use a tweener.


Yep, my use case is much simpler (i.e. no phsyics), and being able to animate with one line of code is appealing.  Will have to experiment with the tween time and see if it can be fixed that way.

 

 

 

Please use plain text.
Developer
cycletronic
Posts: 113
Registered: ‎03-23-2011
My Device: Playbook, Z10

Re: Text animation & screen tearing with Tweener class

The usual way to fix screen tearing is to double buffer.  That means you render stuff to an off-screen buffer (in my app, a BitmapData object), and when you're done drawing, you display that buffer.  You basically switch which buffer you draw to on each frame so you aren't allocating lots of memory each frame.  If you want more info on this I can dig up a link or post some code.

----------------
WIP game: Melodaeum
My graphically bland but very useful Morse Code trainer: Speed CW
My graphically attractive but boring game: The Rainstorm
Please use plain text.