Class: exports

exports(name, version)

The overlay builder for the Blue Marble script.

Constructor

new exports(name, version)

This class handles the overlay UI for the Blue Marble script.
Parameters:
Name Type Description
name string The name of the userscript
version string The version of the userscript
Since:
  • 0.0.2
Source:
See:
  • Overlay
Example
const overlay = new Overlay();
overlay.addDiv({ 'id': 'overlay' })
  .addDiv({ 'id': 'header' })
    .addHeader(1, {'textContent': 'Your Overlay'}).buildElement()
    .addP({'textContent': 'This is your overlay. It is versatile.'}).buildElement()
  .buildElement() // Marks the end of the header <div>
  .addHr().buildElement()
.buildOverlay(document.body);
// Output:
// (Assume <body> already exists in the webpage)
<body>
  <div id="overlay">
    <div id="header">
      <h1>Your Overlay</h1>
      <p>This is your overlay. It is versatile.</p>
    </div>
    <hr>
  </div>
</body>

exports()

This class contains all MutationObservers used (which is 1 probably). This is not an object, but rather a "collection" of functions (in a class).

Constructor

new exports()

The constructor for the observer class
Since:
  • 0.43.2
Source:

exports()

Manages the template system. This class handles all external requests for template modification, creation, and analysis. It serves as the central coordinator between template instances and the user interface.

Constructor

new exports()

The constructor for the TemplateManager class.
Since:
  • 0.55.8
Source:
Example
// JSON structure for a template
{
  "whoami": "BlueMarble",
  "scriptVersion": "1.13.0",
  "schemaVersion": "2.1.0",
  "templates": {
    "0 $Z": {
      "name": "My Template",
      "enabled": true,
      "tiles": {
        "1231,0047,183,593": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA",
        "1231,0048,183,000": "data:image/png;AAAFCAYAAACNbyblAAAAHElEQVQI12P4"
      }
    },
    "1 $Z": {
      "name": "My Template",
      "URL": "https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/dist/assets/Favicon.png",
      "URLType": "template",
      "enabled": false,
      "tiles": {
        "375,1846,276,188": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA",
        "376,1846,000,188": "data:image/png;AAAFCAYAAACNbyblAAAAHElEQVQI12P4"
      }
    }
  }
}

exports(paramsopt)

An instance of a template. Handles all mathematics, manipulation, and analysis regarding a single template.

Constructor

new exports(paramsopt)

The constructor for the Template class with enhanced pixel tracking.
Parameters:
Name Type Attributes Default Description
params Object <optional>
{} Object containing all optional parameters
Properties
Name Type Attributes Default Description
displayName string <optional>
'My template' The display name of the template
sortID number <optional>
0 The sort number of the template for rendering priority
authorID string <optional>
'' The user ID of the person who exported the template (prevents sort ID collisions)
url string <optional>
'' The URL to the source image
file File <optional>
null The template file (pre-processed File or processed bitmap)
coords Array.<number> <optional>
null The coordinates of the top left corner as (tileX, tileY, pixelX, pixelY)
chunked Object <optional>
null The affected chunks of the template, and their template for each chunk
tileSize number <optional>
1000 The size of a tile in pixels (assumes square tiles)
pixelCount number <optional>
0 Total number of pixels in the template (calculated automatically during processing)
Since:
  • 0.65.2
Source: