JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 118
  • Score
    100M100P100Q71762F
  • License ISC

Shorthand for declaring Instances with properties.

Package Exports

  • @rbxts/make

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rbxts/make) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Make

A library providing sugar for declaring Instances. Mostly self-explanatory.

Usage:

Just pass in the ClassName of the Instance you want Make to generate with an object containing the properties it should have.

import Make from "make";

Make("Frame", {
    Active: false,
    Children: [
        Make("ImageLabel", {
            Image: "",
            BackgroundTransparency: 0,
            ImageTransparency: 0.5,
            Children: [Make("ImageButton", {})],
        }),
        Make("ImageButton", {
            MouseButton1Down: (x: number, y: number) => {
                print(x, y);
            },
        }),
    ],
});

Additional Implementation details:

  • Children is a whitelisted member. It expects an array of Instances which will be parented to the generated instance.
  • Setting an event member, like MouseButton1Down in the example above, will Connect the expected callback to the event.
Note: The Parent property is always set last. This avoids ordering bugs/inefficiency