flame-engine / flame-engine/flame

Paint factory for paint instances used through out the engine.

Open
#2,198 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Dart
Stars
10.8k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
21

Description

# Problem to solve
There is no way to globally customize the default paints used though out the engine. I can't for example, change the default white color paint used on Sprites to a different one without having to explicit pass a custom paint to all the instances.

# Proposal
We could provide global factories, which allows the user to specify their own factories, so the paints could be globally customized.

Example:

```dart
PaintFactories.sprite = () => Paint()..color = Colors.white;
PaintFactories.debugShapes = () => Paint()..color = Colors.magenta;
// ..etc
```

The user could then modify those attributes with new closures to customize to the behaviour they want.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.