chore: defaults

This commit is contained in:
cha0s 2021-02-04 23:35:35 -06:00
parent 176fffd9e7
commit 9e0e08e194
2 changed files with 7 additions and 3 deletions

View File

@ -16,7 +16,11 @@ export default () => class Shaped extends decorate(Trait) {
static defaultParams() {
return {
isDebugging: false,
shape: undefined,
shape: {
type: 'rectangle',
position: [0, 0],
size: [0, 0],
},
};
}

View File

@ -204,10 +204,10 @@ export default (latus) => class Animated extends decorate(Trait) {
async load(json) {
await super.load(json);
if (Object.keys(json.params.animations).length > 0) {
if (Object.keys(this.params.animations).length > 0) {
const {Animation} = latus.get('%resources');
const animations = await mapValuesAsync(
json.params.animations,
this.params.animations,
(json) => Animation.load(json),
);
const animationViews = mapValues(