Skip to content
vini2003 edited this page Jan 16, 2020 · 12 revisions

Contents:

  • BaseRenderer - in-house rendering utilities, exposed publicly.
  • BaseScreen- extension of Vanilla screen, implements methods used by Spinnery, and overrides default behaviour. extend this if you need extra functionality.
  • BaseContainer - extension of Vanilla container, implements methods used by Spinnery, and overrides default behaviour. extend this if you need extra functionality.
  • WWidget - base class that any and all widgets build/should build upon. extend this if you need extra functionality; though Spinnery, by default, provides some extensions:
    • WPanel - all widgets must be linked to a panel, but not necessarily be located on top of it.
    • WButton - implements a simple self-resetting button. Optionally, provides a label.
    • WToggle - implements a simple non-self-resetting toggle. Optionally, provides a label.
    • WDropdown - implements a simple drop-down panel. Optionally, provides a label. Internally, widgets are stored in a two-dimensional array, implemented through a List of Lists.
    • WList - implements a simple list, with smooth scrolling. Optionally, provides a label. Internally, widgets are stored in a two-dimensional array, implemented through a List of Lists.
    • WDynamicText - implements a complete textbox, with support for Ctrl + C, Ctrl + V, Ctrl + A, Ctrl + D, Shift + Left (A), Shift + Right (D), Delete, Left (A), Right (D) and Backspace, alongside text culling allowing for longer-than-textbox texts. Optionally, provides a label/default text.
    • WStaticText - implements a simple static text object, with no default text wrapping by default.
    • WSlot - reimplements Slot class to be decent. Shift + RMB + Drag will place 1 item in slots the cursor is dragged on top of. Shift + LMB + Drag will evenly distribute items through the same slots.
    • WStaticImage - implements a static image object that displays the selected image.
    • WDynamicImage - implements a dynamic image object that displays a sequence of images. Work in progress.
  • Theme - handles theme loading, parsing, building, and management. Themes are JSONs located under ./minecraft/resources/spinnery. A default one is provided. Themes have an ID, which is a String. A Theme can be retrieved from the ResourceRegistry with ResourceRegistry.get(theme). A sub-theme (for a specific widget) can be obtained with .get(theme).getXTheme(). WColor is a class that holds Alpha, Red, Green and Blue members used for drawing. Strings in the JSON are parsed to WColors, which are stored inside the sub-theme. A WColor element can be obtained with .get(theme).getXTheme().getXPart(). Raw RGB integer values can be obtained with .RGB. Any themes located in ./minecraft/resources/spinnery will automatically be loaded on resource load/reload (supporting F3 + T).

Spinnery is licensed under the LGPL-3.0 license.

Clone this wiki locally