Stars
namespace Griff.Scenes;
public sealed class Stars : Component, IDrawableA row of stars, so many of them filled: how well a level went, out of three. It shows an output (a Level Goal’s Stars as a level is won, on the panel that opens), what the save data keeps under Saved (the best a level has had, on a level select menu), or its own Value, with no code. With a Delay, the stars fill one after another, each popping in with its Sound.
It draws its stars itself, in Color and the unfilled ones in EmptyColor, or as its Image tinted so. It goes on filling while the game is paused, under a panel that pauses it.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”public Color Color { get; set; }The color of a filled star.
public int Count { get; set; }How many stars there are in the row, filled or not.
public float Delay { get; set; }Seconds between one star filling and the next, so they pop in one after another as it fills (as a level’s stars are shown); 0 shows them all at once.
EmptyColor
Section titled “EmptyColor”public Color EmptyColor { get; set; }The color of a star not filled.
public string? Image { get; set; }A picture to draw each star with instead, e.g. “Images/star.png”, tinted by Color or EmptyColor.
public int Order { get; set; }Higher draws on top, like Order.
Output
Section titled “Output”public string? Output { get; set; }An output to show as the stars filled (see component_describe’s Outputs), e.g. a Level Goal’s “Stars”.
public Color Rim { get; set; }The color of the rim round each filled star; clear draws none.
public string? Saved { get; set; }A name in the game’s save data whose number it shows, e.g. “Level1.Stars”: the best stars a level has had, saved by its Level Goal, for a level select menu.
public int Shown { get; }How many stars are drawn filled right now: it catches up with Value a star each Delay.
public float Size { get; set; }How big each star is, in world units across (before the transform’s scale).
public string? Sound { get; set; }A sound played as each star fills, e.g. “Sounds/star.wav”.
Spacing
Section titled “Spacing”public float Spacing { get; set; }The gap between one star and the next, in world units.
public string? Track { get; set; }The name of an entity whose Output it shows, e.g. “Level”. Without one, it’s this entity’s, or the nearest one it’s inside with that output.
public int Value { get; set; }How many stars are filled. Set it, or let it follow Track’s Output or Saved.
Methods
Section titled “Methods”LinkLabel
Section titled “LinkLabel”public override string? LinkLabel(string property)