Navigation
API > API/Plugins > API/Plugins/Paper2D
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.
| Name | UPaperTileMapComponent |
| Type | class |
| Header File | /Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperTileMapComponent.h |
| Include Path | #include "PaperTileMapComponent.h" |
Syntax
UCLASS (MinimalAPI, HideCategories=Object, ClassGroup=Paper2D, EarlyAccessPreview,
Meta=(BlueprintSpawnableComponent))
class UPaperTileMapComponent : public UMeshComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UMeshComponent → UPaperTileMapComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPaperTileMapComponent
(
const FObjectInitializer& ObjectInitializer |
PaperTileMapComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bShowOutlineWhenUnselected | bool | Should this component show an outline around the first layer when the component is not selected? | PaperTileMapComponent.h |
|
| bShowPerLayerGridWhenSelected | bool | Should this component show an outline around each layer when the component is selected? | PaperTileMapComponent.h |
|
| bShowPerLayerGridWhenUnselected | bool | Should this component show an outline around each layer when the component is not selected? | PaperTileMapComponent.h |
|
| bShowPerTileGridWhenSelected | bool | Should this component show a tile grid when the component is selected? | PaperTileMapComponent.h |
|
| bShowPerTileGridWhenUnselected | bool | Should this component show a tile grid when the component is not selected? | PaperTileMapComponent.h |
|
| TileMap | TObjectPtr< class UPaperTileMap > | The tile map used by this component. | PaperTileMapComponent.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bUseSingleLayer | bool | Should we draw a single layer? | PaperTileMapComponent.h |
|
| NumBatches | int32 | The number of batches required to render this tile map. | PaperTileMapComponent.h | |
| NumTriangles | int32 | The number of triangles rendered in this tile map. | PaperTileMapComponent.h | |
| TileMapColor | FLinearColor | The color of the tile map (multiplied with the per-layer color and passed to the material as a vertex color) | PaperTileMapComponent.h |
|
| UseSingleLayerIndex | int32 | The index of the single layer to use if enabled. | PaperTileMapComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UPaperTileLayer * 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 | PaperTileMapComponent.h |
|
void CreateNewOwnedTileMap() |
Creates a new tile map internally, replacing the TileMap reference (or dropping the previous owned one) | PaperTileMapComponent.h | |
void CreateNewTileMap
(
int32 MapWidth, |
Creates a new tile map of the specified size, replacing the TileMap reference (or dropping the previous owned one) | PaperTileMapComponent.h |
|
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) | PaperTileMapComponent.h |
|
void GetMapSize
(
int32& MapWidth, |
Returns the size of the tile map. | PaperTileMapComponent.h |
|
void GetRenderingStats
(
int32& OutNumTriangles, |
Returns the rendering stats for this component. | PaperTileMapComponent.h | |
FPaperTileInfo GetTile
(
int32 X, |
Returns the contents of a specified tile cell. | PaperTileMapComponent.h |
|
FVector GetTileCenterPosition
(
int32 TileX, |
Returns the position of the center of the specified tile. | PaperTileMapComponent.h |
|
FVector GetTileCornerPosition
(
int32 TileX, |
Returns the position of the top left corner of the specified tile. | PaperTileMapComponent.h |
|
FLinearColor GetTileMapColor() |
Gets the tile map global color multiplier (multiplied with the per-layer color and passed to the material as a vertex color) | PaperTileMapComponent.h |
|
void GetTilePolygon
(
int32 TileX, |
Returns the polygon for the specified tile (will be 4 or 6 vertices as a rectangle, diamond, or hexagon) | PaperTileMapComponent.h |
|
FLinearColor GetWireframeColor() |
Returns the wireframe color to use for this component. | PaperTileMapComponent.h | |
void MakeTileMapEditable () |
Makes the tile map asset pointed to by this component editable. | PaperTileMapComponent.h |
|
bool OwnsTileMap() |
Does this component own the tile map (is it instanced instead of being an asset reference)? | PaperTileMapComponent.h |
|
void RebuildCollision() |
Rebuilds collision for the tile map. | PaperTileMapComponent.h |
|
void ResizeMap
(
int32 NewWidthInTiles, |
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) | PaperTileMapComponent.h |
|
void SetDefaultCollisionThickness
(
float Thickness, |
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 | PaperTileMapComponent.h |
|
void SetLayerCollision
(
int32 Layer, |
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 | PaperTileMapComponent.h |
|
void SetLayerColor
(
FLinearColor NewColor, |
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 | PaperTileMapComponent.h |
|
void SetTile
(
int32 X, |
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 | PaperTileMapComponent.h |
|
virtual bool SetTileMap
(
UPaperTileMap* NewTileMap |
Change the PaperTileMap used by this instance. | PaperTileMapComponent.h |
|
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) | PaperTileMapComponent.h |
|
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FPrimitiveSceneProxy * CreateSceneProxy() |
PaperTileMapComponent.h | ||
virtual UBodySetup * GetBodySetup() |
PaperTileMapComponent.h | ||
virtual UMaterialInterface * GetMaterial
(
int32 MaterialIndex |
PaperTileMapComponent.h | ||
virtual int32 GetNumMaterials() |
PaperTileMapComponent.h | ||
virtual void GetUsedTextures
(
TArray< UTexture* >& OutTextures, |
PaperTileMapComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
PaperTileMapComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const UObject * AdditionalStatObject() |
PaperTileMapComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
PaperTileMapComponent.h | ||
virtual void PostInitProperties() |
PaperTileMapComponent.h | ||
virtual void PostLoad() |
PaperTileMapComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
PaperTileMapComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void RebuildRenderData
(
TArray< FSpriteRenderSection >& Sections, |
PaperTileMapComponent.h |