Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Add Collisions enabled property
Browse files Browse the repository at this point in the history
  • Loading branch information
MikalDev committed Jan 4, 2020
1 parent 9861869 commit 5e0ddef
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
Binary file added dist/Spine-v1.4.3.c3addon
Binary file not shown.
2 changes: 1 addition & 1 deletion src/addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "plugin",
"name": "Spine",
"id": "Gritsenko_Spine",
"version": "1.4.2.0",
"version": "1.4.3.0",
"author": "Igor Gritsenko",
"website": "https://www.gritsenko.biz",
"documentation": "https://www.construct.net",
Expand Down
4 changes: 4 additions & 0 deletions src/c3runtime/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
this.skeletonName = properties[5];
this.skeletonScale = properties[6];
this.premultipliedAlpha = properties[7];
this.collisionsEnabled = properties[8];
}

this.isMirrored = false;
Expand Down Expand Up @@ -489,6 +490,9 @@
// Create texture if it does not exist (could this be done in constructor?)
if (this._elementTexture === null || this._newElementId) {

// Enable collisions based on property, add ACEs if needed
wi.SetCollisionEnabled(this.collisionsEnabled);

if (this._elementTexture !== null) {
renderer.DeleteTexture(this._elementTexture);
}
Expand Down
4 changes: 4 additions & 0 deletions src/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"pre-mult-alpha": {
"name": "PreMultiplyAlpha",
"desc": "Pre Multiply Alpha Texture"
},
"collisions": {
"name": "Enable collisions",
"desc": "Whether the object will register collision events or not."
}
},
"aceCategories": {
Expand Down
5 changes: 3 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{

const PLUGIN_ID = "Gritsenko_Spine";
const PLUGIN_VERSION = "1.4.2.0";
const PLUGIN_VERSION = "1.4.3.0";
const PLUGIN_CATEGORY = "general";

const PLUGIN_CLASS = SDK.Plugins.Gritsenko_Spine = class SpinePlugin extends SDK.IPluginBase {
Expand Down Expand Up @@ -54,7 +54,8 @@
new SDK.PluginProperty("text", "animation", "idle"),
new SDK.PluginProperty("text", "skeleton", ""),
new SDK.PluginProperty("float", "scale", 1),
new SDK.PluginProperty("check", "pre-mult-alpha", false)
new SDK.PluginProperty("check", "pre-mult-alpha", false),
new SDK.PluginProperty("check", "collisions", true)
]);
SDK.Lang.PopContext(); //.properties
SDK.Lang.PopContext();
Expand Down

0 comments on commit 5e0ddef

Please sign in to comment.