UPaperTileMapComponent

Inheritance Hierarchy

Syntax

UCLASS (HideCategories=Object , ClassGroup=Paper2D , EarlyAccessPreview,
       Meta=(BlueprintSpawnableComponent))
class UPaperTileMapComponent : public UMeshComponent

Remarks

A component that handles rendering and collision for a single instance of a UPaperTileMap asset.

This component is created when you drag a tile map asset from the content browser into a Blueprint, or contained inside of the actor created when you drag one into the level.

NOTE: This is an early access preview class. While not considered production-ready, it is a step beyond 'experimental' and is being provided as a preview of things to come:

  • We will try to provide forward-compatibility for content you create.

  • The classes may change significantly in the future.

  • The code is in an early state and may not meet the desired polish / quality bar.

  • There is probably no documentation or example content yet.

  • They will be promoted out of 'Early Access' when they are production ready.

Variables

Name Description

Public variable UProperty Category, EditAnywhere

bool

 

bShowOutlineWhenUnselected

Should this component show an outline around the first layer when the component is not selected?

Public variable UProperty Category, EditAnywhere

bool

 

bShowPerLayerGridWhenSelected

Should this component show an outline around each layer when the component is selected?

Public variable UProperty Category, EditAnywhere

bool

 

bShowPerTileGridWhenSelected

Should this component show a tile grid when the component is selected?

Protected variable

friend

 

FPaperTileMapRenderSceneProxy

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

UPaperTileMap &...

 

TileMap

The tile map used by this component.

Functions

Name Description

Public function UFunction BlueprintCallable, Category

UPaperTileLa ...

 

AddNewLayer()

Creates and adds a new layer to the tile map Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets

Public function

void

 

CreateNewOwnedTileMap()

End of UPrimitiveComponent interface.

Public function UFunction BlueprintCallable, Category

void

 

CreateNewTileMap

(
    int32 MapWidth,
    int32 MapHeight,
    int32 TileWidth,
    int32 TileHeight,
    float PixelsPerUnrealUnit,
    bool bCreateLayer
)

Creates a new tile map of the specified size, replacing the TileMap reference (or dropping the previous owned one)

Public function UFunction BlueprintPure, Category

FLinearColor

 

GetLayerColor

(
    int32 Layer
)

Gets the per-layer color multiplier for a specific layer (multiplied with the tile map color and passed to the material as a vertex color)

Public function UFunction BlueprintCallable, Category

void

 

GetMapSize

(
    int32& MapWidth,
    int32& MapHeight,
    int32& NumLayers
)

Returns the size of the tile map.

Public function

void

 

GetRenderingStats

(
    int32& OutNumTriangles,
    int32& OutNumBatches
)

Returns the rendering stats for this component.

Public function UFunction BlueprintPure, Category, Meta

FPaperTileIn ...

 

GetTile

(
    int32 X,
    int32 Y,
    int32 Layer
)

Returns the contents of a specified tile cell.

Public function UFunction BlueprintPure, Category

FVector

 

GetTileCenterPosition

(
    int32 TileX,
    int32 TileY,
    int32 LayerIndex,
    bool bWorldSpace
)

Returns the position of the center of the specified tile.

Public function UFunction BlueprintPure, Category

FVector

 

GetTileCornerPosition

(
    int32 TileX,
    int32 TileY,
    int32 LayerIndex,
    bool bWorldSpace
)

Returns the position of the top left corner of the specified tile.

Public function UFunction BlueprintPure, Category

FLinearColor

 

GetTileMapColor()

Gets the tile map global color multiplier (multiplied with the per-layer color and passed to the material as a vertex color)

Public function UFunction BlueprintPure, Category

void

 

GetTilePolygon

(
    int32 TileX,
    int32 TileY,
    TArray < FVector >& Points,
    int32 LayerIndex,
    bool bWorldSpace
)

Returns the polygon for the specified tile (will be 4 or 6 vertices as a rectangle, diamond, or hexagon)

Public function

FLinearColor

 

GetWireframeColor()

Returns the wireframe color to use for this component.

Public function UFunction BlueprintCallable, Category

void

 

MakeTileMapEditable()

Makes the tile map asset pointed to by this component editable.

Public function UFunction BlueprintCallable, Category

bool

 

OwnsTileMap()

Does this component own the tile map (is it instanced instead of being an asset reference)?

Public function UFunction BlueprintCallable, Category

void

 

RebuildCollision()

Rebuilds collision for the tile map.

Protected function

void

 

RebuildRenderData

(
    TArray < FSpriteRenderSection >& Se...,
    TArray < FPaperSpriteVertex >& Vert...
)

Public function UFunction BlueprintCallable, Category

void

 

ResizeMap

(
    int32 NewWidthInTiles,
    int32 NewHeightInTiles
)

Resizes the tile map (Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets)

Public function UFunction BlueprintCallable, Category

void

 

SetDefaultCollisionThickness

(
    float Thickness,
    bool bRebuildCollision
)

Sets the default thickness for any layers that don't override the collision thickness Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets

Public function UFunction BlueprintCallable, Category

void

 

SetLayerCollision

(
    int32 Layer,
    bool bHasCollision,
    bool bOverrideThickness,
    float CustomThickness,
    bool bOverrideOffset,
    float CustomOffset,
    bool bRebuildCollision
)

Sets the collision thickness for a specific layer Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets

Public function UFunction BlueprintCallable, Category

void

 

SetLayerColor

(
    FLinearColor NewColor,
    int32 Layer
)

Sets the per-layer color multiplier for a specific layer (multiplied with the tile map color and passed to the material as a vertex color) Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets

Public function UFunction BlueprintCallable, Category, Meta

void

 

SetTile

(
    int32 X,
    int32 Y,
    int32 Layer,
    FPaperTileInfo NewValue
)

Modifies the contents of a specified tile cell (Note: This will only work on components that own their own tile map (OwnsTileMap returns true), you cannot modify standalone tile map assets) Note: Does not update collision by default, call RebuildCollision after all edits have been done in a frame if necessary

Public function Virtual UFunction BlueprintCallable, Category

bool

 

SetTileMap

(
    UPaperTileMap * NewTileMap
)

Change the PaperTileMap used by this instance.

Public function UFunction BlueprintCallable, Category

void

 

SetTileMapColor

(
    FLinearColor NewColor
)

Sets the tile map global color multiplier (multiplied with the per-layer color and passed to the material as a vertex color)

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc ...

 

CreateSceneProxy()

End of UActorComponent interface.

Public function Virtual

UBodySetup &...

 

GetBodySetup()

Return the BodySetup to use for this PrimitiveComponent (single body case)

Public function Virtual

UMaterialInt ...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual

int32

 

GetNumMaterials()

Number of material elements in this primitive

Public function Virtual

void

 

GetUsedTextures

(
    TArray < UTexture* >& OutTextu...,
    EMaterialQualityLevel::Type Quality...
)

Returns the material textures used to render this primitive for the given platform.

Overridden from USceneComponent

Name Description

Public function Virtual

FBoxSphereBo ...

 

CalcBounds

(
    const FTransform & LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Overridden from UActorComponent

Name Description

Public function Virtual

const UObjec ...

 

AdditionalStatObject()

End of UObject interface.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostInitProperties()

UObject interface.

Public function Virtual

void

 

PostLoad()

WITH_EDITOR.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

See Also

References

Module

Paper2D