SgCircleShadow

Renders a circular shadow decal beneath an object, often used for characters or flying objects. Not physically accurate, but efficient for performance and clarity in stylized games.

Inherits from

Usage

To use this class, add the following require at the top of your script:

local SgCircleShadow = require 'engine/sceneobjects/sgcircleshadow'

Reference

class SgCircleShadow
module:
create(options, parent)

Create a new circle shadow object in the scenegraph.

Parameters:
  • options (table) – A table of options to fill the parameters

  • parent (SceneObject) – The parent scene object to add this to

Returns:

a promise which will resolve to the created object

Return type:

Promise

Usage:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
-- Options can be omitted. This example shows the defaults,
-- only specify the ones you want different.
SgCircleShadow:create({
    active = true,
    name = "",
    transform = Transform.new(),
    layers = {0},
    tags = {},
    receiveShadow = false,
    castShadow = false,
    size = 1,
    strength = 1
})

Examples