UDecalComponent

A material that is rendered onto the surface of a mesh. A kind of 'bumper sticker' for a model.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/DecalComponent.h

Include

#include "Components/DecalComponent.h"

Syntax

class UDecalComponent : public USceneComponent

Remarks

A material that is rendered onto the surface of a mesh. A kind of 'bumper sticker' for a model.

Variables

Name Description

Public variable

uint8: 1

 

bDestroyOwnerAfterFade

Automatically destroys the owning actor after fully fading out.

Protected variable

UMaterialInterface *

 

DecalMaterial

Decal material.

Public variable

FVector

 

DecalSize

Decal size in local space (does not include the component scale), technically redundant but there for convenience

Public variable

float

 

FadeDuration

Time in seconds for the decal to fade out.

Public variable

float

 

FadeInDuration

Public variable

float

 

FadeInStartDelay

Public variable

float

 

FadeScreenSize

Public variable

float

 

FadeStartDelay

Time in seconds to wait before beginning to fade out the decal.

Public variable

FDeferredDecalProxy *

 

SceneProxy

The decal proxy.

Public variable

int32

 

SortOrder

Controls the order in which decal elements are rendered.

Protected variable

FTimerHandle

 

TimerHandle_DestroyDecalComponent

Handle for efficient management of DestroyDecalComponent timer

Constructors

Name Description

Public function

UDecalComponent

(
    const FObjectInitializer& ObjectInitializer
)

Functions

Name Description

Public function Virtual

UMaterialInstanceDynamic *

 

CreateDynamicMaterialInstance()

Utility to allocate a new Dynamic Material Instance, set its parent to the currently applied material, and assign it

Public function Virtual

FDeferredDecalProxy *

 

CreateSceneProxy()

Public function Const

UMaterialInterface *

 

GetDecalMaterial()

Accessor for decal material

Public function Const

float

 

GetFadeDuration()

Public function Const

float

 

GetFadeInDuration()

Public function Const

float

 

GetFadeInStartDelay()

Public function Const

float

 

GetFadeStartDelay()

Public function Virtual Const

UMaterialInterface *

 

GetMaterial

(
    int32 ElementIndex
)

Public function Virtual Const

int32

 

GetNumMaterials()

Public function Const

FTransform

 

GetTransformIncludingDecalSize()

Public function Virtual Const

void

 

GetUsedMaterials

(
    TArray< UMaterialInterface* >& OutMaterials,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Protected function Virtual

void

 

LifeSpanCallback()

Called when the life span of the decal has been exceeded

Public function

void

 

PushSelectionToProxy()

Pushes new selection state to the render thread primitive proxy

Public function

void

 

SetDecalMaterial

(
    UMaterialInterface* NewDecalMaterial
)

Setting decal material on decal component. This will force the decal to reattach

Public function

void

 

SetFadeIn

(
    float StartDelay,
    float Duaration
)

Public function

void

 

SetFadeOut

(
    float StartDelay,
    float Duration,
    bool DestroyOwnerAfterFade
)

Sets the decal's fade start time, duration and if the owning actor should be destroyed after the decal is fully faded out.

Public function

void

 

SetFadeScreenSize

(
    float NewFadeScreenSize
)

Set the FadeScreenSize for this decal component

Public function

void

 

SetLifeSpan

(
    const float LifeSpan
)

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface* InMaterial
)

Public function

void

 

SetSortOrder

(
    int32 Value
)

Sets the sort order for the decal component.

Overridden from USceneComponent

Name Description

Public function Virtual Const

FBoxSphereBounds

 

CalcBounds

(
    const FTransform& LocalToWorld
)

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

Overridden from UActorComponent

Name Description

Public function Virtual Const

const UObject *

 

AdditionalStatObject()

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

Public function Virtual

void

 

BeginPlay()

Begins Play for the component.

Public function Virtual

void

 

CreateRenderState_Concurrent()

Used to create any rendering thread information for this component

Public function Virtual

void

 

DestroyRenderState_Concurrent()

Used to shut down any rendering thread structure for this component

Public function Virtual

void

 

SendRenderTransform_Concurrent()

Called to send a transform update for this component to the rendering thread

Overridden from UObject

Name Description

Public function Virtual Const

bool

 

IsPostLoadThreadSafe()

Called during async load to determine if PostLoad can be called on the loading thread.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

See Also

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