Home Reference Source
import {StaticMapEntityComponent} from 'shapez.io/js/game/components/static_map_entity.js'
public class | source

StaticMapEntityComponent

Extends:

BasicSerializableObjectComponent → StaticMapEntityComponent

Static Method Summary

Static Public Methods
public static
public static

getSchema(): {"origin": *, "rotation": *, "originalRotation": *, "code": *}

Constructor Summary

Public Constructor
public

constructor(param0: object)

Member Summary

Public Members
public

code: *

public

origin: *

public
public

Method Summary

Public Methods
public

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

Returns the buildings variant

public

Transforms the given direction from local space

public

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

Transforms the given vector/rotation from world space to local space

public

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

verify(data: *): string | void

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 getId(): string source

Returns the components unique id

Override:

Component#getId

Return:

string

public static getSchema(): {"origin": *, "rotation": *, "originalRotation": *, "code": *} source

Should return the schema used for serialization

Override:

Component#getSchema

Return:

{"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#constructor

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
vector Vector

Return:

Vector

public copyAdditionalStateTo(otherComponent: Component): * source

Copy the current state to another component

Override:

Component#copyAdditionalStateTo

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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 getBlueprintSprite(): AtlasSprite source

Returns the blueprint sprite

Return:

AtlasSprite

public getMetaBuilding(): import("../meta_building").MetaBuilding source

Returns the meta building

Return:

import("../meta_building").MetaBuilding

public getSilhouetteColor(): string source

Returns the silhouette color

Return:

string

public getSprite(): AtlasSprite source

Returns the sprite

Return:

AtlasSprite

public getTileSize(): Vector source

Returns the effective tile size

Return:

Vector

public getTileSpaceBounds(): Rectangle source

Returns the effective rectangle of this entity in tile space

Return:

Rectangle

public getVariant(): string source

Returns the buildings variant

Return:

string

public localDirectionToWorld(direction: enumDirection): enumDirection source

Transforms the given direction from local space

Params:

NameTypeAttributeDescription
direction enumDirection

Return:

enumDirection

public localTileToWorld(localTile: Vector): Vector source

Transforms from local tile space to global tile space

Params:

NameTypeAttributeDescription
localTile Vector

Return:

Vector

public shouldBeDrawn(parameters: DrawParameters): * source

Returns whether the entity should be drawn for the given parameters

Params:

NameTypeAttributeDescription
parameters DrawParameters

Return:

*

public unapplyRotationToVector(vector: Vector): Vector source

Transforms the given vector/rotation from world space to local space

Params:

NameTypeAttributeDescription
vector Vector

Return:

Vector

public worldDirectionToLocal(direction: enumDirection): enumDirection source

Transforms the given direction from world to local space

Params:

NameTypeAttributeDescription
direction enumDirection

Return:

enumDirection

public worldToLocalTile(worldTile: Vector): * source

Transforms from world space to local space

Params:

NameTypeAttributeDescription
worldTile Vector

Return:

*