Skip to main content

Module units

Module units 

Source
Expand description

The unit-bearing wire types: Length, Angle, Time, FontSize, Rect — parsed once at the serde boundary.

Structs§

Angle
An angle, parsed from the wire as a number (read as degrees, the CSS convention) or a unit string ("45deg", "1.5rad", "0.25turn", "100grad"). Stored internally as radians — the unit Bevy’s gradient and transform APIs want.
Rect
Four sides (or corners), each a Length. Accepts a number, a CSS shorthand string, or a { top, right, bottom, left } object on the wire.
Time
A time/duration, parsed from the wire as a number (read as milliseconds, the JS-facing unit) or a unit string ("200ms", "0.2s"). Stored as seconds — the unit the animations engine and the transition driver consume.

Enums§

FontSize
A font size mirroring bevy_text::FontSize, parsed from the wire as a number (logical pixels) or a unit string ("24px", "100vw"/vh/vmin/vmax, "1.5rem"). rem is relative to bevy’s RemSize resource (default 20px). (CSS em has no bevy_text equivalent, so it is not accepted.)
Length
A length value mirroring bevy_ui::Val, parsed from the wire form (a number is logical pixels; a string carries an explicit unit).