DMT providing run-time dynamic (and fast) rasterization of vector images to bitmaps and the generation of the atlases. The use of vector images in games ensures sharpness while scaling, moving, etc, but suffer from poorer performance under heavy use. The library generates bitmaps which are optimized for each screen resolution, avoiding ugly stretch marks and pixelization.

Some of its features:

  1. Dynamically generated at run-time
  2. Storing the original Display Tree
    • Display Object manipulations is available as in the original Flash Display Object. This allows you to change any property like alpha, x, y, scaleX, scaleY, and rotation of any children, this also means you have the original PIVOT point and you can listen to events of any child object.
    • Keeping instance name, so getChildByName also works as usual.
  3. Smart Effects
    • capturing Effects.
    • Scale effect support (Optional) – All the Display Object effects are being scaled to the proportional requested size
  4. Automatically generates a packaged textures atlas.
    • All textures are being packed into a minimized atlas(s), optimized using bean packing algorithm (To save GPU memory, loading time, and draw calls!)
    • Dynamically packing.
    • Multiple instances of object with the same transformation matrix are treated as the same Texture. (No duplication)
  5. Cache support – generate the device optimized images once, and saved for reuse in later runs.
    • Save/load all rasterized data to/from cache.
    • Cache contains all rasterized textures (PNG file format) and all Display Tree data, in one file.
  6. Asynchronous support using pseudo thread. (Ready for workers when available on mobile.)
  7. Rasterize MovieClips.

Sample

/*
Copyright 2012 XTD Studios Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.xtdstudios.dmt.demo
{
	import com.xtdstudios.DMT.DMTBasic;
	import com.xtdstudios.dmt.demo.assets.Square;

	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;

	import starling.core.Starling;
	import starling.display.DisplayObject;
	import starling.display.Sprite;

	public class HelloDMT extends starling.display.Sprite
	{
		// set useCache to false if you have changed the asset to re-generate the cache
		private var dmtBasic: DMTBasic = new DMTBasic("demo.HelloDMT", true, "1");

		private var m_flashSquare			: flash.display.Sprite;
		private var m_starlingSquare		: starling.display.DisplayObject;
		private var m_displayObjects		: Vector.;

		public function HelloDMT()
		{
			super();

			name = "Hello DMT";
			m_displayObjects = new Vector.();
			initFlash();
			doRasterize();
		}

		private function initFlash(): void {
			m_flashSquare = new Square(50,-25,-25);
			m_flashSquare.x=100;
			m_flashSquare.y=100;
			m_flashSquare.name="Square";
			Starling.current.nativeStage.addChild(m_flashSquare);
		}

		override public function dispose():void
		{
			if (m_flashSquare && m_flashSquare.parent)
				m_flashSquare.parent.removeChild(m_flashSquare);

			if (m_starlingSquare)
				removeChild(m_starlingSquare);

			super.dispose();
		}

		private function doRasterize(): void {
			m_displayObjects.push(m_flashSquare);

			dmtBasic.addItemsToRaster(m_displayObjects);

			dmtBasic.addEventListener(flash.events.Event.COMPLETE, dmtComplete);
			dmtBasic.process();
		}

		private function dmtComplete(event:flash.events.Event): void {
			initStarlingObjects();
		}

		private function initStarlingObjects(): void {
			m_starlingSquare = dmtBasic.getAssetByUniqueAlias("Square");
			addChild(m_starlingSquare);
		}
	}
}
Misc . URL.