Getting Started with TypeScript
This section provides a minimal introduction to start using the bg2 engine TypeScript API.
Installation
Section titled “Installation”The TypeScript API is distributed as an npm package.
npm install bg2e-jsOnce installed, you can import the engine modules directly in your project.
Also, you can get the source code for the TypeScript API from the official repository:
git clone https://github.com/ferserc1/bg2e-jsLanguage Recommendation
Section titled “Language Recommendation”Although the API can be used from plain JavaScript, TypeScript is strongly recommended.
- The API provides full type definitions
- Improves maintainability and developer experience
- Ensures consistency with the engine design
JavaScript support is currently available for compatibility reasons, but it is considered transitional. Future versions of the engine will deprecate JavaScript support in favor of a TypeScript-only API.
Learning Resources
Section titled “Learning Resources”Detailed setup, examples, and usage patterns are covered in the TypeScript tutorials.
Refer to the tutorials section for:
- Project setup
- Creating your first application
- Rendering basics
- Input handling and interaction
Creation Tools
Section titled “Creation Tools”Creation tools (asset generation, scene authoring, etc.) are currently available only as native applications built from the C++ API source code.
To use these tools, refer to the C++ API Getting Started guide, which explains how to download, build, and run them.
Next Steps
Section titled “Next Steps”Continue with the TypeScript tutorials to build your first application and explore the engine features in detail.