Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

draw proto

  • Loading branch information...
commit 3a78e93cdded84d65b23a63fcb98d092eb6d68bc 1 parent 97cce26
@blooddy blooddy authored
View
15 src/com/casualflash/rush/display/DisplayObject2D.as
@@ -74,7 +74,7 @@ package com.casualflash.rush.display {
/**
* @private
*/
- private static const _BROADCASTER:Shape = new Shape();
+ internal static const $BROADCASTER:Shape = new Shape();
/**
* @private
@@ -492,7 +492,7 @@ package com.casualflash.rush.display {
this.$capture.addEventListener( type, listener, true, priority, useWeakReference );
} else {
if ( type in _BROADCAST_EVENTS && !this.$bubble.hasEventListener( type ) ) {
- _BROADCASTER.addEventListener( type, this.$bubble.dispatchEvent, false, 0, true );
+ $BROADCASTER.addEventListener( type, this.$bubble.dispatchEvent, false, 0, true );
}
this.$bubble.addEventListener( type, listener, false, priority, useWeakReference );
}
@@ -506,7 +506,7 @@ package com.casualflash.rush.display {
} else {
this.$bubble.removeEventListener( type, listener, false );
if ( type in _BROADCAST_EVENTS && !this.$bubble.hasEventListener( type ) ) {
- _BROADCASTER.removeEventListener( type, this.$bubble.dispatchEvent );
+ $BROADCASTER.removeEventListener( type, this.$bubble.dispatchEvent );
}
}
}
@@ -859,6 +859,13 @@ package com.casualflash.rush.display {
return true;
}
+ /**
+ * @private
+ */
+ $internal function $draw():void {
+ // must be overriden
+ }
+
}
}
@@ -949,7 +956,7 @@ internal final class EventContainer extends Event {
public override function clone():Event {
return this.$event;
}
-
+
}
/**
View
13 src/com/casualflash/rush/display/NativeDisplayObjectContainer2D.as
@@ -205,6 +205,17 @@ package com.casualflash.rush.display {
return false;
}
+ /**
+ * @private
+ */
+ $internal override function $draw():void {
+ for each ( var child:DisplayObject2D in this.$list ) {
+ if ( child.visible ) {
+ child.$draw();
+ }
+ }
+ }
+
}
-
+
}
View
15 src/com/casualflash/rush/display/Stage2D.as
@@ -10,6 +10,7 @@ package com.casualflash.rush.display {
import flash.display.Stage3D;
import flash.display3D.Context3D;
+ import flash.display3D.Context3DTriangleFace;
import flash.errors.IllegalOperationError;
import flash.events.ErrorEvent;
import flash.events.Event;
@@ -314,7 +315,8 @@ package com.casualflash.rush.display {
this._stage3D.removeEventListener( Event.CONTEXT3D_CREATE, this.handler_context3DCreate );
this._stage3D.removeEventListener( ErrorEvent.ERROR, this.handler_error );
this.$context = this._stage3D.context3D;
- this.$context.configureBackBuffer( this._stageWidth, this._stageHeight, 2, true ); // TODO: configure antiAlias & enableDepthAndStencil
+ this.$context.configureBackBuffer( this._stageWidth, this._stageHeight, 2, false ); // TODO: configure antiAlias & enableDepthAndStencil
+ this.$context.setCulling( Context3DTriangleFace.BACK );
}
/**
@@ -325,7 +327,16 @@ package com.casualflash.rush.display {
this._stage3D.removeEventListener( ErrorEvent.ERROR, this.handler_error );
super.dispatchEvent( event ); // TODO
}
-
+
+ /**
+ * @private
+ */
+ private function handler_enterFrame(event:Event):void {
+ this.$context.clear();
+ super.$draw();
+ this.$context.present();
+ }
+
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.