|
@@ -33,7 +33,10 @@ export interface ISpriteMapOptions{
|
|
*/
|
|
*/
|
|
outputPosition?: Vector3;
|
|
outputPosition?: Vector3;
|
|
|
|
|
|
- //TODO ROTATION
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Vector3 of the rotation of the output plane.
|
|
|
|
+ */
|
|
|
|
+ outputRotation?: Vector3;
|
|
|
|
|
|
/**
|
|
/**
|
|
* number of layers that the system will reserve in resources.
|
|
* number of layers that the system will reserve in resources.
|
|
@@ -124,6 +127,16 @@ export class SpriteMap implements ISpriteMap {
|
|
this._output.position = v;
|
|
this._output.position = v;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** Returns the Rotation of Output Plane*/
|
|
|
|
+ public get rotation(): Vector3 {
|
|
|
|
+ return this._output.rotation;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** Returns the Rotation of Output Plane*/
|
|
|
|
+ public set rotation(v: Vector3) {
|
|
|
|
+ this._output.rotation = v;
|
|
|
|
+ }
|
|
|
|
+
|
|
/** Sets the AnimationMap*/
|
|
/** Sets the AnimationMap*/
|
|
public get animationMap() {
|
|
public get animationMap() {
|
|
return this._animationMap;
|
|
return this._animationMap;
|
|
@@ -182,6 +195,7 @@ export class SpriteMap implements ISpriteMap {
|
|
this.options.stageSize = this.options.stageSize || new Vector2(1, 1);
|
|
this.options.stageSize = this.options.stageSize || new Vector2(1, 1);
|
|
this.options.outputSize = this.options.outputSize || this.options.stageSize;
|
|
this.options.outputSize = this.options.outputSize || this.options.stageSize;
|
|
this.options.outputPosition = this.options.outputPosition || Vector3.Zero();
|
|
this.options.outputPosition = this.options.outputPosition || Vector3.Zero();
|
|
|
|
+ this.options.outputRotation = this.options.outputRotation || Vector3.Zero();
|
|
this.options.layerCount = this.options.layerCount || 1;
|
|
this.options.layerCount = this.options.layerCount || 1;
|
|
this.options.maxAnimationFrames = this.options.maxAnimationFrames || 0;
|
|
this.options.maxAnimationFrames = this.options.maxAnimationFrames || 0;
|
|
this.options.baseTile = this.options.baseTile || 0;
|
|
this.options.baseTile = this.options.baseTile || 0;
|
|
@@ -462,6 +476,7 @@ export class SpriteMap implements ISpriteMap {
|
|
*/
|
|
*/
|
|
private _createTileAnimationBuffer(buffer: Nullable<ArrayBufferView>): RawTexture {
|
|
private _createTileAnimationBuffer(buffer: Nullable<ArrayBufferView>): RawTexture {
|
|
let data = new Array();
|
|
let data = new Array();
|
|
|
|
+ let floatArray;
|
|
if (!buffer) {
|
|
if (!buffer) {
|
|
for (let i = 0; i < this.spriteCount; i++) {
|
|
for (let i = 0; i < this.spriteCount; i++) {
|
|
data.push(0, 0, 0, 0);
|
|
data.push(0, 0, 0, 0);
|
|
@@ -471,11 +486,11 @@ export class SpriteMap implements ISpriteMap {
|
|
count++;
|
|
count++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ floatArray = new Float32Array(data);
|
|
} else {
|
|
} else {
|
|
- data = new Array(buffer);
|
|
|
|
|
|
+ floatArray = buffer;
|
|
}
|
|
}
|
|
|
|
|
|
- let floatArray = new Float32Array(data);
|
|
|
|
let t = RawTexture.CreateRGBATexture(
|
|
let t = RawTexture.CreateRGBATexture(
|
|
floatArray,
|
|
floatArray,
|
|
this.spriteCount,
|
|
this.spriteCount,
|
|
@@ -489,6 +504,7 @@ export class SpriteMap implements ISpriteMap {
|
|
|
|
|
|
return t;
|
|
return t;
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Modifies the data of the animationMap
|
|
* Modifies the data of the animationMap
|
|
* @param cellID is the Index of the Sprite
|
|
* @param cellID is the Index of the Sprite
|
|
@@ -503,9 +519,9 @@ export class SpriteMap implements ISpriteMap {
|
|
if (!buffer) {
|
|
if (!buffer) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- buffer[id || 0] = toCell;
|
|
|
|
- buffer[id + 1 || 0] = time;
|
|
|
|
- buffer[id + 2 || 0] = speed;
|
|
|
|
|
|
+ buffer[id] = toCell;
|
|
|
|
+ buffer[id + 1 ] = time;
|
|
|
|
+ buffer[id + 2 ] = speed;
|
|
let t = this._createTileAnimationBuffer(buffer);
|
|
let t = this._createTileAnimationBuffer(buffer);
|
|
this._animationMap.dispose();
|
|
this._animationMap.dispose();
|
|
this._animationMap = t;
|
|
this._animationMap = t;
|