How to make awesome game tile: AWESOMER (specular methods)

Software: Away3D 4.x

Avatar
owntheweb, Jr. Member
Posted: 17 February 2013 03:43 AM   Total Posts: 32

Hello gurus,
Here’s a work-in-progress game tile I’m working on with rollover and clicking changes. The mesh is expanding a touch on a Prefab3D export.:
http://www.christopherstevens.cc/away3d/tile2/

A nice RimLightMethod could be a cool addition to highlight tiles. I’m having trouble though getting one assigned to my tile mesh, which seems to be a “MaterialBase”.

Example:

...
private function 
initContent():void
  {
   _prefabOutput 
= new Tile2();
   
_view.scene.addChild(_prefabOutput);
   
   
_mouseOverSpecularMethod = new RimLightMethod0xA4F4FE.42"mix" ); //ok so far
   
_prefabOutput.materials[0].specularMethod _mouseOverSpecularMethod//results in error
   
   
_prefabOutput.meshes[0].mouseEnabled true;
   
_prefabOutput.meshes[0].addEventListenerMouseEvent3D.MOUSE_OVERonTileMouseOver );
   
_prefabOutput.meshes[0].addEventListenerMouseEvent3D.MOUSE_OUTonTileMouseOut );
   
_prefabOutput.meshes[0].addEventListenerMouseEvent3D.MOUSE_DOWNonTileMouseDown );
   
   
_camera.lookAt(_prefabOutput.position);
   
  
}
... 

Error:
1119: Access of possibly undefined property specularMethod through a reference with static type away3d.materials:MaterialBase.

Would it be better to take this tile outside of the Prefab3D defaults with a new class and no helper functions, creating materials from scratch. Or, am I missing something? wink

Thanks for the assist.

   

Avatar
owntheweb, Jr. Member
Posted: 17 February 2013 05:50 PM   Total Posts: 32   [ # 1 ]

Reviewing a tutorial, I think I’m going to head back to square one with this. The exports from Prefab3D are super handy, but I need to restructure everything anyway for some texture management and such.

Onward!

   

Avatar
Fabrice Closier, Administrator
Posted: 17 February 2013 06:57 PM   Total Posts: 1265   [ # 2 ]

That’s why there is a comment in header of PrefabProject class that comes with your class, that says that its an example class to show you how to implement all the goodies that Prefab has outputed for you. That is light, behaviours, animators, the main class etc… (soon more).
It is impossible for me to generate classes that fit in all projects structure.
Even if the PrefabProject class is fully working and reproduces everything as in Prefab, it’s there to show you the way. Nothing more, nothing less.

The class that you can insert in any project is the one that you gave a name to. Even for this one, you might want to modify the ASbase and insert custom methods/materials/assets managers etc..

It’s all up to you. Prefab tries to speed up and ease your development.
But at some point you have to type a few lines smile

   

Avatar
owntheweb, Jr. Member
Posted: 17 February 2013 09:20 PM   Total Posts: 32   [ # 3 ]

No worries and I totally agree. The Prefab exports have helped me accelerate the climb over a learning curve and I’m starting to take my own directions. :D

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X