Getting Away3d to work with Starling SpriteSheet

Software: Away3D 4.x

HugoW, Newbie
Posted: 01 May 2013 02:26 PM   Total Posts: 11

Dear all,

I try to assign a image (from a starling sprite sheet) to a Away3D mesh.
Is there a method than can cast or convert a starling image to a TextureMaterial.

Below are code snips:

var tempImage:Image =  new Image(Root.assets.getTexture(“starlingBird”));
// starlingBird is a starling.display.Image.Image(texture:Texture)

var testMesh:Mesh = new Mesh(new PlaneGeometry(300, 150,1,1,false), tempImage as TextureMaterial);
//  TextureMaterial is required by a new Mesh

Any solution or suggestion is welcomed.

Thanks in advance.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 01 May 2013 02:43 PM   Total Posts: 1265   [ # 1 ]

Take a look at this
http://away3d.com/tutorials/Using_sprite_sheets_in_your_project

note that we’re looking at ways to support full atlasses.xml that are exported from popular generators.

You will need to run 4.1 from dev branch (till master is not 4.1), examples are also in example repo dev branch (till mster is also not 4.1)

so links in tutorial will not work till +- a week as they point to the future location

Also I’m about to update a few details, which will likely break your code. I’ll update examples as well once done.

   

HugoW, Newbie
Posted: 02 May 2013 07:10 AM   Total Posts: 11   [ # 2 ]

@Fabrice,

I know you are busy around with the tutroial.
I do find a bug in the dev library.
generateAnimationSet method is missed in the SpriteSheetHelper.as (packaged in the away3d.tools.helpers)

By the way, I am one step away from loading the Starling Sprite Sheet to Away3D scene. It will really helpful for me if there exists a method that can cast or convert a starling image to an Away3D TextureMaterial.

Thanks for your hard works.

   

Avatar
Fabrice Closier, Administrator
Posted: 02 May 2013 08:39 AM   Total Posts: 1265   [ # 3 ]

“generateAnimationSet method is missed in the SpriteSheetHelper.as”
I have improved/updated the animator yesterday.

the short story:
dev branch engine classes + dev branch examples classes + tutorial were updated.

posted some details here
http://away3d.com/forum/viewthread/4406/#13395

“if there exists a method that can cast or convert a starling image to an Away3D TextureMaterial.”
Regarding convertion existing spritesheets, if your spritesheet uses full frames (not skipping white space) it’s a plug and play if you invoke the helper class (look at examples). Because starling runs on sprites, they define a 4 uv’s “region” and a 4 uvs area for compact information. However we do not use sprites but any meshes, any uv’s. Because of this difference, some dedicated agal massage needs to take place. It is on my todo to make it happend in a near future.
Support for atlas.xml’s is also working (tho, no code was released yet, as there are quite a few diffs between generators outputs, and common factor is what I’m currently trying to define)

You also can define frame by frame, totally custom (will extend the tut on this point).

I expect the animator synthax to remain as is now. The future addons will likely happend at internal level/extra methods added to the helper class.

   

Rafael, Newbie
Posted: 17 December 2013 09:53 PM   Total Posts: 3   [ # 4 ]

Hello; Have you found a solution for using Starling Texture as Mesh TextureMaterial? Please help I am trying to use Texture Packer, not for animation just to put all my textures in a single file.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X