PAPER2UPaperTileMapComponent

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

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Paper2D

Header

/Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperTileMapComponent.h

Include

#include "PaperTileMapComponent.h"

Syntax

UCLASS(HideCategories=Object, ClassGroup=Paper2D, EarlyAccessPreview,
       Meta=(BlueprintSpawnableComponent))
class PAPER2UPaperTileMapComponent : 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 beta 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 'beta' 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

 

bShowPerLayerGridWhenUnselected

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

Public variable UProperty Category, EditAnywhere

bool

 

bShowPerTileGridWhenSelected

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

Public variable UProperty Category, EditAnywhere

bool

 

bShowPerTileGridWhenUnselected

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

Protected variable

friend

 

FPaperTileMapRenderSceneProxy

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

UPaperTileMap &...

 

TileMap

The tile map used by this component.

Constructors

Name Description

Public function

PAPER2UPaperTileMapComponent

(
    const FObjectInitializer& ObjectIn...
)

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()

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

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 Const 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 Const

void

 

GetRenderingStats

(
    int32& OutNumTriangles,
    int32& OutNumBatches
)

Returns the rendering stats for this component.

Public function Const UFunction BlueprintPure, Category, Meta

FPaperTileIn...

 

GetTile

(
    int32 X,
    int32 Y,
    int32 Layer
)

Returns the contents of a specified tile cell.

Public function Const 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 Const 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 Const 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 Const 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 Const

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 Const 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< FDynamicMeshVertex >& 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()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

UBodySetup &...

 

GetBodySetup()

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

Public function Virtual Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual Const

int32

 

GetNumMaterials()

Return 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 Const

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

const UObjec...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

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()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

See Also

UPrimitiveComponent

UPaperTileMap

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback