Theme

This page covers how to create custom themes, which involves editing pixel textures. The plugin already offers several standard themes, so if those are sufficient - here's how to use them.

Themes define how tooltips look. They provide the texture, define how many lines the theme supports and some ascent settings.

Where to configure themes

Configuration

Themes are configured inside plugins/Tooltips/themes. Any .yml file inside of that folder or any subfolders will be checked for theme configurations. So you can configure your themes for example in:

  • /themes/mythemes.yml

  • /themes/mythemes/themes.yml

Where mythemes -name can be anything you want.

Textures

Textures for themes have to be located inside plugins/Tooltips/pack/assets. That path resembles a normal resource pack, which supports namespaces.


Example configuration

theme-one:
    path: "tooltips:tooltips/theme-one.png"
    height: 10
    padding: 2 # Optional (1 by default)
    lines: 1
    ascents:
        theme-ascent: 0
        text-start-ascent: -3
        text-line-spacing: 5

Properties

path

The path to the texture inside .../pack/assets/. Uses namespaces, exactly how Minecrafts namespaces work.

Example texture used is located in .../pack/assets/tooltips/textures/tooltips/theme-one.png. Where the highlighted part is the namespace used ( tooltips: ).

The amount of lines that a theme supports depends on the texture and its height. You will have to edit the textures yourself if you wish to support more lines. Here's how.

height

Property that controls the size of the texture. Normally when working with fonts, this value would be equal to the height of the texture in pixels. However when working with tooltips, that would result in a texture that is overly large. That's why the best height is usually the textures size divided by two.

In the example above, theme-one.png textures height is 20 pixels, so it's height is set as 10. If it was instead 20 pixels, it would look like this:

padding

Defines how much space (in pixels) is added to the left part of the text.

lines

How many lines does this theme support. This affects how many line files the plugin generates. If a tooltip uses more lines than its theme supports, the extra lines will show up broken.

The amount of lines that is put here does not change the height of the texture. You will have to do that yourself using this guide.

ascents

Acents in resource packs define how high something is offset from its origin point. The higher the ascent is, the higher the offset is vertically (up). The lower it is, the lower the offset is vertically (down). Can go in the negatives.

theme-ascent

Defines how high the theme is displayed.

Can at maximum be as much as the height of the theme. Minimum is not limited.

text-start-ascent

Defines how high the first line of text is displayed.

Can at max be 5, due to the fonts height being 5. Minimum is not limited.

text-line-spacing

Is an useful option for multi-line tooltips. Defines in pixels the space between each new line.

Last updated