pub struct Spawn { /* private fields */ }Expand description
Tag: Spawns a Widget in the Text.
The Widget will be placed according to the DynSpawnSpecs,
and should move automatically as the Spawn moves around the
screen.
Implementations§
Source§impl Spawn
impl Spawn
Sourcepub fn new(widget: impl Widget, specs: DynSpawnSpecs) -> Self
pub fn new(widget: impl Widget, specs: DynSpawnSpecs) -> Self
Returns a new instance of Spawn.
You can then place this Tag inside of the Text via
Text::insert_tag or Tags::insert, and the Widget
should be placed according to the DynSpawnSpecs, and
should move around automatically reflecting where the
Tag is at.
Do note that this Widget will only be added to Duat and be
able to be printed to the screen once the Text itself
is printed. And it will be removed once the RawTag within
gets dropped, either by being removed from the Text, or by
the Text itself being dropped.
[!NOTE]
For now, if you clone a
Textwith spawnedWidgets within, thoseWidgets will not be cloned to the newText, and theRawTag::SpawnedWidgets within will also be removed.