SWF Renderer


SWF Renderer

A SWF Renderer displays a Flash SWF Movieclip to the screen. If you use a swf file from Flash Pro you can either render the whole swf or you can reference a symbol embedded inside of the movie clip.


Just import your swf file in the assets window and select the swf in the properties panel. This is also known as a vector bitmap because this component will generate images from the vector based artwork in your swf. So if you scale this renderer the quality is preserved because the image is redrawn during scaling. This can also be a performance hit if there is a lot of active scaling during gameplay.

Code Sample

var entity : IEntity = PBE.allocateEntity();

//Used with a Basic 2D Scene
//var swfRenderer : SWFSpriteRenderer = new SWFSpriteRenderer();
//Used with a Starling G2D Scene
var swfRenderer : SWFSpriteRendererG2D = new SWFSpriteRendererG2D();

swfRenderer.fileName = "assets/swfassets.swf";
swfRenderer.scale = new Point(2, 2);
//OR use embedded symbol
swfRenderer.containingObjectName = "HouseSymbol";

//Add to a scene to be displayed.
swfRenderer.scene = scene;
entity.addComponent(swfRenderer, "VectorBitmapRenderer");

Follow Us For Updates