IAT 167 Final: IAT167-BitmapLoadingExample.docx

111 views4 pages

Document Summary

Import flash. display. sprite; import flash. events. event; public class main extends sprite private var levelmap:levelmap; private var loadturret:loadturretexample; // example 1 loading a full map levelmap = new levelmap(); addchild(levelmap); // example 2 loading a tile from a tile sheet using copypixels loadturret = new loadturretexample(); addchild(loadturret); Maplevel. as package import flash. display. bitmap; import flash. display. bitmapdata; import flash. display. displayobject; import flash. display. sprite; * example code which demonstrates loading a full png into a bitmapdata object and showing it on the stage public class levelmap extends sprite. // a structure that holds bitmap data private var mapbitmap:bitmap; placeable on the stage private var mapbitmapdata:bitmapdata; and provides handy functions for working with the data. // the following two lines are how we assign an external file to a variable. The variable is declared as a "class" but when assigned will be a subclass of displayobject. [embed(source="/assets/td_map_level1. png")] private var map_level1:class; public function levelmap() super(); var map:displayobject = new map_level1();

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions