mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[ts] Fixed RegionAttachment#setRegion, now actually sets the region property. Fixed up WebGL example
This commit is contained in:
parent
3c12d54653
commit
b4788a6c42
@ -3970,7 +3970,6 @@ var spine;
|
|||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
};
|
};
|
||||||
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
||||||
@ -4633,6 +4632,7 @@ var spine;
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
};
|
};
|
||||||
RegionAttachment.prototype.updateOffset = function () {
|
RegionAttachment.prototype.updateOffset = function () {
|
||||||
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3793,7 +3793,6 @@ var spine;
|
|||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
};
|
};
|
||||||
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
||||||
@ -4456,6 +4455,7 @@ var spine;
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
};
|
};
|
||||||
RegionAttachment.prototype.updateOffset = function () {
|
RegionAttachment.prototype.updateOffset = function () {
|
||||||
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3793,7 +3793,6 @@ var spine;
|
|||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
};
|
};
|
||||||
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
||||||
@ -4456,6 +4455,7 @@ var spine;
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
};
|
};
|
||||||
RegionAttachment.prototype.updateOffset = function () {
|
RegionAttachment.prototype.updateOffset = function () {
|
||||||
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3793,7 +3793,6 @@ var spine;
|
|||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
};
|
};
|
||||||
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
||||||
@ -4456,6 +4455,7 @@ var spine;
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
};
|
};
|
||||||
RegionAttachment.prototype.updateOffset = function () {
|
RegionAttachment.prototype.updateOffset = function () {
|
||||||
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3793,7 +3793,6 @@ var spine;
|
|||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
var attachment = new spine.RegionAttachment(name);
|
var attachment = new spine.RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
};
|
};
|
||||||
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
TextureAtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {
|
||||||
@ -4456,6 +4455,7 @@ var spine;
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
};
|
};
|
||||||
RegionAttachment.prototype.updateOffset = function () {
|
RegionAttachment.prototype.updateOffset = function () {
|
||||||
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
var regionScaleX = this.width / this.region.originalWidth * this.scaleX;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -43,8 +43,7 @@ module spine {
|
|||||||
if (region == null) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
if (region == null) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
||||||
region.renderObject = region;
|
region.renderObject = region;
|
||||||
let attachment = new RegionAttachment(name);
|
let attachment = new RegionAttachment(name);
|
||||||
attachment.setRegion(region);
|
attachment.setRegion(region);
|
||||||
attachment.region = region;
|
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,6 +113,7 @@ module spine {
|
|||||||
vertices[RegionAttachment.U4] = region.u2;
|
vertices[RegionAttachment.U4] = region.u2;
|
||||||
vertices[RegionAttachment.V4] = region.v2;
|
vertices[RegionAttachment.V4] = region.v2;
|
||||||
}
|
}
|
||||||
|
this.region = region;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateOffset () : void {
|
updateOffset () : void {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ function load () {
|
|||||||
skeletons["spineboy"] = loadSkeleton("spineboy", "run", false);
|
skeletons["spineboy"] = loadSkeleton("spineboy", "run", false);
|
||||||
skeletons["raptor"] = loadSkeleton("raptor", "walk", false);
|
skeletons["raptor"] = loadSkeleton("raptor", "walk", false);
|
||||||
skeletons["tank"] = loadSkeleton("tank", "drive", false);
|
skeletons["tank"] = loadSkeleton("tank", "drive", false);
|
||||||
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", true, "goblin");
|
skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");
|
||||||
skeletons["vine"] = loadSkeleton("vine", "animation", false);
|
skeletons["vine"] = loadSkeleton("vine", "animation", false);
|
||||||
skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);
|
skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);
|
||||||
setupUI();
|
setupUI();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user