Navigation
API > API/Plugins > API/Plugins/Paper2D
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.
| Name | UPaperTileMap |
| Type | class |
| Header File | /Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperTileMap.h |
| Include Path | #include "PaperTileMap.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType)
class UPaperTileMap : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UPaperTileMap
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPaperTileMap
(
const FObjectInitializer& ObjectInitializer |
PaperTileMap.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AssetImportData | TObjectPtr< class UAssetImportData > | Importing data and options used for this tile map | PaperTileMap.h |
|
| BackgroundColor | FLinearColor | The background color displayed in the tile map editor | PaperTileMap.h |
|
| BodySetup | TObjectPtr< UBodySetup > | Baked physics data. | PaperTileMap.h | |
| HexSideLength | int32 | The vertical height of the sides of the hex cell for a tile. | PaperTileMap.h |
|
| LayerGridColor | FLinearColor | The color of the layer grid | PaperTileMap.h |
|
| LayerNameIndex | int32 | The naming index to start at when trying to create a new layer | PaperTileMap.h | |
| MapHeight | int32 | Height of map (in tiles) | PaperTileMap.h |
|
| MapWidth | int32 | Width of map (in tiles) | PaperTileMap.h |
|
| Material | TObjectPtr< UMaterialInterface > | The material to use on a tile map instance if not overridden. | PaperTileMap.h |
|
| MultiTileGridColor | FLinearColor | The color of the multi tile grid | PaperTileMap.h |
|
| MultiTileGridHeight | int32 | Number of tiles the multi tile grid spans vertically. 0 removes horizontal lines | PaperTileMap.h |
|
| MultiTileGridOffsetX | int32 | Number of tiles the multi tile grid is shifted to the right | PaperTileMap.h |
|
| MultiTileGridOffsetY | int32 | Number of tiles the multi tile grid is shifted downwards | PaperTileMap.h |
|
| MultiTileGridWidth | int32 | Number of tiles the multi tile grid spans horizontally. 0 removes vertical lines | PaperTileMap.h |
|
| PixelsPerUnrealUnit | float | The scaling factor between pixels and Unreal units (cm) (e.g., 0.64 would make a 64 pixel wide tile take up 100 cm) | PaperTileMap.h |
|
| ProjectionMode | TEnumAsByte< ETileMapProjectionMode::Type > | Tile map type. | PaperTileMap.h |
|
| SelectedLayerIndex | int32 | The currently selected layer index | PaperTileMap.h | |
| SelectedTileSet | TSoftObjectPtr< UPaperTileSet > | Last tile set that was selected when editing the tile map. | PaperTileMap.h | |
| SeparationPerLayer | float | The Z-separation between each layer of the tile map. | PaperTileMap.h |
|
| SeparationPerTileX | float | The Z-separation incurred as you travel in X (not strictly applied, batched tiles will be put at the same Z level) | PaperTileMap.h |
|
| SeparationPerTileY | float | The Z-separation incurred as you travel in Y (not strictly applied, batched tiles will be put at the same Z level) | PaperTileMap.h |
|
| TileGridColor | FLinearColor | The color of the tile grid | PaperTileMap.h |
|
| TileHeight | int32 | Height of one tile (in pixels) | PaperTileMap.h |
|
| TileLayers | TArray< TObjectPtr< UPaperTileLayer > > | The list of layers. | PaperTileMap.h |
|
| TileWidth | int32 | Width of one tile (in pixels) | PaperTileMap.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddExistingLayer
(
UPaperTileLayer* NewLayer, |
Handles adding an existing layer that does not belong to any existing tile map. | PaperTileMap.h | |
UPaperTileLayer * AddNewLayer
(
int32 InsertionIndex |
Creates and adds a new layer and returns it. | PaperTileMap.h | |
UPaperTileMap * CloneTileMap
(
UObject* OuterForClone |
Creates a clone of this tile map in the specified outer. | PaperTileMap.h | |
float GetCollisionThickness() |
Returns the extrusion thickness of collision geometry when using a 3D collision domain. | PaperTileMap.h | |
void GetLocalToTileParameters
(
FVector& OutCornerPosition, |
PaperTileMap.h | ||
float GetPixelsPerUnrealUnit() |
Return the scaling factor between pixels and Unreal units (cm) | PaperTileMap.h | |
FBoxSphereBounds GetRenderBounds() |
PaperTileMap.h | ||
ESpriteCollisionMode::Type GetSpriteCollisionDomain() |
Returns the collision domain (no collision, 2D, or 3D) | PaperTileMap.h | |
FVector GetTileCenterInLocalSpace
(
float TileX, |
Returns the center of the specified tile in local space. | PaperTileMap.h | |
void GetTileCoordinatesFromLocalSpacePosition
(
const FVector& Position, |
Returns the tile coordinates of the specified local space position. | PaperTileMap.h | |
void GetTilePolygon
(
int32 TileX, |
Returns the polygon for the specified tile (will be 4 or 6 vertices as a rectangle, diamond, or hexagon) | PaperTileMap.h | |
FVector GetTilePositionInLocalSpace
(
float TileX, |
Returns the top left corner of the specified tile in local space. | PaperTileMap.h | |
void GetTileToLocalParameters
(
FVector& OutCornerPosition, |
PaperTileMap.h | ||
float GetUnrealUnitsPerPixel() |
Return the scaling factor between Unreal units (cm) and pixels. | PaperTileMap.h | |
void InitializeNewEmptyTileMap
(
UPaperTileSet* DefaultTileSetAsset |
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 | PaperTileMap.h | |
bool IsLayerNameInUse
(
const FText& LayerName |
Returns true if the specified name is already in use as a layer name. | PaperTileMap.h | |
void RebuildCollision() |
Rebuild collision and recreate the body setup. | PaperTileMap.h | |
void ResizeMap
(
int32 NewWidth, |
Resize the tile map and all layers. | PaperTileMap.h | |
void SetCollisionDomain
(
ESpriteCollisionMode::Type Domain |
Sets the collision domain. | PaperTileMap.h | |
void SetCollisionThickness
(
float Thickness |
Sets the collision thickness. | PaperTileMap.h | |
bool UsesTileSet
(
UPaperTileSet* TileSet |
Checks to see if this tile map uses the specified tile set Note: This is a slow operation, it scans each tile of each layer! | PaperTileMap.h | |
void ValidateSelectedLayerIndex() |
PaperTileMap.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CanEditChange
(
const FProperty* InProperty |
PaperTileMap.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
PaperTileMap.h | ||
virtual void GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
PaperTileMap.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
PaperTileMap.h | ||
virtual void PostInitProperties() |
PaperTileMap.h | ||
virtual void PostLoad() |
PaperTileMap.h | ||
virtual void PreEditChange
(
FProperty* PropertyAboutToChange |
PaperTileMap.h | ||
virtual void Serialize
(
FArchive& Ar |
PaperTileMap.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void UpdateBodySetup() |
PaperTileMap.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FText GenerateNewLayerName
(
UPaperTileMap* TileMap |
Creates a reasonable new layer name. | PaperTileMap.h |