wgge 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,9 @@ export default class ObjectModel extends ModelBase {
19
19
  }
20
20
 
21
21
  addProperty(name, property) {
22
+ if (this.properties.exists(name)) {
23
+ console.warn(`Property ${name} already set! Overriding.`);
24
+ }
22
25
  return this.properties.add(name, property);
23
26
  }
24
27
 
@@ -79,4 +79,8 @@ export default class Quaternion extends ObjectModel {
79
79
  this.setFromArray(state);
80
80
  }
81
81
 
82
+ asRgbaColor() {
83
+ return `rgba(${Math.round(this.x)}, ${Math.round(this.y)}, ${Math.round(this.z)}, ${Math.round(this.w)})`;
84
+ }
85
+
82
86
  }
@@ -79,6 +79,14 @@ export default class SvgRenderer extends RendererBase {
79
79
  element.remember('rotation', rotation);
80
80
  }
81
81
 
82
+ scale(element, scale) {
83
+ if (scale.x !== undefined && scale.y !== undefined) {
84
+ element.scale(scale.x, scale.y);
85
+ } else {
86
+ element.scale(scale, scale);
87
+ }
88
+ }
89
+
82
90
  /**
83
91
  *
84
92
  * @param {SVG.Container|null|undefined} parent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "dependencies": {