Options
All
  • Public
  • Public/Protected
  • All
Menu

Module diy

When included in a script by adding useLibrary("diy"), that script can then be used to defines a new DIY component. This involves defining functions that will handle key events in the lifecycle of the component as well as registering a class map entry that registers the new component.

For more information, refer to the developer manual page on DIY components.

Index

Type aliases

DIY

The DIY game component class.

DIYSheet

The DIYSheet class used to create sheets (faces) for DIY components.

DeckSnappingHint

An enumeration of possible rules for interacting with components in a deck.

FaceStyle

An enumeration of possible face styles.

Variables

Const HighResolutionMode

HighResolutionMode: object

Enumeration of the values that can be set on

Type declaration

  • DISABLE: object

    Never substitute high resolution images.

  • ENABLE: object

    Allow substitution when the component is being drawn at a resolution higher than the template resolution.

  • FORCE: object

    Force substitution if possible.

Functions

testDIYScript

  • testDIYScript(gameCode?: string): void
  • Creates a test DIY instance using functions in the current script, adding an editor for it. (Loading and saving the test instance are not supported.)

    This function is useful when developing a new DIY component. For example, you can write script functions for the component, add testDIYScript() to the end of the script, run the file, and test out the component without launching a plug-in test instance. In order to work correctly, settings and resources that the script relies on must still be visible to the script. (ResourceKit will search plug-in task folders in the open project for resources.)

    If this function is left in a plug-in bundle, it will display a warning if script warnings are enabled, but otherwise it has no effect. It will only create a test component if run directly from a script editor.

    Parameters

    • Optional gameCode: string

      an optional code indicating the game this component is from; this is needed if you wish to test expansion symbol painting or inherit from the game's master settings

    Returns void