mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 09:39:12 +08:00
Added flame_oxygen (#823)
* Added flame_oxygen * Reworked structure * Added components and example * Added particle support * Updated code * Update example * Fixed mistake * Update * Updated documentation * Added system documentation * Fixed line length * Added most components docs * Docs done? * Update doc/oxygen.md Co-authored-by: Erick <erickzanardoo@gmail.com> * Added GameRef * Fixed GameRef * Reworked library to not use part system * Added GameRef docs * Removed library line * Updated CHANGELOG * Added License * Fixed linting problem * Update packages/flame_oxygen/example/lib/main.dart Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com> * Update after review from spydon * Added flipping * Fixed CI/CD * Fix * Update * Update doc/oxygen.md Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com> Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com> Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
bdb4306ac5
commit
c015af8bee
15
packages/flame_oxygen/example/lib/system/sprite_system.dart
Normal file
15
packages/flame_oxygen/example/lib/system/sprite_system.dart
Normal file
@ -0,0 +1,15 @@
|
||||
import 'package:flame_oxygen/flame_oxygen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SpriteSystem extends BaseSystem {
|
||||
@override
|
||||
List<Filter<Component>> get filters => [Has<SpriteComponent>()];
|
||||
|
||||
@override
|
||||
void renderEntity(Canvas canvas, Entity entity) {
|
||||
final size = entity.get<SizeComponent>()!.size;
|
||||
final sprite = entity.get<SpriteComponent>()?.sprite;
|
||||
|
||||
sprite?.render(canvas, size: size);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user