Jump to content
Search Community

BlitMask for swiping gesture

GreenBeak test
Moderator Tag

Recommended Posts

Hi!

 

First of all, @Jack: thanks a lot for the awesome Greensock framework!

 

Currently I'm building an application that supports swiping. It's has a fairly large resolution. The application itself has a screen size of 1920x1080, but the swipable content is roughly 15000px wide (height being 1080). So I was thinking, since the swiping was not very smooth, that I could use BlitMask to reduce the unneccessary calculations. However, I'm doing something wrong, since the mask itself doesn't seem to work correctly for dragging and swiping gestures.

 

I have the following line in my code ('bm' is defined at the top of the class):

this.bm = new BlitMask(this.mc, this.mc.x, this.mc.y, 1920, 1080, true, true, 0, false);

However, the BlitMask seems to be an object laying over all the other objects, meaning my EventListeners on the content are not recognized. Is there some workaround for this or am I mistaken here and the error lies somewhere else?

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

A BlitMask is basically a rectangular Sprite that acts as a high-performance mask for a DisplayObject by caching a bitmap version of it and blitting only the pixels that should be visible at any given time.

 

Since it is creating a bitmap you no longer have the movie clips and buttons that respond to mouse events. 

 

In order to regain interactivity on the target of the BlitMask you can set bitmapMode = false.

 

Take a peak here: http://api.greensock.com/as/com/greensock/BlitMask.html#bitmapMode

Link to comment
Share on other sites

Thank you very much for the quick reply!
 

Is there a benchmark on how much faster the animations are when in using BlitMask's internal bitmap version compared to when bitmapMode is disabled? Or is there no advantage in using BlitMask anymore, if I turn off bitmapMode?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...