Use the ButtonsFactory to create buttons with icons and functionality
Get access to the default buttons by using ButtonsFactory.instance
The factory will create the buttons if they don't exist yet, and return the existing ones if they do (this allows you to reparent or modify created buttons)

Constructors

Accessors

  • get qrButtonUrl(): string

    Returns string

  • set qrButtonUrl(url: string): void

    Get or set the QR code button URL - this URL will open when scanning the QR code

    Parameters

    • url: string

    Returns void

  • get instance(): ButtonsFactory

    Get access to the default HTML button factory.
    Use this to get or create default Needle Engine buttons that can be added to your HTML UI
    If you want to create a new factory and create new button instances instead of shared buttons, use ButtonsFactory.create() instead

    Returns ButtonsFactory

Methods

  • Create a QR code button (or return the existing one if it already exists) The QR code button will show a QR code that can be scanned to open the current page on a phone
    The QR code will be generated with the current URL when the button is clicked

    Returns HTMLButtonElement

    the QR code button element

  • Get access to the default HTML button factory.
    Use this to get or create default Needle Engine buttons that can be added to your HTML UI
    If you want to create a new factory and create new button instances instead of shared buttons, use ButtonsFactory.create() instead

    Returns ButtonsFactory