mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
Adding a rotate method to Position and a drawWhere method to utils
This commit is contained in:
@ -5,6 +5,8 @@ import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart' as material;
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'position.dart';
|
||||
|
||||
class Util {
|
||||
void fullScreen() {
|
||||
SystemChrome.setEnabledSystemUIOverlays([]);
|
||||
@ -46,4 +48,10 @@ class Util {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void drawWhere(Canvas c, Position p, void Function(Canvas) fn) {
|
||||
c.translate(p.x, p.y);
|
||||
fn(c);
|
||||
c.translate(-p.x, -p.y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user