PAPER2UPaperTileMap

A tile map is a 2D grid with a defined width and height (in tiles). There can be multiple layers, each of which can specify which tile should appear in each cell of the map for that layer.

Windows
MacOS
Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

PAPER2UPaperTileMap

References

Module

Paper2D

Header

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

Include

#include "PaperTileMap.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(BlueprintType)
class PAPER2UPaperTileMap : public UObject

Remarks

A tile map is a 2D grid with a defined width and height (in tiles). There can be multiple layers, each of which can specify which tile should appear in each cell of the map for that layer.

Variables

Name Description

Public variable UProperty Category instanced, visibleanywhere

UAssetImportDat...

 

AssetImportData

Importing data and options used for this tile map

Public variable UProperty Category, EditAnywhere, Meta

FLinearColor

 

BackgroundColor

The background color displayed in the tile map editor

Public variable UProperty

UBodySetup *...

 

BodySetup

Baked physics data.

Protected variable UProperty Category, EditAnywhere BlueprintReadOnly

float

 

CollisionThickness

The extrusion thickness of collision geometry when using a 3D collision domain.

Public variable UProperty Category, EditAnywhere, Meta

int32

 

HexSideLength

The vertical height of the sides of the hex cell for a tile.

Public variable UProperty Category, EditAnywhere, Meta

FLinearColor

 

LayerGridColor

The color of the layer grid

Public variable UProperty

int32

 

LayerNameIndex

The naming index to start at when trying to create a new layer

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

MapHeight

Height of map (in tiles)

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

MapWidth

Width of map (in tiles)

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

UMaterialInterf...

 

Material

The material to use on a tile map instance if not overridden.

Public variable UProperty Category, EditAnywhere, Meta

FLinearColor

 

MultiTileGridColor

The color of the multi tile grid

Public variable UProperty Category, EditAnywhere, Meta

int32

 

MultiTileGridHeight

Number of tiles the multi tile grid spans vertically. 0 removes horizontal lines

Public variable UProperty Category, EditAnywhere

int32

 

MultiTileGridOffsetX

Number of tiles the multi tile grid is shifted to the right

Public variable UProperty Category, EditAnywhere

int32

 

MultiTileGridOffsetY

Number of tiles the multi tile grid is shifted downwards

Public variable UProperty Category, EditAnywhere, Meta

int32

 

MultiTileGridWidth

Number of tiles the multi tile grid spans horizontally. 0 removes vertical lines

Public variable UProperty Category, EditAnywhere

float

 

PixelsPerUnrealUnit

The scaling factor between pixels and Unreal units (cm) (e.g., 0.64 would make a 64 pixel wide tile take up 100 cm)

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< ET...

 

ProjectionMode

Tile map type.

Public variable UProperty

int32

 

SelectedLayerIndex

The currently selected layer index

Public variable UProperty

TSoftObjectPtr<...

 

SelectedTileSet

Last tile set that was selected when editing the tile map.

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

float

 

SeparationPerLayer

The Z-separation between each layer of the tile map.

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

SeparationPerTileX

The Z-separation incurred as you travel in X (not strictly applied, batched tiles will be put at the same Z level)

Public variable UProperty Category, EditAnywhere, AdvancedDisplay

float

 

SeparationPerTileY

The Z-separation incurred as you travel in Y (not strictly applied, batched tiles will be put at the same Z level)

Protected variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< ES...

 

SpriteCollisionDomain

Collision domain (no collision, 2D, or 3D)

Public variable UProperty Category, EditAnywhere, Meta

FLinearColor

 

TileGridColor

The color of the tile grid

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

TileHeight

Height of one tile (in pixels)

Public variable UProperty Category, EditAnywhere BlueprintReadOnly instanced

TArray< UPaperT...

 

TileLayers

The list of layers.

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

TileWidth

Width of one tile (in pixels)

Constructors

Name Description

Public function

PAPER2UPaperTileMap

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AddExistingLayer

(
    UPaperTileLayer* NewLayer,
    int32 InsertionIndex
)

Handles adding an existing layer that does not belong to any existing tile map.

Public function

UPaperTileLa...

 

AddNewLayer

(
    int32 InsertionIndex
)

Creates and adds a new layer and returns it.

Public function

UPaperTileMa...

 

CloneTileMap

(
    UObject* OuterForClone
)

Creates a clone of this tile map in the specified outer.

Public function Static

FText

 

GenerateNewLayerName

(
    UPaperTileMap* TileMap
)

Creates a reasonable new layer name.

Public function Const

float

 

GetCollisionThickness()

Returns the extrusion thickness of collision geometry when using a 3D collision domain.

Public function Const

void

 

GetLocalToTileParameters

(
    FVector& OutCornerPosition,
    FVector& OutStepX,
    FVector& OutStepY,
    FVector& OutOffsetYFactor
)

Public function Const

float

 

GetPixelsPerUnrealUnit()

Return the scaling factor between pixels and Unreal units (cm)

Public function Const

FBoxSphereBo...

 

GetRenderBounds()

Public function Const

ESpriteColli...

 

GetSpriteCollisionDomain()

Returns the collision domain (no collision, 2D, or 3D)

Public function Const

FVector

 

GetTileCenterInLocalSpace

(
    float TileX,
    float TileY,
    int32 LayerIndex
)

Returns the center of the specified tile in local space.

Public function Const

void

 

GetTileCoordinatesFromLocalSpacePosition

(
    const FVector& Position,
    int32& OutTileX,
    int32& OutTileY
)

Returns the tile coordinates of the specified local space position.

Public function Const

void

 

GetTilePolygon

(
    int32 TileX,
    int32 TileY,
    int32 LayerIndex,
    TArray< FVector >& LocalSpacePoint...
)

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

Public function Const

FVector

 

GetTilePositionInLocalSpace

(
    float TileX,
    float TileY,
    int32 LayerIndex
)

Returns the top left corner of the specified tile in local space.

Public function Const

void

 

GetTileToLocalParameters

(
    FVector& OutCornerPosition,
    FVector& OutStepX,
    FVector& OutStepY,
    FVector& OutOffsetYFactor
)

Public function Const

float

 

GetUnrealUnitsPerPixel()

Return the scaling factor between Unreal units (cm) and pixels.

Public function

void

 

InitializeNewEmptyTileMap

(
    UPaperTileSet* DefaultTileSetA...
)

Called when a fresh tile map has been created (by factory or otherwise) Adds a default layer and pulls the PixelsPerUnrealUnit from the project settings

Public function Const

bool

 

IsLayerNameInUse

(
    const FText& LayerName
)

Returns true if the specified name is already in use as a layer name.

Public function

void

 

RebuildCollision()

Rebuild collision and recreate the body setup.

Public function

void

 

ResizeMap

(
    int32 NewWidth,
    int32 NewHeight,
    bool bForceResize
)

Resize the tile map and all layers.

Public function

void

 

SetCollisionDomain

(
    ESpriteCollisionMode::Type Domain
)

Sets the collision domain.

Public function

void

 

SetCollisionThickness

(
    float Thickness
)

Sets the collision thickness.

Protected function Virtual

void

 

UpdateBodySetup()

Public function Const

bool

 

UsesTileSet

(
    UPaperTileSet* TileSet
)

Checks to see if this tile map uses the specified tile set.

Public function

void

 

ValidateSelectedLayerIndex()

Overridden from UObject

Name Description

Public function Virtual Const

bool

 

CanEditChange

(
    const FProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

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

 

PreEditChange

(
    FProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss