Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu Camera games
Concept

Camera games

Run interactive game packages in the processed preview, send normalized taps or package-defined input, and receive game events in the host application.

SDK version Android/iOS 3.0.4 · Flutter 1.0.2 · React Native 1.0.0 Updated Aug 22, 2026 Time 5 min

What a camera game is

A camera game is an authored .nosmai package with package type game. It can combine rendered content, face tracking, audio, game state, input handling, and JSON-safe output events. Apply it through the same effect-package method used by other .nosmai assets.

The active game owns the visual package slot. Applying another AR effect, beauty-effect package, or game replaces the current game. Beauty controls and a manual background follow their documented slot and composition rules.

Choose how the package arrives

RouteBehaviourUse it when
Bundled packageShips with the app and works without a first-download network requestThe same game must always be available offline
Cloud FilterLists and downloads a package with type game, then applies its local pathGames should change without publishing a new app version

Only the protected package is downloaded. Camera frames are processed on the device and are not uploaded by the Games feature.

Understand game input

Tap input uses preview-relative coordinates. The top-left of the visible preview is 0,0 and the bottom-right is 1,1. Normalize against the displayed preview, not the full screen, when the camera content is cropped or letterboxed.

Flutter NosmaiCameraPreview and React Native NosmaiCameraView forward taps to a ready game by default. Native iOS and Android applications forward their own preview touch coordinates.

Named input is package-defined. There is no global list of actions such as jump, shoot, or throw, and the host application should not guess them. A tap-only game needs no named input. A game that needs buttons or a future joystick must publish its exact input names, coordinate meaning, and value range as part of its package contract.

Handle game events

An active game can emit JSON-safe events for outcomes such as score changes, round completion, or game over. Every event contains:

FieldMeaning
eventNon-empty event name defined by the game package
gameIdentifier of the game that produced the event
sequenceIncreasing non-negative event sequence number
dataGame-defined JSON-safe values

Subscribe when the camera screen becomes active and remove or cancel the subscription when that screen is disposed.

Handle lifecycle

The normal processing and application lifecycle pauses and resumes the active game automatically. Explicit pause, resume, and restart methods are available for visible host controls. Stop recording before switching camera sessions or tearing down the preview.

Platform support

PlatformPackage statusDefault tap forwarding
iOSSupportedHost application forwards preview taps
AndroidSupportedHost application forwards preview taps
FlutterSupportedEnabled in NosmaiCameraPreview
React NativeSupportedEnabled in NosmaiCameraView
WebNot available in the current previewNot available

Common problems

SymptomCauseFix
Taps do nothingThe active package is not a ready game packageWait for successful package application and check game readiness before sending input
The game reacts at the wrong locationCoordinates were normalized against the screen instead of the visible previewNormalize the touch inside the rendered preview bounds
A named input has no effectThe input name or value does not match the package contractUse the exact name and value semantics supplied with that game
Events continue after navigationThe host retained its game-event subscriptionRemove or cancel the listener when the camera screen is disposed

Next steps

References

Was this page helpful?

Your response helps us prioritize documentation improvements.

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved