StarryBackgroundPainter constructor

StarryBackgroundPainter({
  1. required Image starTexture,
  2. required double rotationZ,
  3. required double rotationY,
})

The StarryBackgroundPainter takes in a star texture image, along with rotation values for the X and Y axes. It then paints the star texture repeatedly across the canvas, creating a starry background effect.

Example usage:

final starTexture = await loadImage('assets/star_texture.png');

final painter = StarryBackgroundPainter(
  starTexture: starTexture,
  rotationX: 0.0,
  rotationY: 0.0,
);

final customPaint = CustomPaint(
  painter: painter,
);

Implementation

StarryBackgroundPainter({
  required this.starTexture,
  required this.rotationZ,
  required this.rotationY,
});