centering an entity in Crafty.js?

25 views Asked by At

I'm trying to center an entity, but I want it to be center no matter the window configuration.(I'm relatively new to JavaScript and Crafty.js in general, so there might be a really easy fix I'm not seeing.) I've tried creating a variable and dividing the window.innerWindowHeight by 2 and seeing if that will pass as an z coordinate, but no luck.

(The code that I tried) let MiddleZ = window.innerHeight / 2;

0

There are 0 answers