LorenzGames, All about Flash Games!

Follow me on Twitter! Follow Me on Twitter

BitmapData: draw VS copyPixels

May 14th, 2011 - Category: ActionScript 3, Developers
BitmapData is a very powerful class which, if used properly, can lead to huge performance increase.

Mostly an image is drawn using 2 methods, draw or copyPixels, but what is the real difference of those?

The draw method contains more parameters than the copyPixels, for example with copyPixels it is not possible to dynamically transform the image ( scale, move, rotate, etc...).

draw(source:IBitmapDrawable, matrix:Matrix = null, colorTransform:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false):void

copyPixels(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, alphaBitmapData:BitmapData = null, alphaPoint:Point = null, mergeAlpha:Boolean = false):void

Also copyPixels can only draw another BitmapData, instead of any given IBitmapDrawable.

Using copyPixels, though, can be multiple times faster than using a draw method.
[...] Click here to read more...

ADS
Read 2 comments - Write a comment

Away3D 3.6 Essentials

April 17th, 2011 - Category: 3D, Developers
Away3D is one of the best 3D engines for ActionScript 3. It allows you to create amazing 3D scenes and animate them.

Away3D 3.6 Essentials

I announced in a post few weeks ago that I was going to review the book published by Packt about 3D in Flash Away3D: Away3D 3.6 Essential by Matthew Casperson.
This book explains all the aspects of the version 3.6 of Away3D API in 400 pages, it is pretty thick, and it covers anything you can possibly need to know.

If you are new to Away3D it is a great starting point. Even if the alpha version 4.0 (Molehill) has been released bear in mind that you will not be able to use it for any project-related development until the new Flash Player 11 is out of beta, which could be a while.

Away3D 4.0 will have major changes in both the materials and animators packages. However, a lot of the other external-facing functionality will remain intact.

If you want to be ready for that day this is the best guide you can find since the 90% of the API will remain pretty much the same in the transition from 3.6 to 4.0.

Besides that, the book covers any possible angle of the API:
- How to set up a scene with various IDE (FlashDevelop, Flash Builder and CS4)
- Creating and displaying primitives
- Moving objects
- Z-Sorting
- Materials
- Models and Animations
- Cameras
- Mouse interactivity
- Special effects
- 3D Text
- Extrusions
- Filters and Postprocessing
- Performance

The only topic that is not discussed is “Physics”, but actually Away3D doesn’t have any physic class, infact to use it you will have to use library like Jiglib.

I have been using Away3D for years but with this book I was able to find new technique especially for improving performance. I was impressed by the details touched in the tutorials, they get to a point where it is impossible to make any mistake.

If you have never experimented with Away3D though, this book will blow your mind.
It is incredible what is possible to do with Flash using third API like this.
I totally recommend you to try it, maybe before to get the book, do some test with the tutorial, and then if you really get into it go to the next step and buy it.

The future of Flash is going to be in 3D, I guess you don’t want to miss that. Emoticon


Read 1 comments - Write a comment

Waiting for Away3D 3.6 Essential

February 25th, 2011 - Category: 3D, Developers
Away3D team came up with a new book, Away3D 3.6 Essential, published by Packt.

Their first one was 3D in Flash, written by Rob Bateman and Richard Olsson and published by Friends of ED.

I have been using Away3D on many of my games in the past, the performance was still kinda cranky, but now, especially with Molehill at the horizon, things are changing quickly.

Looks like this is going to cover topics good for beginners and advanced users.
It has been written by Matthew Casperson and it promises to cover many aspect of the new version of this wonderful API.

Overview of Away3D 3.6 Essential

  • Create stunning 3D environments with highly detailed textures
  • Animate and transform all types of 3D objects, including 3D Text
  • Get the best performance from the Flash Player with proven Away3D optimization techniques, without compromising on visual appeal
  • Follow step-by-step examples in a practical and illustrative style
It should be here soon, so give me few days to dive in it and I'll write some considerations about it.



Write a comment

How to create an Animation Tile Sheet with Photoshop

September 27th, 2010 - Category: Design, Developers, General
An animation tile sheet is an image containing the complete set of frames necessary to achieve a specific animation using the blitting method.

For example, this one:
Animation Tile Sheet

Few days ago I stumbled upon a great script for Photoshop to generate automatically tile sheets like this.

RA Animation Exporter 1.2
Download it and put the JSX in your Photoshop script folder.

The whole process is very simple, you just proceed like you wanted to create an animated GIF in Photoshop.


Then you will be able to launch the script going to Menu-File-Scripts-RA Animation Exporter v1.2, if it is not there, just click on browser and look for your JSX file. It will generate a single PNG containing each frame of the animation.

Just remember before to proceed create a backup copy of your work.

The script is not perfect, I tried to contact the author to try to fix it together but he never answered to my email.
Anyway, if you find a way to fix it please let me know.



Read 3 comments - Write a comment

AS3 Pathfinder, easy to understand

September 23rd, 2010 - Category: ActionScript 3, Developers, Flash