pixi-wheels

RingBuilder

pixi-wheels


pixi-wheels / index / RingBuilder

Class: RingBuilder

Defined in: core/WheelBuilder.ts:46

Configures one ring. Reached through WheelBuilder.ring(id, (r) => ...); the wheel builder’s own section methods are this, for the main ring.

Constructors#

Constructor#

new RingBuilder(id: string): RingBuilder;

Defined in: core/WheelBuilder.ts:59

Parameters#

ParameterType
idstring

Returns#

RingBuilder

Properties#

PropertyModifierTypeDefined in
idreadonlystringcore/WheelBuilder.ts:47

Methods#

direction()#

direction(dir: SpinDirection): this;

Defined in: core/WheelBuilder.ts:100

Spin direction for this ring. Default the wheel’s.

Parameters#

ParameterType
dirSpinDirection

Returns#

this


dynamic()#

dynamic(config: DynamicSectionsConfig): this;

Defined in: core/WheelBuilder.ts:128

Dynamic sections: named weight steps the ring moves between.

Parameters#

ParameterType
configDynamicSectionsConfig

Returns#

this


innerRadius()#

innerRadius(r: number): this;

Defined in: core/WheelBuilder.ts:76

Parameters#

ParameterType
rnumber

Returns#

this


outerRadius()#

outerRadius(r: number): this;

Defined in: core/WheelBuilder.ts:71

Parameters#

ParameterType
rnumber

Returns#

this


palette()#

palette(colors: readonly number[]): this;

Defined in: core/WheelBuilder.ts:134

Colours cycled for sections without an explicit fill.

Parameters#

ParameterType
colorsreadonly number[]

Returns#

this


pegs()#

pegs(config?: false | PegConfig): this;

Defined in: core/WheelBuilder.ts:116

The pegs the tongues touch: one per divider by default, size 6 px, inset 9 px inside the rim. Every ring has them unless you pass false, which leaves flapping pointers at rest.

Parameters#

ParameterType
configfalse | PegConfig

Returns#

this


pointer()#

pointer(spec?: PointerSpec): this;

Defined in: core/WheelBuilder.ts:106

Add a pointer. Repeatable. A ring with none gets one at twelve o’clock.

Parameters#

ParameterType
specPointerSpec

Returns#

this


radius()#

radius(outer: number, inner?: number): this;

Defined in: core/WheelBuilder.ts:65

Outer radius in pixels, and the hub (inner) radius.

Parameters#

ParameterTypeDefault value
outernumberundefined
innernumber0

Returns#

this


section()#

section(config: WheelSectionConfig): this;

Defined in: core/WheelBuilder.ts:88

Append one section.

Parameters#

ParameterType
configWheelSectionConfig

Returns#

this


sections()#

sections(list: readonly WheelSectionConfig[]): this;

Defined in: core/WheelBuilder.ts:82

Replace the section list.

Parameters#

ParameterType
listreadonly WheelSectionConfig[]

Returns#

this


skin()#

skin(skin: 
  | RingSkin
  | RingSkinConfig): this;

Defined in: core/WheelBuilder.ts:122

The look: a skin instance, or a serialisable skin config. Default GraphicsRingSkin.

Parameters#

ParameterType
skin| RingSkin | RingSkinConfig

Returns#

this


startAngle()#

startAngle(deg: number): this;

Defined in: core/WheelBuilder.ts:94

Where section 0 begins, wheel-local degrees. Default -90 (twelve o’clock).

Parameters#

ParameterType
degnumber

Returns#

this