From 4cfb14a67eb1690460674b9dcd22c9e2c60706ce Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sun, 19 Nov 2017 15:12:21 +0100 Subject: [PATCH] Update: CC - Entity Loaded - Moorcow (xtihcyhagp.js) 353 bytes modified --- xtihcyhagp.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xtihcyhagp.js b/xtihcyhagp.js index c50a9c8..5ee2be0 100644 --- a/xtihcyhagp.js +++ b/xtihcyhagp.js @@ -25,6 +25,7 @@ this.camera = GameLib.EntityManager.Instance.findComponentById('we15t09ijh'); this.scene = GameLib.EntityManager.Instance.findComponentById('ehjmi1wd09'); this.cursor = GameLib.EntityManager.Instance.findComponentById('s7qlcgc7ex'); +this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); this.thrower = GameLib.EntityManager.Instance.findComponentById('7hfuqjfhmu'); this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); this.treeSmall = GameLib.EntityManager.Instance.findComponentById('obktqebiyq'); @@ -62,6 +63,19 @@ this.mouseUp = GameLib.EntityManager.Instance.findComponentById('monq9ryw7a'); this.mouseDown = GameLib.EntityManager.Instance.findComponentById('d5o2axpc0m'); this.mouseMove = GameLib.EntityManager.Instance.findComponentById('6st4io7ceu'); +GameLib.Event.Subscribe( + GameLib.Event.WINDOW_RESIZE, + function(data) { + var aspect = (data.width / data.height); + this.camera.aspect = aspect; + this.camera.updateInstance('aspect'); + this.renderer.setSize( + data.width, + data.height + ); + } +); + /** * Tell all our custom code components that we loaded */