Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add y axis rotation for 2D #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/com/pblabs/rendering2D/DisplayObjectRenderer.as
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ package com.pblabs.rendering2D
* If set, rotation is gotten from this property every frame.
*/
public var rotationProperty:PropertyReference;
public var rotationYProperty:PropertyReference;

/**
* If set, alpha is gotten from this property every frame.
Expand Down Expand Up @@ -115,6 +116,9 @@ package com.pblabs.rendering2D
protected var _registrationPoint:Point = new Point();
protected var _scale:Point = new Point(1, 1);
protected var _rotation:Number = 0;

public var rotationY:Number = 0;

protected var _alpha:Number = 1;
protected var _blendMode:String = BlendMode.NORMAL;
protected var _position:Point = new Point();
Expand Down Expand Up @@ -707,6 +711,11 @@ package com.pblabs.rendering2D
var rot:Number = owner.getProperty(rotationProperty) as Number;
this.rotation = rot;
}
if (rotationYProperty)
{
var rotY:Number = owner.getProperty(rotationYProperty) as Number;
this.rotationY = rot;
}

// Alpha.
if (alphaProperty)
Expand Down Expand Up @@ -784,7 +793,9 @@ package com.pblabs.rendering2D
displayObject.alpha = _alpha;
displayObject.blendMode = _blendMode;
displayObject.visible = (alpha > 0);


displayObject.rotationY =rotationY;

_transformDirty = false;
}
}
Expand Down