Pages

Wednesday, 17 August 2011

How to setting a ActionScript for blitting techniques and Flash Builder 4

For games with lots of animations on the screen that can be pre-rendered into a bitmap image, a technique known as blitting can provide a solution. Blitting is not the answer to every performance problem but it will be smooth, uniform, the speed of animation frames in a wide range of machines. The term comes from BitBLT blitting routine created for the Xerox Alto. BitBLT, pronounced "blit bit" block average (images) transfer, a technique that takes several bitmaps and combines them into a single bitmap. In Flash Player, it is faster to copy the pixels in a bitmap representation of a bitmap that make every DisplayObject separately.

What is a sprite sheet?

A set consists of graphic elements, such as a car on a circuit or a tree in a forest. For this article, these assets will be bitmaps. A group of bitmaps together in an image file called a sprite sheet. For example, a sheet of sprites can contain all the frames in an animation of a nature walk. The term derives from the sprites, which, in the world of computer graphics, image or animation embedded in a big stage. Although the technique can be used blitting bitmap data from different sources, this article will focus on the sprite sheets.

What is a sprite sheet?

A sprite sheet may be a combination of all sorts of bitmap sizes. Assembling all the graphics in one (or few) large file image to reduce load times (which is faster to open and read a large file containing 100 images to open and read smaller files 100) and provides the benefits of compression. Sprite Sheets bitmaps typically the same size as the form of a sequence or an animation around a particular set of assets. For example, the sprite sheet used in this tutorial consists of five columns and four rows of tiles 40 x 40 pixels, each with a coffee picker

Setting ActionScript

Before you can try the sample code, follow these steps to create the project in Flex Builder 4:

Download and unzip the sample files for this tutorial.

Select File> New> ActionScript plan to set up a project.

Sign ActionScriptBlitting the project name and click Finish.

Copy files and folders of files displayed in the default package of the project. The folder contains files used by the PNG spritesheets ActionScript examples.

In the Package Explorer, right-click the project you just created ActionScriptBlitting and select Properties.

In the Properties dialog box, click Applications ActionScript.

Click Add, select the sample, then click OK.

Repeat step 7 for the other sample.

Click OK.

Now you have all the code examples in Flash Builder 4, and you will be able to run all examples.

0 comments:

Post a Comment