Skip to content

Instantly share code, notes, and snippets.

@juanigallo
Created March 9, 2022 18:38
Show Gist options
  • Save juanigallo/28f21d5ec1728a2d8c16729556df5f92 to your computer and use it in GitHub Desktop.
Save juanigallo/28f21d5ec1728a2d8c16729556df5f92 to your computer and use it in GitHub Desktop.
// Instanciamos una nueva entidad
const nameEntity = new Entity();
// Instanciamos un texto con el valor @JuaniGallo
const myName = new TextShape("@JuaniGallo");
// Asociamos nuestro nombre a la entidad que creamos al principio
nameEntity.addComponent(myName);
// Posicionamos nuestra entidad principal
nameEntity.addComponent(new Transform({ position: new Vector3(8, 1, 8) }));
// Asociamos la entidad al engine
engine.addEntity(nameEntity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment