SgRibbon¶
Generates a flowing ribbon-like mesh along a path, often used for trails or motion effects. Useful for visualizing movement, magic spells, or streaks behind fast-moving objects. Shape, width, and tapering can be customized for different styles.
Inherits from¶
Usage¶
To use this class, add the following require at the top of your script:
local SgRibbon = require 'engine/sceneobjects/sgribbon'
Reference¶
- class SgRibbon¶
- module:
- create(options, parent)¶
Create a new ring object in the scenegraph.
- Parameters:
options (
table
) – A table of options to fill the parametersparent (
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 14
-- Options can be omitted. This example shows the defaults, -- only specify the ones you want different. SgRibbon:create({ active = true, name = "", transform = Transform.new(), layers = {0}, tags = {}, receiveShadow = false, castShadow = false, material = nil, })
- updateGeometry()¶
recreate the geometry of the ribbon. This can be called after changing any of the ribbon parameters that will invalidate
the current geometry. It only makes sense to call when setAutoRecreate(false) was called before because otherwise changing any fields will trigger a regeneration of the ribbon anyway