Skip to content

Commit 5d5f947

Browse files
author
Julien
committed
fix(sdk): fixed skew
1 parent e71dc87 commit 5d5f947

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

engine/modules/entities/src/main/java/com/codingame/gameengine/module/entities/Serializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private String serializeEntitiesStateDiff(Entity<?> entity, EntityState diff, St
165165
private String minifyParam(String key, EntityState.Param param) {
166166
String result;
167167

168-
if (key.equals("rotation")) {
168+
if (key.equals("rotation") || key.equals("skewX") || key.equals("skewY")) {
169169
result = String.valueOf((int) Math.toDegrees((double) param.value));
170170
} else if (param.value instanceof Double) {
171171
result = decimalFormat.format(param.value);

engine/modules/entities/src/main/resources/view/entity-module/Entity.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export class Entity {
1111
y: 0,
1212
scaleX: 1,
1313
scaleY: 1,
14+
skewX: 0,
15+
skewY: 0,
1416
zIndex: 0,
1517
alpha: 1,
1618
visible: false,
@@ -173,6 +175,7 @@ export class Entity {
173175
this.container.scale.set(state.scaleX || eps, state.scaleY || eps)
174176
this.container.rotation = state.rotation
175177
this.container._visible = state.visible && !this.hide
178+
this.container.skew.set(state.skewX, state.skewY)
176179
}
177180

178181
static createState (time = 1, values = {}, curve = {}) {

engine/modules/entities/src/main/resources/view/entity-module/properties.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const PROPERTIES = {
6363
visible: boolOpts,
6464

6565
rotation: angleOpts,
66+
skew: angleOpts,
6667

6768
fillColor: colorOpts,
6869
lineColor: colorOpts,

playground/misc/misc-3-release-notes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The CodinGame SDK is regularly updated and improved. This document lets you know what changed in the latest releases.
44

5+
## 3.5.1
6+
7+
### 🐞 Bug fix
8+
9+
- Fixed the `skewX` and `skewY` properties for all `Entities`.
10+
511
## 3.5.0
612

713
### 🎁 New features
@@ -13,6 +19,10 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
1319

1420
- Updated the test page's player to match the codingame IDE
1521

22+
### ⚠️ Known issues
23+
24+
- `skew` property is not functional, to use it please move to 3.5.1 or higher
25+
1626
## 3.4.10
1727

1828
### 🎁 New features

0 commit comments

Comments
 (0)