Function Zone

A Zone Game Object.

A Zone is a non-rendering rectangular Game Object that has a position and size. It has no texture and never displays, but does live on the display list and can be moved, scaled and rotated like any other Game Object.

Its primary use is for creating Drop Zones and Input Hit Areas and it has a couple of helper methods specifically for this. It is also useful for object overlap checks, or as a base for your own non-displaying Game Objects. The default origin is 0.5, the center of the Zone, the same as with Game Objects.

  • Parameters

    • props: ObjectProps<Zone> & RecursivePartial<Zone> & { x: number; y: number }

    Returns ReactNode | Promise<ReactNode>

Properties

displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'
propTypes?: any

Ignored by React.

Only kept in types for backwards compatibility. Will be removed in a future major release.