pixi-wheels

WheelTarget

pixi-wheels


pixi-wheels / index / WheelTarget

Type Alias: WheelTarget

type WheelTarget = 
  | {
  offset?: number;
  section: string;
}
  | {
  index: number;
  offset?: number;
}
  | {
  offset?: number;
  pick?: "random" | "first" | "last";
  value: number | string;
}
  | {
  angle: number;
}
  | {
  position: number;
};

Defined in: config/types.ts:320

Where a spin should land, as the server or the game decides it.

  • { section: 'grand' }: by id.
  • { index: 3 }: by position in the ring’s section list.
  • { value: 8 }: any section carrying that value; pick chooses among several ('random' by default, so a wheel with three x2 wedges lands on a different one each time).
  • { angle: 123 }: an absolute wheel-local angle in degrees.
  • { position: 0.34 }: a fraction of the way around the ring from the layout start.

offset (0..1 within the section, from its clockwise start edge) forces the landing position for the id / index / value forms.