Skip to content

Stars

A 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.

Works with: LevelGoal (shows a Level Goal’s stars)

Draws itself (its entity draws at Order 100 unless it has a Sprite, whose order counts).

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • value: a whole number = 0. How many stars are filled. Set it, or let it follow Track’s Output or Saved. (Field: a number.)
  • count: a whole number = 3. How many stars there are in the row, filled or not. (Field: a number.)
  • track: text = null. 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. (Names an entity.) (Field: an entity’s name.)
  • output: text = null. An output to show as the stars filled (see component_describe’s Outputs), e.g. a Level Goal’s “Stars”. (Names an output of the entity track names, or without one this entity or the nearest it’s inside with it: one component_describe lists under Outputs, a number or true or false, e.g. “Score”, “MatchBoard.Score” for one component’s, or “Amount:Gold” for one read by a name.) (Field: an output’s name.)
  • saved: text = null. 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. (Names a name in the save data.) (Field: a name.)
  • size: a number = 0.8. How big each star is, in world units across (before the transform’s scale). (Field: a number.)
  • spacing: a number = 0.15. The gap between one star and the next, in world units. (Field: a number.)
  • color: a color, “#RRGGBB” or “#RRGGBBAA” = “#F8CC3AFF”. The color of a filled star. (Field: a color.)
  • emptyColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#00000047”. The color of a star not filled. (Field: a color.)
  • rim: a color, “#RRGGBB” or “#RRGGBBAA” = “#40290DD9”. The color of the rim round each filled star; clear draws none. (Field: a color.)
  • image: text = null. A picture to draw each star with instead, e.g. “Images/star.png”, tinted by Color or EmptyColor. (A picture in Assets, e.g. “Sprites/back.png”.) (Field: an image.)
  • order: a whole number = 100. Higher draws on top, like Sprite.Order. (Field: a number.)
  • delay: a number = 0. 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. (Field: a number.)
  • sound: text = null. A sound played as each star fills, e.g. “Sounds/star.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)

What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.

  • Stars (a whole number, out of its count). How many stars are filled. Set it, or let it follow Track’s Output or Saved.

Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.

  • shown: a whole number. How many stars are drawn filled right now: it catches up with Value a star each Delay.

Scripts use it as Stars: its methods, events and values that aren’t saved with the scene.