-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpattern.js
More file actions
28 lines (25 loc) · 788 Bytes
/
pattern.js
File metadata and controls
28 lines (25 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pc.script.attribute('entry', 'number');
pc.script.attribute('exit', 'number');
pc.script.attribute('weight', 'number', 1, {
min: 1
});
pc.script.attribute('difficulty', 'number', 1, {
min: 1
});
pc.script.attribute('spaceAfter', 'number', 10);
pc.script.attribute('isBonusMode', 'boolean', false);
pc.script.attribute('horizontalScale', 'number', 1);
pc.script.create('pattern', function (context) {
var Pattern = function (entity) {
this.entity = entity;
};
Pattern.prototype = {
initialize: function () {
this.width = 0;
this.entity.getChildren().forEach(function (child) {
this.width = Math.max(child.getLocalPosition().x, this.width);
}.bind(this));
}
};
return Pattern;
});