Capítulo 791 de 988

Chapter 791: makePolygon()

Core Idea

_Part of the @remotion/shapes package.

Key Concepts

  • Example
  • Arguments
  • Return type
  • See also

Code Examples

const { path, width, height, transformOrigin, instructions } = makePolygon({
  points: 5,
  radius: 80,
});

console.log(path); // M 76.08452130361228 0 L 152.16904260722458 55.278640450004204 L 123.10734148701013 144.72135954999578 L 29.061701120214437 144.72135954999578 L 0 55.27864045000418
console.log(width); // 160
console.log(height); // 160
console.log(transformOrigin); // '80 80'
console.log(instructions); // '[{type: "M"}, ...]'
  • What it demonstrates: Usage pattern for makePolygon() from the official docs.

Key Takeaways

  1. Understand example when working with makePolygon().
  2. Understand arguments when working with makePolygon().
  3. Understand return type when working with makePolygon().
  4. Understand see also when working with makePolygon().

Connects To

  • Arrow: related page in the Shapes (@remotion/shapes) section.
  • Callout: related page in the Shapes (@remotion/shapes) section.
  • Circle: related page in the Shapes (@remotion/shapes) section.