Skip to main content
Version: latest - a1.172.0 โš–๏ธ

๐Ÿ–Œ๏ธ Decal

Decals are Materials that are projected onto meshes in your level, including Static Meshes and Skeletal Meshes

๐Ÿ‘ชInheritance
This class shares methods and events from Base Entity, Base Actor, Base Paintable.

๐ŸŽ’ Examplesโ€‹

Client/Index.lua
local my_decal = Decal(
Vector(100, 200, 0), -- location
Rotator(0, 90, 90), -- rotation
"nanos-world::M_Default_Translucent_Lit_Decal", -- material
Vector(128, 256, 256), -- size
60, -- lifespan
0.01 -- fade screen size
)

my_decal:SetMaterialTextureParameter("Texture", "package://my_package/Client/image.jpg")

๐Ÿ›  Constructorsโ€‹

Default Constructorโ€‹

No description provided

local my_decal = Decal(location, rotation, material_asset, size?, lifespan?, fade_screen_size?)
Parameters
NameTypeDescription
locationVectorWorld location to spawn at
rotationRotatorWorld rotation to spawn with
material_assetMaterial ReferenceMaterial Asset
size?VectorSize of the Decal Default Vector(128, 256, 256)
lifespan?floatTime until automatically destroyed in seconds Default 60
fade_screen_size?floatSize percentage in screen to fade out Default 0.01

๐Ÿ—ฟ Static Functionsโ€‹

This class doesn't have own static functions.

Inherited static functions

๐Ÿฆ  Functionsโ€‹

SetFadeInStarts fading in this Decal after a delay
SetFadeOutStarts fading out this Decal after a delay
SetSizeSets the size of this Decal

Inherited functions

SetFadeInOptimalโ€‹

Starts fading in this Decal after a delay

my_decal:SetFadeIn(start_delay, duration)
Parameters
NameTypeDescription
start_delayfloatSeconds to wait before starting the fade-in
durationfloatDuration of the fade-in, in seconds

SetFadeOutOptimalโ€‹

Starts fading out this Decal after a delay

my_decal:SetFadeOut(start_delay, duration, destroy_after_fade_out?)
Parameters
NameTypeDescription
start_delayfloatSeconds to wait before starting the fade-out
durationfloatDuration of the fade-out in seconds
destroy_after_fade_out?booleanWhether to destroy the Decal after fade-out finishes Default true

SetSizeOptimalโ€‹

Sets the size of this Decal

my_decal:SetSize(size)
Parameters
NameTypeDescription
sizeVectorNew size of the Decal

๐Ÿš€ Eventsโ€‹

This class doesn't have own events.