Jump to content
Search Community

throwPropsX with infernite scroll

Asteroids test
Moderator Tag

Recommended Posts

In order to make it scroll infinitely you can set your BlitMask to wrap by setting the last parameter in the constructor to true:

blitMask = new BlitMask(menu_mc, bounds.x, bounds.y, bounds.width, bounds.height, false, true, 0x00000000, true)

http://api.greensock.com/as/com/greensock/BlitMask.html#BlitMask()

 

Now that it is wrapping, you need to change how you calculate the ending position of the the ThrowProps tween. I added a little calculation that snapps to 100px (the width of each item) increments.

 

 

var landingValue:Number = menu_mc.x + ThrowPropsPlugin.calculateChange(xVelocity, Strong.easeOut, 
duration);


xMin = xMax = (Math.round(landingValue/100) *100) + 30

In addition to the actionscript changes I had to edit your menuItem and interactiveMenuItem symbols. Previously they were very wide and had a stroke. When they were added to your container the width was being changed to 100px but the stroke was adding size to the container. 

 

In the library, both symbols are 100px wide and there is no stroke on them. Feel free to add a white line on the inside of the symbol. 

 

Hopefully the attached version is what you want.

 

 

 

 

BlitMask_wrap.zip

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...