Skip to content

CreateView

Creates a PrismaView instance by loading an HTML file. This is the primary method for initializing UI components in your SKSE plugin.

PrismaView CreateView(
const char* htmlPath,
OnDomReadyCallback onDomReadyCallback = nullptr
);
  • Type: const char*
  • Description: The path to the HTML file that will be loaded into the PrismaView
  • Base Directory: Skyrim/Data/PrismaUI/views/
  • Type: OnDomReadyCallback
  • Default: nullptr
  • Description: An optional callback function that will be invoked when the DOM of this PrismaView is fully loaded
  • Parameters: Takes a single argument - the PrismaView instance

Returns a PrismaView instance representing the created UI component.

// Simple view creation without callback
PrismaView view = PrismaUI->CreateView("MyPlugin/index.html");

Your HTML file should be placed in the following directory structure:

Skyrim/
└── Data/
└── PrismaUI/
└── views/
└── MyPlugin/
├── index.html
├── styles.css
└── script.js
  • Single Instance: Always create only one PrismaView per plugin
  • DOM Ready: Use the callback to initialize your UI state safely
  • View Management: Store the returned PrismaView instance for later use with other API methods