Fusuma

Components / Basics

host_surface

A surface the host knows as id, filling its parent until size says otherwise.

How it looks

Drawn by the toolkit from the example below. No page of the gallery uses host_surface yet, so there is nothing to run.

host_surface drawn by Fusuma

A surface the host knows as id, filling its parent until size says otherwise.

The host draws into it (a video, a map, a 3D view) and the rest of the interface lies over it where over says.

Signature

pub const fn host_surface(id: u32) -> HostSurface

Methods

  • .size(width: Length, height: Length) -> Self — width by height.
  • .over(children: D) -> HostSurface<D> — Puts children inside the surface, laid out as a column, over what the host shows.

Example

use fusuma::{Length, column, host_surface};
let view = column((host_surface(1).size(Length::Fixed(240), Length::Fixed(60)),));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.nodes(), 2);

All components · Source