import {StaticMapEntityComponent} from 'shapez.io/js/game/components/static_map_entity.js'StaticMapEntityComponent
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
|
|
| public static |
getSchema(): {"origin": *, "rotation": *, "originalRotation": *, "code": *} |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(param0: object) |
|
Method Summary
| Public Methods | ||
| public |
applyRotationToVector(vector: Vector): Vector Transforms the given vector/rotation from local space to world space |
|
| public |
copyAdditionalStateTo(otherComponent: Component): * Copy the current state to another component |
|
| public |
drawSpriteOnBoundsClipped(parameters: DrawParameters, sprite: AtlasSprite, extrudePixels: number=, overridePosition: Vector=) Draws a sprite over the whole space of the entity |
|
| public |
Returns the blueprint sprite |
|
| public |
getMetaBuilding(): import("../meta_building").MetaBuilding Returns the meta building |
|
| public |
Returns the silhouette color |
|
| public |
Returns the sprite |
|
| public |
Returns the effective tile size |
|
| public |
Returns the effective rectangle of this entity in tile space |
|
| public |
getVariant(): string Returns the buildings variant |
|
| public |
localDirectionToWorld(direction: enumDirection): enumDirection Transforms the given direction from local space |
|
| public |
localTileToWorld(localTile: Vector): Vector Transforms from local tile space to global tile space |
|
| public |
shouldBeDrawn(parameters: DrawParameters): * Returns whether the entity should be drawn for the given parameters |
|
| public |
unapplyRotationToVector(vector: Vector): Vector Transforms the given vector/rotation from world space to local space |
|
| public |
worldDirectionToLocal(direction: enumDirection): enumDirection Transforms the given direction from world to local space |
|
| public |
worldToLocalTile(worldTile: Vector): * Transforms from world space to local space |
|
Inherited Summary
| From class BasicSerializableObject | ||
| public static |
|
|
| public static |
getId() |
|
| public static |
Should return the serialization schema |
|
| public static |
|
|
| public |
deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void |
|
| public |
|
|
| From class Component | ||
| public static |
Returns the components unique id |
|
| public static |
getSchema(): {} Should return the schema used for serialization |
|
| public |
copyAdditionalStateTo(otherComponent: Component) Copy the current state to another component |
|
| public |
Returns a string representing the components data, only in dev builds |
|
Static Public Methods
public static getSchema(): {"origin": *, "rotation": *, "originalRotation": *, "code": *} source
Should return the schema used for serialization
Override:
Component#getSchemaReturn:
| {"origin": *, "rotation": *, "originalRotation": *, "code": *} |
Public Constructors
public constructor(param0: object) source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
Component#constructorParams:
| Name | Type | Attribute | Description |
| param0 | object | ||
| param0.origin | Vector= | Origin (Top Left corner) of the entity |
|
| param0.tileSize | Vector= | Size of the entity in tiles |
|
| param0.rotation | number= | Rotation in degrees. Must be multiple of 90 |
|
| param0.originalRotation | number= | Original Rotation in degrees. Must be multiple of 90 |
|
| param0.code | String= | Building code |
Public Members
public code: * source
public origin: * source
public originalRotation: * source
public rotation: * source
Public Methods
public applyRotationToVector(vector: Vector): Vector source
Transforms the given vector/rotation from local space to world space
Params:
| Name | Type | Attribute | Description |
| vector | Vector |
public copyAdditionalStateTo(otherComponent: Component): * source
Copy the current state to another component
Override:
Component#copyAdditionalStateToParams:
| Name | Type | Attribute | Description |
| otherComponent | Component |
Return:
| * |
public drawSpriteOnBoundsClipped(parameters: DrawParameters, sprite: AtlasSprite, extrudePixels: number=, overridePosition: Vector=) source
Draws a sprite over the whole space of the entity
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters | ||
| sprite | AtlasSprite | ||
| extrudePixels | number= | How many pixels to extrude the sprite |
|
| overridePosition | Vector= | Whether to drwa the entity at a different location |
public getMetaBuilding(): import("../meta_building").MetaBuilding source
Returns the meta building
Return:
| import("../meta_building").MetaBuilding |
public getTileSpaceBounds(): Rectangle source
Returns the effective rectangle of this entity in tile space
public localDirectionToWorld(direction: enumDirection): enumDirection source
Transforms the given direction from local space
Params:
| Name | Type | Attribute | Description |
| direction | enumDirection |
public localTileToWorld(localTile: Vector): Vector source
Transforms from local tile space to global tile space
Params:
| Name | Type | Attribute | Description |
| localTile | Vector |
public shouldBeDrawn(parameters: DrawParameters): * source
Returns whether the entity should be drawn for the given parameters
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
Return:
| * |
public unapplyRotationToVector(vector: Vector): Vector source
Transforms the given vector/rotation from world space to local space
Params:
| Name | Type | Attribute | Description |
| vector | Vector |
public worldDirectionToLocal(direction: enumDirection): enumDirection source
Transforms the given direction from world to local space
Params:
| Name | Type | Attribute | Description |
| direction | enumDirection |
