Tooltips
Discord
  • Tooltips
  • Start here
  • Support
  • Plugin
    • Features
    • Commands
    • FAQ
    • Guides
      • Clearing cache
      • Furniture shop
      • BetonQuest Dialogue
      • Languages
      • Manual width
  • Configuration
    • Theme
      • Theme textures
      • Making a custom theme
    • Icon
    • Preset
      • Conditions
      • Condition list
      • Show
      • Actions
        • Commands
      • Functions
      • Animations
      • Argument Types
  • Extra
    • Notable 2.0 Changes
    • Integrations
    • Variables
    • API
      • Custom Conditions
Powered by GitBook
On this page
  • Where to configure themes
  • Configuration
  • Textures
  • Example configuration
  • Properties
  1. Configuration

Theme

PreviousManual widthNextTheme textures

Last updated 10 months ago

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


Example configuration

theme-one:
    path: "tooltips:tooltips/theme-one.png"
    height: 10
    padding: # Optional
      left: 1
      right: 0
    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: ).

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 or right 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.

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.

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

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

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

namespaces
Here's how
this guide
here's
182B
theme-one.png
image
Texture used above
All themes go in this directory
Any file name ending with .yml is supported. Even in sub-directories created inside themes
Example used
height: 20
padding: 2
lines: 1, but we're trying to add two lines through the newline "\n"
theme-ascent: 0
theme-ascent: -10 (text-start-ascent must also be modified)
theme-ascent: 0 and text-start-ascent: 0
theme-ascent: 0 and text-start-ascent: -3
text-line-spacing: 5
text-line-spacing: 3