From 2d5459399cd9e3888e4dcbf950c0bcf33868735f Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 24 Mar 2022 08:04:27 -0500 Subject: [PATCH] refactor: viewSize --- packages/topdown/src/index.js | 4 ++++ packages/topdown/src/traits/followed.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/topdown/src/index.js b/packages/topdown/src/index.js index 7a57865..4d1177d 100644 --- a/packages/topdown/src/index.js +++ b/packages/topdown/src/index.js @@ -8,6 +8,10 @@ export default { [Hooks]: { '@avocado/resource.resources': Flecks.provide(require.context('./resources', 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$/)), }, }; diff --git a/packages/topdown/src/traits/followed.js b/packages/topdown/src/traits/followed.js index 2b4531f..e79a90a 100644 --- a/packages/topdown/src/traits/followed.js +++ b/packages/topdown/src/traits/followed.js @@ -2,13 +2,13 @@ import {Trait} from '@avocado/traits'; import Camera from '../camera'; -export default () => class Followed extends Trait { +export default (flecks) => class Followed extends Trait { #camera = new Camera(); static defaultParams() { return { - viewSize: [320, 180], + viewSize: flecks.get('@avocado/topdown.viewSize'), }; }