Navigation
API > API/Plugins > API/Plugins/Paper2D
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&40;BlueprintType&41;
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
| Type | Name | Description | |
|---|---|---|---|
| TObjectPtr< class UAssetImportData > | AssetImportData | Importing data and options used for this tile map | |
| FLinearColor | BackgroundColor | The background color displayed in the tile map editor | |
| TObjectPtr< UBodySetup > | BodySetup | Baked physics data. | |
| float | CollisionThickness | The extrusion thickness of collision geometry when using a 3D collision domain. | |
| int32 | HexSideLength | The vertical height of the sides of the hex cell for a tile. | |
| FLinearColor | LayerGridColor | The color of the layer grid | |
| int32 | LayerNameIndex | The naming index to start at when trying to create a new layer | |
| int32 | MapHeight | Height of map (in tiles) | |
| int32 | MapWidth | Width of map (in tiles) | |
| TObjectPtr< UMaterialInterface > | Material | The material to use on a tile map instance if not overridden. | |
| FLinearColor | MultiTileGridColor | The color of the multi tile grid | |
| int32 | MultiTileGridHeight | Number of tiles the multi tile grid spans vertically. 0 removes horizontal lines | |
| int32 | MultiTileGridOffsetX | Number of tiles the multi tile grid is shifted to the right | |
| int32 | MultiTileGridOffsetY | Number of tiles the multi tile grid is shifted downwards | |
| int32 | MultiTileGridWidth | Number of tiles the multi tile grid spans horizontally. 0 removes vertical lines | |
| 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) | |
| TEnumAsByte< ETileMapProjectionMode::Type > | ProjectionMode | Tile map type. | |
| int32 | SelectedLayerIndex | The currently selected layer index | |
| TSoftObjectPtr< UPaperTileSet > | SelectedTileSet | Last tile set that was selected when editing the tile map. | |
| float | SeparationPerLayer | The Z-separation between each layer of the tile map. | |
| float | SeparationPerTileX | The Z-separation incurred as you travel in X (not strictly applied, batched tiles will be put at the same Z level) | |
| float | SeparationPerTileY | The Z-separation incurred as you travel in Y (not strictly applied, batched tiles will be put at the same Z level) | |
| TEnumAsByte< ESpriteCollisionMode::Type > | SpriteCollisionDomain | Collision domain (no collision, 2D, or 3D) | |
| FLinearColor | TileGridColor | The color of the tile grid | |
| int32 | TileHeight | Height of one tile (in pixels) | |
| TArray< TObjectPtr< UPaperTileLayer > > | TileLayers | The list of layers. | |
| int32 | TileWidth | Width of one tile (in pixels) |
Constructors
| Type | Name | Description | |
|---|---|---|---|
PAPER2UPaperTileMap
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddExistingLayer
(
UPaperTileLayer* NewLayer, |
Handles adding an existing layer that does not belong to any existing tile map. | |
| UPaperTileLayer * | AddNewLayer
(
int32 InsertionIndex |
Creates and adds a new layer and returns it. | |
| UPaperTileMap * | CloneTileMap
(
UObject* OuterForClone |
Creates a clone of this tile map in the specified outer. | |
| FText | GenerateNewLayerName
(
UPaperTileMap* TileMap |
Creates a reasonable new layer name. | |
| float | Returns the extrusion thickness of collision geometry when using a 3D collision domain. | ||
| void | GetLocalToTileParameters
(
FVector& OutCornerPosition, |
||
| float | Return the scaling factor between pixels and Unreal units (cm) | ||
| FBoxSphereBounds | |||
| ESpriteCollisionMode::Type | Returns the collision domain (no collision, 2D, or 3D) | ||
| FVector | GetTileCenterInLocalSpace
(
float TileX, |
Returns the center of the specified tile in local space. | |
| void | GetTileCoordinatesFromLocalSpacePosition
(
const FVector& Position, |
Returns the tile coordinates of the specified local space position. | |
| void | GetTilePolygon
(
int32 TileX, |
Returns the polygon for the specified tile (will be 4 or 6 vertices as a rectangle, diamond, or hexagon) | |
| FVector | GetTilePositionInLocalSpace
(
float TileX, |
Returns the top left corner of the specified tile in local space. | |
| void | GetTileToLocalParameters
(
FVector& OutCornerPosition, |
||
| float | Return the scaling factor between Unreal units (cm) and pixels. | ||
| 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 | |
| bool | IsLayerNameInUse
(
const FText& LayerName |
Returns true if the specified name is already in use as a layer name. | |
| void | Rebuild collision and recreate the body setup. | ||
| void | ResizeMap
(
int32 NewWidth, |
Resize the tile map and all layers. | |
| void | SetCollisionDomain
(
ESpriteCollisionMode::Type Domain |
Sets the collision domain. | |
| void | SetCollisionThickness
(
float Thickness |
Sets the collision thickness. | |
| void | |||
| 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! | |
| void |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| bool | CanEditChange
(
const FProperty* InProperty |
Called by the editor to query whether a property of this object is allowed to be modified. | |
| void | GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
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 | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally | |
| void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. | ||
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | PreEditChange
(
FProperty* PropertyAboutToChange |
This is called when a property is about to be modified externally | |
| void | Handles reading, writing, and reference collecting using FArchive. |