PAPER2UPaperGroupedSpriteComponent

A component that handles rendering and collision for many instances of one or more UPaperSprite assets.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Paper2D

Header

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

Include

#include "PaperGroupedSpriteComponent.h"

Syntax

UCLASS(ShowCategories=(Mobility), ClassGroup=Paper2D, Meta=(BlueprintSpawnableComponent),
       EarlyAccessPreview)
class PAPER2UPaperGroupedSpriteComponent : public UMeshComponent

Remarks

A component that handles rendering and collision for many instances of one or more UPaperSprite assets.

Variables

Name Description

Protected variable

friend

 

FGroupedSpriteSceneProxy

Protected variable

TArray< FBodyIn...

 

InstanceBodies

Physics representation of the instance bodies

Protected variable UProperty

TArray< UMateri...

 

InstanceMaterials

Array of materials used by the instances

Protected variable UProperty Category, EditAnywhere, Meta displayname

TArray< FSprite...

 

PerInstanceSpriteData

Array of instances

Constructors

Name Description

Public function

PAPER2UPaperGroupedSpriteComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function UFunction BlueprintCallable, Category

int32

 

AddInstance

(
    const FTransform& Transform,
    UPaperSprite* Sprite,
    bool bWorldSpace,
    FLinearColor Color
)

Add an instance to this component.

Public function Virtual

int32

 

AddInstanceWithMaterial

(
    const FTransform& Transform,
    UPaperSprite* Sprite,
    UMaterialInterface* MaterialOv...,
    bool bWorldSpace,
    FLinearColor Color
)

Protected function

void

 

ClearAllInstanceBodies()

Terminate all body instances owned by this component

Public function Virtual UFunction BlueprintCallable, Category

void

 

ClearInstances()

Clear all instances being rendered by this component

Public function Const

bool

 

ContainsSprite

(
    UPaperSprite* SpriteAsset
)

Returns true if this component references the specified sprite asset.

Protected function

void

 

CreateAllInstanceBodies()

Creates body instances for all instances owned by this component

Public function Const UFunction BlueprintCallable, Category

int32

 

GetInstanceCount()

Get the number of instances in this component

Public function Const UFunction BlueprintCallable, Category

bool

 

GetInstanceTransform

(
    int32 InstanceIndex,
    FTransform& OutInstanceTransform,
    bool bWorldSpace
)

Get the transform for the instance specified.

Public function Const

void

 

GetNavigationPerInstanceTransforms

(
    const FBox& AreaBox,
    TArray< FTransform >& OutInstanceT...
)

Handles request from navigation system to gather instance transforms in a specific area box

Public function Const

const TArray...

 

GetPerInstanceSpriteData()

Public function Const

void

 

GetReferencedSpriteAssets

(
    TArray< UObject* >& InOutObje...
)

Adds all referenced sprite assets to the specified list.

Protected function

FBodyInstanc...

 

InitInstanceBody

(
    int32 InstanceIndex,
    const FSpriteInstanceData& Instanc...,
    FPhysScene* PhysScene
)

Creates a body instance for the specified instance data if that sprite has defined collision

Protected function

void

 

RebuildInstances()

Invalidates the render and collision state

Protected function

void

 

RebuildMaterialList()

Creates the material list from the instances

Protected function

void

 

ReleasePerInstanceRenderData()

Transfers ownership of instance render data to a render thread instance render data will be released in scene proxy dtor or on render thread task

Public function Virtual UFunction BlueprintCallable, Category

bool

 

RemoveInstance

(
    int32 InstanceIndex
)

Remove the instance specified. Returns True on success.

Protected function

void

 

SetupNewInstanceData

(
    FSpriteInstanceData& InOutNewInsta...,
    int32 InInstanceIndex,
    const FTransform& InInstanceTransf...,
    UPaperSprite* InSprite,
    UMaterialInterface* MaterialOv...,
    const FColor& InColor
)

Sets up new instance data to sensible defaults, creates physics counterparts if possible

Public function UFunction BlueprintCallable, Category

void

 

SortInstancesAlongAxis

(
    FVector WorldSpaceSortAxis
)

Sort all instances by their world space position along the specified axis

Public function Virtual UFunction BlueprintCallable, Category

bool

 

UpdateInstanceColor

(
    int32 InstanceIndex,
    FLinearColor NewInstanceColor,
    bool bMarkRenderStateDirty
)

Update the color for the instance specified. Returns True on success.

Public function Virtual UFunction BlueprintCallable, Category

bool

 

UpdateInstanceTransform

(
    int32 InstanceIndex,
    const FTransform& NewInstanceTrans...,
    bool bWorldSpace,
    bool bMarkRenderStateDirty,
    bool bTeleport
)

Update the transform for the instance specified.

Protected function

int32

 

UpdateMaterialList

(
    UPaperSprite* Sprite,
    UMaterialInterface* MaterialOv...
)

Adds to the material list from a single sprite

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

bool

 

CanEditSimulatePhysics()

Determines whether or not the simulate physics setting can be edited interactively on this component

Public function Virtual

FPrimitiveSc...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual Const

bool

 

DoCustomNavigableGeometryExport

(
    FNavigableGeometryExport& GeomExpo...
)

Collects custom navigable geometry of component.

Public function Virtual Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual Const

int32

 

GetNumMaterials()

Return number of material elements in this primitive

Public function Virtual

void

 

GetUsedTextures

(
    TArray< UTexture* >& OutTextu...,
    EMaterialQualityLevel::Type Quality...
)

Returns the material textures used to render this primitive for the given platform.

Overridden from USceneComponent

Name Description

Public function Virtual Const

FBoxSphereBo...

 

CalcBounds

(
    const FTransform& LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Public function Virtual

void

 

OnUpdateTransform

(
    EUpdateTransformFlags UpdateTransfo...,
    ETeleportType Teleport
)

Native callback when this component is moved

Overridden from UActorComponent

Name Description

Public function Virtual Const

const UObjec...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

CheckForErrors()

Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog.

Protected function Virtual

void

 

OnCreatePhysicsState()

Used to create any physics engine information for this component

Protected function Virtual

void

 

OnDestroyPhysicsState()

Used to shut down and physics engine structure for this component

Public function Virtual Const

bool

 

ShouldCreatePhysicsState()

Return true if CreatePhysicsState() should be called.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent& Proper...
)

This alternate version of PostEditChange is called when properties inside structs are modified.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Overridden from INavRelevantInterface

Name Description

Public function Virtual Const

void

 

GetNavigationData

(
    FNavigationRelevantData& Data
)

Prepare navigation modifiers

See Also

UPrimitiveComponent

UPaperSprite

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback