Skip to content

Commit

Permalink
Merge pull request #515 from flame-engine/develop
Browse files Browse the repository at this point in the history
0.28.0 release
  • Loading branch information
renancaraujo authored Oct 27, 2020
2 parents 652a22b + a35d459 commit f1f6289
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Describe your issue here

## Development enviroment
## Development environment

Flame version:

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 0.28.0
- Fix spriteAsWidget deprecation message
- Add `lineHeight` property to `TextConfig`
- Adding pause and resume methods to time class

## 0.27.0
- Improved the accuracy of the `FPSCounter` by using Flutter's internal frame timings.
- Adding MouseMovementDetector
Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Put the pub package as your dependency by dropping the following in your `pubspe

```yaml
dependencies:
flame: ^0.27.0
flame: ^0.28.0
```
And start using it!
Expand Down
1 change: 1 addition & 0 deletions doc/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TextConfig config = TextConfig(fontSize: 48.0, fontFamily: 'Awesome Font')

* fontFamily : a commonly available font, like Arial (default), or a custom font added in your pubspec (see [here](https://flutter.io/custom-fonts/) how to do it)
* fontSize : font size, in pts (default `24.0`)
* lineHeight: height of text line, as a multiple of font size (default `null`)
* color : the color, as a `ui.Color` (default black)

For more information regarding colors and how to create then, see the [Colors and the Palette](/doc/palette.md) guide.
Expand Down
5 changes: 5 additions & 0 deletions lib/text_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class TextConfig {
/// For proper fonts of languages like Hebrew or Arabic, replace this with [TextDirection.rtl].
final TextDirection textDirection;

/// The height of line, as a multiple of font size.
final double lineHeight;

final MemoryCache _textPainterCache =
MemoryCache<String, material.TextPainter>();

Expand All @@ -66,6 +69,7 @@ class TextConfig {
this.fontFamily = 'Arial',
this.textAlign = TextAlign.left,
this.textDirection = TextDirection.ltr,
this.lineHeight,
});

/// Renders a given [text] in a given position [p] using the provided [canvas] and [anchor].
Expand Down Expand Up @@ -103,6 +107,7 @@ class TextConfig {
color: color,
fontSize: fontSize,
fontFamily: fontFamily,
height: lineHeight,
);
final material.TextSpan span = material.TextSpan(
style: style,
Expand Down
8 changes: 8 additions & 0 deletions lib/time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class Timer {
_running = false;
}

void pause() {
_running = false;
}

void resume() {
_running = true;
}

/// A value between 0 and 1 indicating the timer progress
double get progress => _current / _limit;
}
2 changes: 1 addition & 1 deletion lib/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Util {
/// You can use this implementation as base to easily create your own widgets based on more complex games.
/// This is intended to be used by non-game apps that want to add a sprite sheet animation.
///
@Deprecated('Use SpriteAnimation instead')
@Deprecated('Use AnimationWidget instead')
widgets.Widget animationAsWidget(Position size, Animation animation) {
return EmbeddedGameWidget(
BaseGame()..add(AnimationComponent(size.x, size.y, animation)),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flame
description: A minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
version: 0.27.0
version: 0.28.0
homepage: https://github.com/flame-engine/flame

dependencies:
Expand Down

0 comments on commit f1f6289

Please sign in to comment.