Backend

backend.Backend (Class)

Instance Members

clay
io: IO

File I/O operations backend service. Handles reading/writing files and persistent key-value storage.


clay
info: Info

Platform information backend service. Provides system information like platform type, version, etc.


clay
audio: Audio

Audio backend service. Handles sound loading, playback, and audio filters.


clay
draw: Draw

Rendering backend service. Handles OpenGL/WebGL drawing operations, shaders, and render targets.


clay
texts: Texts

Text loading backend service. Handles loading and processing of text files.


clay
binaries: Binaries

Binary data loading backend service. Handles loading and processing of binary files.


clay
textures: Textures

Texture management backend service. Handles loading, creating, and managing OpenGL textures.


clay
shaders: Shaders

Shader management backend service. Handles loading, compiling, and managing OpenGL shaders.


clay
screen: Screen

Screen/display backend service. Handles window management, fullscreen, resolution, and display properties.


clay
input: Input

Input handling backend service. Handles keyboard, mouse, touch, and gamepad input events.


clay
textInput: TextInput

Text input backend service. Handles on-screen keyboards and text input controls.


clay
clipboard: Clipboard

Clipboard backend service. Handles system clipboard operations for cut/copy/paste functionality.


clay
init(app: ceramic.App): Void

Initializes the Clay backend with the given Ceramic application.

This method performs platform-specific initialization including:

  • SDL binding (on SDL-enabled platforms)
  • Disabling momentum scrolling on macOS
  • Platform-specific native initialization
Name Type Description
app ceramic.App The Ceramic application instance to initialize with

clay
setTargetFps(fps: Int): Void

Sets the target framerate for the application.

Controls the application update rate and minimum frame time:

  • Updates Clay's update rate configuration
  • Sets minimum frame time to 75% of target frame time on desktop platforms
  • Use 0 or negative FPS to disable frame rate limiting
Name Type Description
fps Int Target frames per second (0 or negative to disable limiting)

clay
unbindEvents(): Void

clay
new(): Void

Creates a new Clay backend instance. All backend services are automatically instantiated.

Private Members

clay
emitReady(): Void

Fired when the backend is ready and fully initialized. This event is emitted after all backend services are set up.


clay
emitUpdate(delta: Float): Void

Fired every frame during the update phase.

Name Type Description
delta Float Time elapsed since the last update in seconds

clay
emitRender(): Void

Fired every frame during the render phase. This event is emitted after the update phase is complete.


clay
emitSdlEvent(event: clay.sdl.SDLEvent): Void

Fired when an SDL event is received (SDL platforms only). Provides direct access to low-level SDL events for advanced use cases.

Name Type Description
event clay.sdl.SDLEvent The SDL event data

Metadata

Name Parameters
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()
:headerCode "#include "linc_sdl.h""
:allow backend.Main
:allow backend.Textures
:allow backend.ClayEvents