Transform2DPlugin

View source

ExtendsPlugin

Adds 2D transform support to an App.

Register this plugin to compute global transforms from each entity’s local 2D position, orientation, and scale values. Entities in a hierarchy inherit their parent entities’ transforms. The plugin requires CorePlugin, ReflectPlugin, and HierarchyPlugin.

Examples

import { App } from '@wimaengine/app'
import { CorePlugin } from '@wimaengine/core'
import { HierarchyPlugin } from '@wimaengine/hierarchy'
import { ReflectPlugin } from '@wimaengine/reflect'
import { Transform2DPlugin } from '@wimaengine/transform'

new App()
  .registerPlugin(new ReflectPlugin())
  .registerPlugin(new CorePlugin())
  .registerPlugin(new HierarchyPlugin())
  .registerPlugin(new Transform2DPlugin())
  .run()

Constructor


constructor()

Methods


register(app: App): void

View source

Enables 2D transform support for an App.

Entities with local 2D position, orientation, and scale values receive composed global transforms, and child entities inherit their parent’s transform through the hierarchy.

Parameters

NameDescriptionDefault
app

App to configure.

—