Skip to content

3.5.1 Fraction

Jonas de Luna Skulberg edited this page Nov 5, 2023 · 3 revisions

Fraction

The fraction component visualizes a fraction in the form of a fully or partially filled circle with circle-sectors.

Extends:

Implements:

  • none

Parameters:

Required:

  • none

Optional:

  • x: number X position of the circle.
  • y: number Y position of the circle.
  • radius: number: Radius of the circle.
  • divisor: number Divisor for the fraction
  • filled: number: Dividend of the fraction. Has to be less than or equal to divisor.

Default Parameters:

  x: 0,
  y: 0,
  radius: 5,
  divisor: 2,
  filled: divisor,

Implemented Methods:

  • collidesWith(other: Object3D): boolean
  • distanceTo(other: Object3D<Event>): number

Methods

  • setDivisor(divisor: number): void: Set the divisor of the fraction component to a number.
  • setFilled(filled: number): void: Set the amount of filled parts to a specified number.
  • getFilled(): number
  • getDivisor(): number
  • setPosition(position: InputPosition)
Clone this wiki locally