Main
Main entry point for Clay backend applications.
This class handles the initial setup and configuration of Clay applications, including platform-specific initialization for web, desktop, and mobile targets. It configures Clay's rendering settings, handles Electron integration, manages window sizing and orientation, and sets up the Ceramic application lifecycle.
Key responsibilities:
- Clay framework initialization and configuration
- Platform-specific setup (web, desktop, mobile)
- Electron runner integration for development
- Window and viewport management
- Orientation handling for mobile devices
- Error handling and logging setup
Static Members
Main entry point for Clay backend applications.
Initializes the Clay framework with custom configuration and event handling. This is called automatically when the application starts.
Private Members
The Ceramic project instance.
Clay events handler instance for managing application lifecycle events.
The main Ceramic application instance.
Configures Clay framework settings for the Ceramic application.
This function handles:
- OpenGL/WebGL version configuration
- Platform-specific rendering settings
- Window configuration (size, fullscreen, resizable)
- Electron runner integration and development features
- Web-specific container and viewport handling
- Mobile platform optimizations
- Error handling setup
Name | Type | Description |
---|---|---|
config |
clay.Config | The Clay configuration object to customize |
Called when the Clay backend is ready and initialized.
This function handles final initialization steps including:
- Key-value storage initialization
- Web-specific display setup and extension loading
- Electron runner communication
- Display readiness management
This method is called by ClayEvents and should not be called directly.
Configures screen orientation for mobile devices (SDL platforms only).
This function converts Ceramic's orientation settings into SDL hints to control which orientations are allowed on mobile platforms.
Supported orientations:
- Portrait (upright)
- Portrait upside down
- Landscape left
- Landscape right
Multiple orientations can be combined using bitwise OR operations.