Jun 5

Here is another class I made for my site… It’s nothing fancy, and in fact it could easily be done without this class, but basically, this class creates a rectangular object and fills it with an image from an outside source, tiles it, and you could easily adjust the width and height of the object, and load a new pattern.
Usage:
[sourcecode language='js']
import com.mindfock.display.TiledBG; //import class

tiledBG = new TiledBG(”path/to/pattern.gif”, 800, 600);
addChild(tiledBG);

tiledBG.tileWidth = 500 // change width
tiledBG.tileHeight = 500 // change height

tiledBG.newPattern(”path/to/new/pattern.gif”); //changing pattern image
[/sourcecode]

Download here.


leave a reply