Skip to content

Customization

Marcel Schoen edited this page Nov 19, 2022 · 2 revisions

A custom clock is quite easy to create. Just have a look at the clocks included with this plugin, in the plugins sub-folder

plugins/MapClocks/clocks/

The following two included clocks serve as the best templates, as I will try to make sure that their configuration files are always up-to-date with the latest changes:

  • analog
  • digital

Adding custom clocks

Just copy one of the existing clock directories, like "analog" to "analog_my_clock". If you then reload the configuration, you should instantly see a new clock by the name of analog_my_clock listed in the mapclocks give command auto-completion. Now you can adapt and adjust that clock to your liking.

Clock Structure

A clock always has a 128x128 pixel background image named background.png, and a YAML configuration file, aptly named clock.yml. Beyond that, if the clock is a digital clock, it also requires the following PNG files:

  • 0.png - 9.png
  • separator.png (usually colons, used to separate the hours from the minutes in the clock display)

clock.yml configuration file

I may add a more detailed description of this file in the future. For now, please look at the clock.yml file of the "analog" and/or "digital" clocks.

Clone this wiki locally