Skip to content

Commit 6783f06

Browse files
committed
rename method
1 parent f7b0156 commit 6783f06

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

UNRELEASED-CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- Light will only be rendered on interaction to avoid dark screen on `Environment.enableAllFeatures()` (#355)
44
- Added new properties to `GraphicsConfiguration` to enable and auto enable light rendering (#355)
5-
- Support for orthographic rendering sprites via `SpriteDrawOptions.useOrhographicSorting()`
5+
- Support for orthographic rendering sprites via `SpriteDrawOptions.sortOrthographic()`
66

77
### 🪛 Bug Fixes
88

examples/pathfinding/src/main/java/io/github/srcimon/screwbox/pathfinding/scenes/DemoScene.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private Converter<GameObject> player() {
8080
.add(new PhysicsComponent())
8181
.add(new MovementRotationComponent())
8282
.addCustomized(new RenderComponent(object.layer().order()),
83-
renderComponent -> renderComponent.options = renderComponent.options.useOrhographicSorting())
83+
renderComponent -> renderComponent.options = renderComponent.options.sortOrthographic())
8484
.add(new TransformComponent(atPosition(object.position(), 8, 8)));
8585
}
8686

examples/vacuum-outlaw/src/main/java/io/github/srcimon/screwbox/vacuum/player/Player.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Entity convert(GameObject object) {
2424
.add(new StateComponent(new PlayerWalkingState()))
2525
.add(new ShadowCasterComponent(false))
2626
.addCustomized(new RenderComponent(object.layer().order()),
27-
render -> render.options = render.options.useOrhographicSorting())
27+
render -> render.options = render.options.sortOrthographic())
2828
.add(new CameraTargetComponent(5));
2929
}
3030
}

screwbox-core/src/main/java/io/github/srcimon/screwbox/core/graphics/SpriteBatch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void add(final Sprite sprite, final Offset offset, final SpriteDrawOption
4848
/**
4949
* Returns all {@link SpriteBatchEntry entries} in order.
5050
*
51-
* @see SpriteDrawOptions#useOrhographicSorting()
51+
* @see SpriteDrawOptions#sortOrthographic()
5252
*/
5353
public List<SpriteBatchEntry> entriesInOrder() {
5454
Collections.sort(entries);

screwbox-core/src/main/java/io/github/srcimon/screwbox/core/graphics/drawoptions/SpriteDrawOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public SpriteDrawOptions spinHorizontal(final boolean isSpinHorizontal) {
120120
*
121121
* @since 2.9.0
122122
*/
123-
public SpriteDrawOptions useOrhographicSorting() {
123+
public SpriteDrawOptions sortOrthographic() {
124124
return new SpriteDrawOptions(scale, opacity, rotation, isFlipHorizontal, isFlipVertical, spin, isSpinHorizontal, true);
125125
}
126126
}

screwbox-core/src/test/java/io/github/srcimon/screwbox/core/graphics/SpriteBatchTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void entriesInOrder_twoEntriesSameOrderNotOrthographic_returnsEntriesInSameOrder
3535
void entriesInOrder_twoEntriesSameOrderButFirstUsesOrthographic_returnsEntriesInCorrectOrder() {
3636
SpriteBatch spriteBatch = new SpriteBatch();
3737

38-
spriteBatch.add(FIRST_SPRITE, Offset.at(0, 10), SpriteDrawOptions.originalSize().useOrhographicSorting(), 1);
38+
spriteBatch.add(FIRST_SPRITE, Offset.at(0, 10), SpriteDrawOptions.originalSize().sortOrthographic(), 1);
3939
spriteBatch.add(SECOND_SPRITE, Offset.origin(), SpriteDrawOptions.originalSize(), 1);
4040

4141
assertThat(spriteBatch.entriesInOrder()).hasSize(2);
@@ -47,7 +47,7 @@ void entriesInOrder_twoEntriesSameOrderButSecondUsesOrthographic_returnsEntriesI
4747
SpriteBatch spriteBatch = new SpriteBatch();
4848

4949
spriteBatch.add(FIRST_SPRITE, Offset.at(0, 10), SpriteDrawOptions.originalSize(), 1);
50-
spriteBatch.add(SECOND_SPRITE, Offset.origin(), SpriteDrawOptions.originalSize().useOrhographicSorting(), 1);
50+
spriteBatch.add(SECOND_SPRITE, Offset.origin(), SpriteDrawOptions.originalSize().sortOrthographic(), 1);
5151

5252
assertThat(spriteBatch.entriesInOrder()).hasSize(2);
5353
assertThat(spriteBatch.entriesInOrder().getFirst()).matches(entry -> entry.sprite().equals(SECOND_SPRITE));

screwbox-core/src/test/java/io/github/srcimon/screwbox/core/graphics/drawoptions/SpriteDrawOptionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SpriteDrawOptionsTest {
1010

1111
@Test
1212
void scaled_returnsScaledInstance() {
13-
var options = SpriteDrawOptions.scaled(2).invertVerticalFlip().spin(Percent.of(0.4)).useOrhographicSorting();
13+
var options = SpriteDrawOptions.scaled(2).invertVerticalFlip().spin(Percent.of(0.4)).sortOrthographic();
1414

1515
assertThat(options.scale()).isEqualTo(2);
1616
assertThat(options.opacity()).isEqualTo(Percent.max());

0 commit comments

Comments
 (0)