Navigation
API > API/Plugins > API/Plugins/Paper2D
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UPrimitiveComponent
- UMeshComponent
- PAPER2UPaperTileMapComponent
References
| Module | Paper2D |
| Header | /Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperTileMapComponent.h |
| Include | #include "PaperTileMapComponent.h" |
Syntax
UCLASS&40;HideCategories&61;Object, ClassGroup&61;Paper2D, EarlyAccessPreview,
Meta&61;&40;BlueprintSpawnableComponent&41;&41;
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
| Type | Name | Description | |
|---|---|---|---|
| bool | bShowOutlineWhenUnselected | Should this component show an outline around the first layer when the component is not selected? | |
| bool | bShowPerLayerGridWhenSelected | Should this component show an outline around each layer when the component is selected? | |
| bool | bShowPerLayerGridWhenUnselected | Should this component show an outline around each layer when the component is not selected? | |
| bool | bShowPerTileGridWhenSelected | Should this component show a tile grid when the component is selected? | |
| bool | bShowPerTileGridWhenUnselected | Should this component show a tile grid when the component is not selected? | |
| friend | FPaperTileMapRenderSceneProxy | ||
| TObjectPtr< class UPaperTileMap > | TileMap | The tile map used by this component. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
PAPER2UPaperTileMapComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| 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 | |
| void | Creates a new tile map internally, replacing the TileMap reference (or dropping the previous owned one) | ||
| void | CreateNewTileMap
(
int32 MapWidth, |
Creates a new tile map of the specified size, replacing the TileMap reference (or dropping the previous owned one) | |
| 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) | |
| void | GetMapSize
(
int32& MapWidth, |
Returns the size of the tile map. | |
| void | GetRenderingStats
(
int32& OutNumTriangles, |
Returns the rendering stats for this component. | |
| FPaperTileInfo | GetTile
(
int32 X, |
Returns the contents of a specified tile cell. | |
| FVector | GetTileCenterPosition
(
int32 TileX, |
Returns the position of the center of the specified tile. | |
| FVector | GetTileCornerPosition
(
int32 TileX, |
Returns the position of the top left corner of the specified tile. | |
| FLinearColor | Gets the tile map global color multiplier (multiplied with the per-layer color and passed to the material as a vertex color) | ||
| void | GetTilePolygon
(
int32 TileX, |
Returns the polygon for the specified tile (will be 4 or 6 vertices as a rectangle, diamond, or hexagon) | |
| FLinearColor | Returns the wireframe color to use for this component. | ||
| void | Makes the tile map asset pointed to by this component editable. | ||
| bool | OwnsTileMap () |
Does this component own the tile map (is it instanced instead of being an asset reference)? | |
| void | Rebuilds collision for the tile map. | ||
| void | RebuildRenderData
(
TArray< FSpriteRenderSection >& Sections, |
||
| 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) | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| bool | SetTileMap
(
UPaperTileMap* NewTileMap |
Change the PaperTileMap used by this instance. | |
| 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
| Type | Name | Description | |
|---|---|---|---|
| FPrimitiveSceneProxy * | Creates a proxy to represent the primitive to the scene manager in the rendering thread. | ||
| UBodySetup * | GetBodySetup () |
Return the BodySetup to use for this PrimitiveComponent (single body case) | |
| UMaterialInterface * | GetMaterial
(
int32 ElementIndex |
Returns the material used by the element at the specified index | |
| int32 | Return number of material elements in this primitive | ||
| void | GetUsedTextures
(
TArray< UTexture* >& OutTextures, |
Returns the material textures used to render this primitive for the given platform. |
Overridden from USceneComponent
| Type | Name | Description | |
|---|---|---|---|
| FBoxSphereBounds | CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. |
Overridden from UActorComponent
| Type | Name | Description | |
|---|---|---|---|
| const UObject * | Give a readable name for this component, including asset name if applicable |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| 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 | Handles reading, writing, and reference collecting using FArchive. |
See Also
UPaperTileMap