Pixel Dream StudiosWiki

Icons in a line

Put an item's icon or a small image in a page, an answer or the speaker's name.

The item value draws the item's icon before its name. The sprite value draws a small image. Both are values like any other, so the translation decides where they sit:

{
  "pages": [ { "translate": "mypack.board.post", "fallback": "Jobs marked %s are open. Bring %s." } ],
  "with": [
    { "value": "sprite", "sprite": "rpg_errands:textures/marker/errand_offered.png" },
    { "value": "item", "item": "minecraft:iron_ingot" }
  ]
}

Use the dialogue's with for a page, a choice's own with for an answer, and speaker_with for the speaker's name.

Needs RPG Dialogue 1.1.0 or later.

Sprite ids

sprite names one of two things:

  • A texture, by its full path ending in .png. rpg_errands:textures/marker/errand_offered.png is assets/rpg_errands/textures/marker/errand_offered.png.
  • A GUI sprite, by the id vanilla's interface uses. minecraft:hud/heart/full is assets/minecraft/textures/gui/sprites/hud/heart/full.png. Vanilla's hearts, hunger and armor icons are GUI sprites.

How the panel draws them

  • At their own size. An item is 16 pixels square, as in an inventory slot. A sprite is one pixel of art to one pixel of the interface. Neither is scaled, so their pixels match the font's at any GUI scale. For a smaller icon, draw smaller art. A resource pack that repaints a sprite at a higher resolution makes it larger.
  • Trimmed. A sprite's transparent border takes no room. After trimming it can be up to 62 pixels wide.
  • On even rows. A page with an icon taller than the text spaces all its rows to fit the tallest icon, with the text centred on the icons. The answers and the speaker's name do the same, so an icon never overlaps the rows around it.
  • As painted. Icons are not tinted, and are not lightened under a dark resource pack.
  • From the player's resource packs, so a pack can repaint any of them.
  • In one step. While a line types out, an icon appears whole, in its final place. A mod that makes a sound per letter makes none for it.

Pointing at an item's icon shows the item's tooltip, as pointing at its name does.

A missing sprite

A sprite the client can't find is left out, with no gap. So is one with no visible pixels, and one wider than 62 pixels. The game log names it once per resource reload (F3+T). The server can't check sprites, because it never sees the client's resources.

Anywhere else

In murmurs, chat or another mod's screen, icons are left out and an item shows only its name.

To draw icons in a screen of your own, see For mod developers.

On this page