Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix actual typos that made into our dictionary #2305

Merged
merged 3 commits into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/.cspell/gamedev_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ prerender
prerendered
pressable
proxying
pubdev
pubspec
queryable
raycast
Expand All @@ -118,7 +117,6 @@ respawn
respawned
rrect
rrects
rsts
scos
serializable
socio
Expand Down
2 changes: 1 addition & 1 deletion doc/bridge_packages/flame_svg/svg.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Svg support is provided by the `flame_svg` bridge package, be sure to put it in
to use it.

If you want to know more about the installation visit
[flame_svg on pubdev](https://pub.dev/packages/flame_svg/install).
[flame_svg on pub.dev](https://pub.dev/packages/flame_svg/install).


## How to use flame_svg
Expand Down
2 changes: 1 addition & 1 deletion doc/flame/effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ following effects qualify: [`MoveByEffect`](#movebyeffect), [`MoveToEffect`](#mo
[`RotateEffect.to`](#rotateeffectto).

The parameter `speed` is in units per second, where the notion of a "unit" depends on the target
effect. For example, for move effects, they refer to the distance travelled; for rotation effects
effect. For example, for move effects, they refer to the distance traveled; for rotation effects
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we favor the American spelling

the units are radians.

```dart
Expand Down
2 changes: 1 addition & 1 deletion doc/other_modules/jenny/language/commands/declare.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ the same as `TYPE`, and will throw a compile-time error otherwise.
<<declare $been_to_hell = false>>

<<declare $name as String>>
<<declare $distanceTravelled as Number>>
<<declare $distanceTraveled as Number>>

<<declare $birthDay = randomRange(1, 365) as Number>>
<<declare $vulgarity = GetObscenitySetting() as Bool>>
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platformer/step_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ with a `passive` `CollisionType`. Collisions will be explained more in a later
#### Display the Platform

In our `loadGameSegments` method from earlier, we will need to add the call to add our block. We
will need to define `gridPosition` and `xOffset` to be passed in. `gridPostion` will be a
will need to define `gridPosition` and `xOffset` to be passed in. `gridPosition` will be a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come spell didn't catch this? Should we add it to the flagWords in cspell.json?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we have it set to ignore anything within backticks via regex on config. I am working on improving that to be more strict

`Vector2` and `xOffset` is a double as that will be used to calculate the x-axis offset for
the block in a `Vector2`. So add the following to your `loadGameSegments` method:

Expand Down
8 changes: 4 additions & 4 deletions examples/games/trex/lib/trex_game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TRexGame extends FlameGame
String scoreString(int score) => score.toString().padLeft(5, '0');

/// Used for score calculation
double _distanceTravelled = 0;
double _distanceTraveled = 0;

@override
Future<void> onLoad() async {
Expand Down Expand Up @@ -128,7 +128,7 @@ class TRexGame extends FlameGame
_highscore = score;
}
score = 0;
_distanceTravelled = 0;
_distanceTraveled = 0;
}

@override
Expand All @@ -140,8 +140,8 @@ class TRexGame extends FlameGame

if (isPlaying) {
timePlaying += dt;
_distanceTravelled += dt * currentSpeed;
score = _distanceTravelled ~/ 50;
_distanceTraveled += dt * currentSpeed;
score = _distanceTraveled ~/ 50;

if (currentSpeed < maxSpeed) {
currentSpeed += acceleration * dt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@ class SpriteFontTextFormatter extends TextFormatter {
@override
TextElement format(String text) {
var rects = Float32List(text.length * 4);
var rsts = Float32List(text.length * 4);
var transforms = Float32List(text.length * 4);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@st-pasha I have googled far and wide what rsts means but could not find it hahaha
since the parameter later becomes transforms I think that might be clearer
but if you prefer rsts I am happy to keep it if you can give some context to add to the dictionary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, etymology time!
So, I took this name from Canvas.drawRawAtlas(), where it has the name rstTransforms, which is a Float32List. But really, it is interpreted as a sequence of RSTransform objects. And the name RSTransform is derived from Skia, and presumably it means "rotation-scale transform". No idea where the extra "t" in rstTransforms came from, probably it was a typo.

Renaming it into simply transforms sounds like a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, very interesting story.

so the issue is just on that flutter signature - rsts make sense as "rotation-scale transforms".
I imagine someone familiar with "rst" but that didn't know what it stood for called it "rst transform". similar to how people say "atm machine". funnily enough, elsewhere on flutter code it is correctly called rsTransform.
might make a PR to see what they say

as for our code, I think rsTransforms or just transforms are both good. I will merge transforms but lmk if you prefer rsTransforms I can change it

var j = 0;
var x0 = 0.0;
for (final glyph in font.textToGlyphs(text)) {
rects[j + 0] = glyph.srcLeft;
rects[j + 1] = glyph.srcTop;
rects[j + 2] = glyph.srcRight;
rects[j + 3] = glyph.srcBottom;
rsts[j + 0] = scale;
rsts[j + 1] = 0;
rsts[j + 2] = x0 + (glyph.srcLeft - glyph.left) * scale;
rsts[j + 3] = (glyph.srcTop - glyph.top - font.ascent) * scale;
transforms[j + 0] = scale;
transforms[j + 1] = 0;
transforms[j + 2] = x0 + (glyph.srcLeft - glyph.left) * scale;
transforms[j + 3] = (glyph.srcTop - glyph.top - font.ascent) * scale;
j += 4;
x0 += glyph.width * scale + letterSpacing;
}
if (j < text.length * 4) {
rects = rects.sublist(0, j);
rsts = rsts.sublist(0, j);
transforms = transforms.sublist(0, j);
}
return SpriteFontTextElement(
source: font.source,
transforms: rsts,
transforms: transforms,
rects: rects,
paint: paint,
metrics: LineMetrics(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Inventory extends StatelessWidget {
String _mapWeaponName(Weapon weapon) {
switch (weapon) {
case Weapon.bullet:
return 'Kinect';
return 'Kinetic';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume they didn't mean the video game peripheral

case Weapon.laser:
return 'Laser';
case Weapon.plasma:
Expand Down