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 */