refactor: viewSize

This commit is contained in:
cha0s 2022-03-24 08:04:27 -05:00
parent 536562c061
commit 2d5459399c
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,10 @@ export default {
[Hooks]: { [Hooks]: {
'@avocado/resource.resources': Flecks.provide(require.context('./resources', false, /\.js$/)), '@avocado/resource.resources': Flecks.provide(require.context('./resources', false, /\.js$/)),
'@avocado/traits.traits': Flecks.provide(require.context('./traits', false, /\.js$/)), '@avocado/traits.traits': Flecks.provide(require.context('./traits', false, /\.js$/)),
'@flecks/core.config': () => ({
// The default view size.
viewSize: [320, 180],
}),
'@flecks/socket.packets': Flecks.provide(require.context('./packets', false, /\.js$/)), '@flecks/socket.packets': Flecks.provide(require.context('./packets', false, /\.js$/)),
}, },
}; };

View File

@ -2,13 +2,13 @@ import {Trait} from '@avocado/traits';
import Camera from '../camera'; import Camera from '../camera';
export default () => class Followed extends Trait { export default (flecks) => class Followed extends Trait {
#camera = new Camera(); #camera = new Camera();
static defaultParams() { static defaultParams() {
return { return {
viewSize: [320, 180], viewSize: flecks.get('@avocado/topdown.viewSize'),
}; };
} }