class

CryTUI::Widgets::BarEngine

Inherits Reference < Object

The motion of a bar, independent of which axis it is drawn on.

length is columns for a horizontal bar and rows for a vertical one; the anchor walk and the arc test are identical either way, which is why one engine serves both orientations.

Constants

FADE = [9_u8, 27_u8, 63_u8, 255_u8]

Braille bytes for a quarter, half, three-quarter and full-height dot column: the gradient that softens an arc's leading and trailing edge.

Constructors

new(length : Int32, arc : Int32, spin : Spin, motion : BarMotion)
Source

Class methods

fade_byte(from_edge : Int32, fade_width : Int32, arc_byte : UInt8) : UInt8
Source

Instance methods

advance(steps : UInt64) : Nil

Replays steps walks. The engine's whole state is the anchor and its direction, so a tick of any age folds into one period.

Source
anchor
Source
going_forward?
Source
length
Source
motion
Source
period

Bounce and squeeze spend one extra step at each end flipping direction rather than moving, which is where the + 1 comes from.

Source
slot(index : Int32) : Tuple(Bool, Int32)

Whether index is inside the lit arc, and how far it is from the nearer end of it -- the distance the fade gradient is drawn from.

Source
walk
Source