MultidirectionalTileScroller is a Starling framework extension that easily facilitates multidirectional scrolling of a tiled texture.
After instantiating the object with a width, height and texture, scrolling can be achieved simply by supplying speed and angle arguments prior to or during a play() method call.
//Instantiate the object with a width, height and texture (and optional texture scaling) m_Background = new MultidirectionalTileScroller( stage.stageWidth, stage.stageHeight, m_Texture, 1.0, 1.0 ); //Add it to the stage addChild(m_Background); //Assign speed and angle values prior to calling play(). m_Background.speed = 2; m_Background.angle = -42; m_Background.play(); //Optionally pass new speed and angle arguments to the Start function. m_Background.start(0.25, 180); //Stop Scrolling by calling stop(). m_Background.stop(); //To maintain the previously set speed and angle properties, simply call play() again. m_Background.play();
%gist(7347573)%
Feel free to edit this part of the page!