XU XUv0.13.1
中文

#app

import: #app

counts: 6 functions, 0 methods, 0 types, 0 constants, 0 method sets

Standard library package `#app`.

next_frame

XuAPI
pub fn next_frame() bool

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

XuAPI
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

XuAPI
pub fn is_hosted() bool

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

XuAPI
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

XuAPI
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

XuAPI
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