moroboxai-player-sdk
v0.1.0-alpha.54
Published
MoroboxAI SDK for embedding games
Downloads
8
Readme
moroboxai-player-sdk
This package provides the core functionalities for running MoroboxAI games on various platforms, but lacks the gutter that is required for some platform-specific functionalities.
See:
- moroboxai: for running games on the desktop with Electron
- moroboxai-player-web: for embedding games on the web
- moroboxai-player-react: for embedding games in React apps
Install
Using npm:
npm install moroboxai-player-sdk --save
Implementation
This package is meant to be extended by implementing the missing gutter for the desired platform:
import * as MoroboxAIPlayerSDK from 'moroboxai-player-sdk';
// The gutter added by our implementation
const sdkConfig: MoroboxAIPlayerSDK.ISDKConfig = {
// Define how we create a file server on this platform
fileServer: (baseUrl: string) => ...,
// Define how we create a zip server on this platform
zipServer: (baseUrl: string) => ...
};
// Retrieve the HTMLElement we want to attach the player to
const element: Element = ...;
// The generic options for the player
const options: MoroboxAIPlayerSDK.IPlayerOptions = ...;
// Entrypoint of moroboxai-player-sdk with our gutter
MoroboxAIPlayerSDK.init(sdkConfig, element, options);
License
This content is released under the MIT License.