#app
Xu 0.13.1 API
import: #app
counts: 6 functions, 0 methods, 0 types, 0 constants, 0 method sets
Standard library package `#app`.
next_frame
Purpose
Suspend this application on its own stack until the host requests a frame. Local owners remain alive; false requests normal unwinding and shutdown. Calling without a Phone game host throws instead of starting a private loop. Throws on failure; handle the error or propagate it to the caller.
Parameters
No arguments are required.
Returns
bool — true or false
resume_epoch
pub fn resume_epoch() int
Purpose
Changes after returning from the background. Reset frame-clock accumulation when this changes; elapsed background time is not simulation time.
Parameters
No arguments are required.
Returns
int — a value of this type
is_hosted
Purpose
Reports whether an active Phone game host owns the current execution stack.
Parameters
No arguments are required.
Returns
bool — true or false
intercept_back
pub fn intercept_back(enabled bool) int
Purpose
When enabled on Android, system Back delivers EVENT_BACK_REQUESTED instead of closing the Activity immediately. Throws on failure; handle the error or propagate it to the caller.
Parameters
enabled bool- enabled (bool)
Returns
int — a value of this type
resource_path
pub fn resource_path(relative string) string
Purpose
A portable relative path inside the game profile's packaged resources. Throws on failure; handle the error or propagate it to the caller.
Parameters
relative string- relative (string)
Returns
string — result string
data_path
pub fn data_path(relative string) string
Purpose
The host creates an app-private writable root. Subdirectories are explicit caller-owned paths; this function validates/joins and does not create them. Throws on failure; handle the error or propagate it to the caller.
Parameters
relative string- relative (string)
Returns
string — result string