Packagekrewfw.core
Classpublic class KrewPoolableActor
InheritanceKrewPoolableActor Inheritance KrewActor Inheritance KrewGameObject Inheritance starling.display.Sprite
Implements KrewPoolable

To make poolable actor, extends KrewPoolableActor and implements in subclasses like this:
     public class YourPoolableActorClass extends KrewPoolableActor {
              private static var _objectPool:KrewObjectPool = new KrewObjectPool(YourPoolableActorClass);
              protected override function onRecycle():void {
             _objectPool.recycle(this);
         }
              public static function getObject(arg1:Number, arg2:uint):YourPoolableActorClass {
             var params:Object = {
                 arg1: arg1,
                 arg2: arg2
             };
             return _objectPool.getObject(params) as YourPoolableActorClass;
         }
              public static function disposePool():void {
             _objectPool.dispose();
         }
              ...
     }
     



Public Properties
 PropertyDefined By
 InheritedapplyForNewActor : Function
KrewActor
 InheritedcachedHeight : Number
[read-only]
KrewActor
 InheritedcachedWidth : Number
[read-only] [CAUTION] starling.display.DisplayObjectContainer の width / height の getter は重い行列計算が走るので滅多なことでもない限り使うな
KrewActor
 InheritedchildActors : Vector.<KrewActor>
[read-only]
KrewActor
 Inheritedcollidable : Boolean = true
false にすると CollisionShape が衝突判定を行わない
KrewActor
 Inheritedcolor : uint
Actor が持つ Image や TextField 全てに色をセットする
KrewActor
 Inheriteddisplayable : Boolean = true
addActor 前に false にすると addActor 時に addChild を行わない (Starling の DisplayList にのせない.) 見た目を持たずに仕事をする Actor はこれを false にすればよい
KrewActor
 InheriteddisplayOrder : int = 0
high is front
KrewActor
 InheritedhasInitialized : Boolean
Called from StageLayerManager for re-init global actor.
KrewActor
 Inheritedid : int
[read-only]
KrewGameObject
 InheritedisDead : Boolean
[read-only]
KrewActor
 Inheritedkrew : KrewTopUtil
[read-only] よく使う utility への簡易アクセス
KrewGameObject
 Inheritedlayer : StageLayer
KrewActor
 InheritedlayerName : String
KrewActor
 InheritednumActor : int
[read-only]
KrewActor
 Inheritedpoolable : Boolean = false
true にすると再セットアップが可能な状態に dispose する。 (GC を促すための null を入れることをしない)
KrewActor
 InheritedsharedObj : KrewSharedObjects
KrewGameObject
Protected Properties
 PropertyDefined By
 Inherited_cachedHeight : Number
KrewActor
 Inherited_cachedWidth : Number
KrewActor
 Inherited_checkDisplayArea : Boolean = false
KrewActor
Public Methods
 MethodDefined By
  
Poolable actor's constructor should be able to receive zero arguments because KrewObjectPool instanciates it with no arguments.
KrewPoolableActor
 Inherited
act(action:StuntAction = null):StuntAction
KrewActor
 Inherited
addActor(actor:KrewActor, putOnDisplayList:Boolean = true):void
krewFramework のシステムに Actor を登録し、同時に Starling の DisplayList に追加する.
KrewActor
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] addChild したものは Actor 破棄時に勝手に dispose が呼ばれる
KrewActor
 Inherited
addImage(image:Image, width:Number, height:Number, x:Number = 0, y:Number = 0, anchorX:Number = 0.5, anchorY:Number = 0.5):void
addChild の代わりに addImage を呼ぶことで破棄時に Image.texture の dispose が 呼ばれるようになる。また、KrewActor.color の指定で全 Image に色がかかるようになる
KrewActor
 Inherited
addInitializer(initFunc:Function):void
init が呼ばれる時(KrewScene.setUpActor に渡された時、または Actor から addActor されたとき)に、init 後に呼ばれる関数を登録。 コンストラクタでの使用を想定.
KrewActor
 Inherited
addPeriodicTask(interval:Number, task:Function, times:int = -1):void
Equivalent to setInterval(), but passed time will be based on game's timeline.
KrewActor
 Inherited
addScheduledTask(timeout:Number, task:Function):void
Equivalent to setTimeout(), but passed time will be based on game's timeline.
KrewActor
 Inherited
addText(text:TextField, x:Number, y:Number):void
Actor 全体の color に影響させたい場合は addChild ではなく addText で足す
KrewActor
 Inherited
addTouchMarginNode(touchWidth:Number = 0, touchHeight:Number = 0):void
for touch action adjustment.
KrewActor
 Inherited
addTween(tween:Tween):void
KrewActor
 Inherited
blackIn(duration:Number = 0.33, startAlpha:Number = 1):void
KrewGameObject
 Inherited
blackOut(duration:Number = 0.33, startAlpha:Number = 0):void
KrewGameObject
 Inherited
changeImage(image:Image, imageName:String):void
KrewActor
 Inherited
colorIn(color:uint, duration:Number = 0.33, startAlpha:Number = 1):void
KrewGameObject
 Inherited
colorOut(color:uint, duration:Number = 0.33, startAlpha:Number = 0):void
KrewGameObject
 Inherited
createActor(newActor:KrewActor, layerName:String = null):void
KrewActor
 Inherited
cyclic(interval:Number, task:Function, times:int = -1):void
Alias for addPeriodicTask
KrewActor
 Inherited
cyclicFrame(task:Function, waitFrames:int = 1, times:int = -1):void
Runs task several times after n frames.
KrewActor
 Inherited
delayed(timeout:Number, task:Function):void
Alias for addScheduledTask
KrewActor
 Inherited
delayedFrame(task:Function, waitFrames:int = 1):void
Runs task 1 times after n frames.
KrewActor
 Inherited
dispose():void
[override]
KrewGameObject
 Inherited
enchant(duration:Number, transition:String):Tween
KrewActor
 Inherited
getByteArray(fileName:String):ByteArray
KrewGameObject
 Inherited
getImage(fileName:String):Image
KrewGameObject
 Inherited
getLayer(layerName:String):StageLayer
KrewGameObject
 Inherited
getObject(fileName:String):Object
KrewGameObject
 Inherited
getSound(fileName:String):Sound
KrewGameObject
 Inherited
getTexture(fileName:String):Texture
KrewGameObject
 Inherited
getXml(fileName:String):XML
KrewGameObject
 Inherited
init():void
この時点で sharedObj がセットされているので resourceManager にアクセスできる
KrewGameObject
 Inherited
listen(eventType:String, callback:Function):void
KrewGameObject
 Inherited
loadResources(fileNameList:Array, onLoadProgress:Function, onLoadComplete:Function):void
KrewGameObject
  
KrewPoolableActor
  
onPoolableInit(params:Object):void
Called after init()
KrewPoolableActor
  
onPoolableReinit(params:Object):void
Called after init() and when actor comes back from pool.
KrewPoolableActor
  
onPooledObjectCreate(params:Object):void
KrewPoolableActor
  
onPooledObjectInit(params:Object):void
KrewPoolableActor
  
KrewPoolableActor
  
onRetrieveFromPool(params:Object):void
KrewPoolableActor
 Inherited
onUpdate(passedTime:Number):void
KrewGameObject
 Inherited
passAway():void
KrewActor
 Inherited
pauseBgm():void
KrewGameObject
 Inherited
playBgm(bgmId:String, vol:Number, startTime:Number = 0):void
同じ bgmId をすでに再生中の場合は、再生し直さない。 (0 から再生し直したい場合は先に stopBgm() を呼んでね)
KrewGameObject
 Inherited
playSe(seId:String, pan:Number = 0, loops:int = 0, vol:Number, startTime:Number = 0):void
KrewGameObject
 Inherited
react():void
KrewActor
 Inherited
KrewActor
 Inherited
resetTimeScale(layerName:String):void
KrewGameObject
 Inherited
resumeBgm():void
KrewGameObject
 Inherited
sendMessage(eventType:String, eventArgs:Object = null):void
KrewGameObject
 Inherited
setAllLayersEnabled(enabled:Boolean):void
KrewGameObject
 Inherited
setCollision(groupName:String, shape:CollisionShape):void
KrewGameObject
 Inherited
setLayerEnabled(layerNameList:Array, enabled:Boolean):void
KrewGameObject
 Inherited
setLayerEnabledOtherThan(excludeLayerNameList:Array, enabled:Boolean):void
KrewGameObject
 Inherited
setTimeScale(layerName:String, timeScale:Number):void
KrewGameObject
 Inherited
setVertexColor(color1:int = 0, color2:int = 0, color3:int = 0, color4:int = 0):void
KrewActor
 Inherited
displayOrder の値でツリーをソート。 children が皆 KrewActor である前提。 actor.displayOrder = 1; のように設定した上で getLayer('hoge').sortDisplayOrder(); のように使う
KrewActor
 Inherited
KrewGameObject
 Inherited
KrewGameObject
 Inherited
stopBgm():void
KrewGameObject
 Inherited
stopListening(eventType:String):void
KrewGameObject
 Inherited
stopSe():void
KrewGameObject
 Inherited
whiteIn(duration:Number = 0.33, startAlpha:Number = 1):void
KrewGameObject
 Inherited
whiteOut(duration:Number = 0.33, startAlpha:Number = 0):void
KrewGameObject
Protected Methods
 MethodDefined By
 Inherited
KrewActor
 Inherited
KrewActor
 Inherited
onDispose():void
KrewGameObject
 Inherited
onRecycle():void
poolable = true な Actor が dispose されるタイミングで、 onDispose の代わりに呼ばれる
KrewActor
Constructor Detail
KrewPoolableActor()Constructor
public function KrewPoolableActor()

Poolable actor's constructor should be able to receive zero arguments because KrewObjectPool instanciates it with no arguments. You can init instance in onPoolableInit() handler.

Method Detail
onDisposeFromPool()method
public function onDisposeFromPool():void

onPoolableInit()method 
public function onPoolableInit(params:Object):void

Called after init()

Parameters

params:Object

onPoolableReinit()method 
public function onPoolableReinit(params:Object):void

Called after init() and when actor comes back from pool.

Parameters

params:Object

onPooledObjectCreate()method 
public function onPooledObjectCreate(params:Object):void

Parameters

params:Object

onPooledObjectInit()method 
public function onPooledObjectInit(params:Object):void

Parameters

params:Object

onPooledObjectRecycle()method 
public function onPooledObjectRecycle():void

onRetrieveFromPool()method 
public function onRetrieveFromPool(params:Object):void

Parameters

params:Object