Skip to content

Commit 2099ad8

Browse files
committed
Update to libgdx v1.9.9 + prepare for release v2.2.0
1 parent 3e62d8e commit 2099ad8

File tree

20 files changed

+304
-333
lines changed

20 files changed

+304
-333
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [2.2.0]
6+
7+
- Java 11 support (Gradle v4.10.2).
8+
- Update to libgdx v1.9.9.
9+
- iOS 12 bug fix (robovm v2.3.5).
10+
- Added property to change the text position of bubbles for character actors.
11+
- Add max width/height in the create atlas dialog.
12+
- Android SDK is not mandatory to create or edit projects.
13+
- A lot of bugs fixed (see git log).
14+
515
## [2.1.4]
616

717
- Now the editor works without having the Android SDK installed.

adventure-editor/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ dependencies {
5353
api "commons-io:commons-io:2.1"
5454
api "com.bladecoder.packr:packr:2.1"
5555
api "eu.infomas:annotation-detector:3.0.5"
56-
api "com.strongjoshua:libgdx-inGameConsole:0.7.1"
57-
api "com.kotcrab.vis:vis-ui:1.2.2"
56+
api "com.strongjoshua:libgdx-inGameConsole:0.9.0"
57+
api "com.kotcrab.vis:vis-ui:1.4.2-SNAPSHOT"
5858
api "com.bladecoder.ink:blade-ink:$bladeInkVersion"
5959

6060
implementation project(":blade-engine")

adventure-editor/desktop/com.bladecoder.adventure-editor.appdata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</screenshot>
1919
</screenshots>
2020
<releases>
21-
<release version="2.1.0" date="2018-07-03"/>
21+
<release version="2.1.5" date="2018-11-19"/>
2222
</releases>
2323
<update_contact>[email protected]</update_contact>
2424

adventure-editor/src/main/java/com/bladecoder/engineeditor/scneditor/AnimationWidget.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void setSource(String type, AnimationDesc anim) {
6565
} else {
6666
renderer = new AtlasRenderer();
6767
}
68-
68+
6969
renderer.setOrgAlign(Align.bottom);
7070
renderer.loadAssets();
7171
EngineAssetManager.getInstance().finishLoading();
@@ -74,7 +74,7 @@ public void setSource(String type, AnimationDesc anim) {
7474

7575
public String[] getAnimations() {
7676
try {
77-
return ((AnimationRenderer)renderer).getInternalAnimations(fa);
77+
return ((AnimationRenderer) renderer).getInternalAnimations(fa);
7878
} catch (Exception e) {
7979
// Message.show(getStage(),
8080
// "Error loading animations from selected source", 4);
@@ -85,10 +85,10 @@ public String[] getAnimations() {
8585
}
8686

8787
public void setAnimation(String id, String speedStr, Tween.Type t) {
88-
89-
if (fa != null && id != null && !id.isEmpty()) {
90-
91-
if(fa instanceof AtlasAnimationDesc)
88+
89+
if (fa != null && id != null && !id.isEmpty()) {
90+
91+
if (fa instanceof AtlasAnimationDesc)
9292
((AtlasAnimationDesc) fa).regions = null;
9393

9494
Tween.Type type = Tween.Type.REPEAT;
@@ -97,46 +97,47 @@ public void setAnimation(String id, String speedStr, Tween.Type t) {
9797
if (speedStr != null && !speedStr.isEmpty()) {
9898
try {
9999
speed = Float.parseFloat(speedStr);
100-
} catch(NumberFormatException e) {
100+
} catch (NumberFormatException e) {
101101
speed = 0;
102102
}
103103
}
104104

105105
if (t == Tween.Type.YOYO)
106106
type = Tween.Type.YOYO;
107-
else if(t == Tween.Type.REVERSE)
107+
else if (t == Tween.Type.REVERSE)
108108
type = Tween.Type.REVERSE_REPEAT;
109109

110110
fa.id = id;
111111
fa.duration = speed;
112112
fa.animationType = type;
113113
fa.count = -1;
114-
115-
((AnimationRenderer)renderer).getAnimations().clear();
116114

117-
((AnimationRenderer)renderer).addAnimation(fa);
118-
((AnimationRenderer)renderer).startAnimation(fa.id, Tween.Type.SPRITE_DEFINED, 1, null);
115+
((AnimationRenderer) renderer).getAnimations().clear();
116+
117+
((AnimationRenderer) renderer).addAnimation(fa);
118+
((AnimationRenderer) renderer).startAnimation(fa.id, Tween.Type.SPRITE_DEFINED, 1, null);
119119
}
120120
}
121121

122+
@Override
122123
public void draw(Batch batch, float parentAlpha) {
123124
super.draw(batch, parentAlpha);
124125

125-
if (renderer == null || ((AnimationRenderer)renderer).getCurrentAnimation() == null)
126+
if (renderer == null || ((AnimationRenderer) renderer).getCurrentAnimation() == null)
126127
return;
127128

128-
Color tmp = batch.getColor();
129+
float tmp = batch.getPackedColor();
129130
batch.setColor(Color.WHITE);
130131

131132
renderer.update(Gdx.graphics.getDeltaTime());
132133

133-
RectangleRenderer.draw((SpriteBatch) batch, getX(), getY(), getWidth(), getHeight(), Color.MAGENTA);
134+
RectangleRenderer.draw(batch, getX(), getY(), getWidth(), getHeight(), Color.MAGENTA);
134135

135136
float scalew = getWidth() / renderer.getWidth();
136137
float scaleh = getHeight() / renderer.getHeight();
137138
float scale = scalew > scaleh ? scaleh : scalew;
138139
renderer.draw((SpriteBatch) batch, getX() + renderer.getWidth() * scale / 2, getY(), scale, scale, 0f, null);
139-
batch.setColor(tmp);
140+
batch.setPackedColor(tmp);
140141
}
141142

142143
public void dispose() {

adventure-editor/src/main/java/com/bladecoder/engineeditor/scneditor/ScnWidget.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ else if (Gdx.input.isKeyPressed(Keys.RIGHT))
236236
public void draw(Batch batch, float parentAlpha) {
237237
validate();
238238

239-
Color tmp = batch.getColor();
239+
float tmp = batch.getPackedColor();
240240
batch.setColor(Color.WHITE);
241241

242242
if (scn != null && !loading && !loadingError) {
@@ -328,11 +328,11 @@ public void draw(Batch batch, float parentAlpha) {
328328

329329
textLayout.setText(defaultFont, str);
330330

331-
RectangleRenderer.draw((SpriteBatch) batch, 0f, getY() + getHeight() - textLayout.height - 15,
332-
textLayout.width + 10, textLayout.height + 10, BLACK_TRANSPARENT);
331+
RectangleRenderer.draw(batch, 0f, getY() + getHeight() - textLayout.height - 15, textLayout.width + 10,
332+
textLayout.height + 10, BLACK_TRANSPARENT);
333333
defaultFont.draw(batch, textLayout, 5, getHeight() + getY() - 10);
334334

335-
batch.setColor(tmp);
335+
batch.setPackedColor(tmp);
336336

337337
} else {
338338
background.draw(batch, getX(), getY(), getWidth(), getHeight());
@@ -428,7 +428,7 @@ private void drawTransformIcons(SpriteBatch batch, BaseActor a) {
428428
}
429429
}
430430

431-
public boolean inTransforIcon(float px, float py, DraggingModes dm) {
431+
public boolean inTransformIcon(float px, float py, DraggingModes dm) {
432432
Polygon p = selectedActor.getBBox();
433433

434434
Rectangle r = p.getBoundingRectangle();
@@ -447,16 +447,16 @@ public boolean inTransforIcon(float px, float py, DraggingModes dm) {
447447

448448
if (dm == DraggingModes.ROTATE_ACTOR) {
449449
r2 = new Rectangle(x2 - scnRotateIcon.getRegionWidth() / 3, y2 - scnRotateIcon.getRegionHeight() / 3,
450-
(float) scnRotateIcon.getRegionWidth(), (float) scnRotateIcon.getRegionHeight());
450+
scnRotateIcon.getRegionWidth(), scnRotateIcon.getRegionHeight());
451451
} else if (dm == DraggingModes.SCALE_ACTOR) {
452452
r2 = new Rectangle(x - scnScaleIcon.getRegionWidth(), y - scnScaleIcon.getRegionHeight(),
453-
(float) scnScaleIcon.getRegionWidth(), (float) scnScaleIcon.getRegionHeight());
453+
scnScaleIcon.getRegionWidth(), scnScaleIcon.getRegionHeight());
454454
} else if (dm == DraggingModes.SCALE_LOCK_ACTOR) {
455-
r2 = new Rectangle(x - scnScaleLockIcon.getRegionWidth(), y2, (float) scnScaleLockIcon.getRegionWidth(),
456-
(float) scnScaleLockIcon.getRegionHeight());
455+
r2 = new Rectangle(x - scnScaleLockIcon.getRegionWidth(), y2, scnScaleLockIcon.getRegionWidth(),
456+
scnScaleLockIcon.getRegionHeight());
457457
} else if (dm == DraggingModes.DRAGGING_ACTOR) {
458-
r2 = new Rectangle(x + (x2 - x - scnMoveIcon.getRegionWidth()) / 2, y2,
459-
(float) scnMoveIcon.getRegionWidth(), (float) scnMoveIcon.getRegionHeight());
458+
r2 = new Rectangle(x + (x2 - x - scnMoveIcon.getRegionWidth()) / 2, y2, scnMoveIcon.getRegionWidth(),
459+
scnMoveIcon.getRegionHeight());
460460
}
461461

462462
worldToScreenCoords(tmpV2Transform.set(px, py));
@@ -482,9 +482,9 @@ private void drawFakeDepthMarkers(SpriteBatch batch) {
482482

483483
float posx = tmp2V2.x - textLayout.width - 20;
484484

485-
RectangleRenderer.draw((SpriteBatch) batch, posx, tmp2V2.y, textLayout.width + margin * 2,
486-
textLayout.height + margin * 2, Color.BLACK);
487-
RectangleRenderer.draw((SpriteBatch) batch, tmp2V2.x - 20, tmp2V2.y, 20, 2, Color.BLACK);
485+
RectangleRenderer.draw(batch, posx, tmp2V2.y, textLayout.width + margin * 2, textLayout.height + margin * 2,
486+
Color.BLACK);
487+
RectangleRenderer.draw(batch, tmp2V2.x - 20, tmp2V2.y, 20, 2, Color.BLACK);
488488

489489
defaultFont.draw(batch, textLayout, posx + margin, tmp2V2.y + textLayout.height + margin);
490490

@@ -497,9 +497,9 @@ private void drawFakeDepthMarkers(SpriteBatch batch) {
497497

498498
posx = tmp2V2.x - textLayout.width - 20;
499499

500-
RectangleRenderer.draw((SpriteBatch) batch, posx, tmp2V2.y, textLayout.width + margin * 2,
501-
textLayout.height + margin * 2, Color.BLACK);
502-
RectangleRenderer.draw((SpriteBatch) batch, tmp2V2.x - 20, tmp2V2.y, 20, 2, Color.BLACK);
500+
RectangleRenderer.draw(batch, posx, tmp2V2.y, textLayout.width + margin * 2, textLayout.height + margin * 2,
501+
Color.BLACK);
502+
RectangleRenderer.draw(batch, tmp2V2.x - 20, tmp2V2.y, 20, 2, Color.BLACK);
503503

504504
defaultFont.draw(batch, textLayout, posx + margin, tmp2V2.y + textLayout.height + margin);
505505

adventure-editor/src/main/java/com/bladecoder/engineeditor/scneditor/ScnWidgetInputListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public boolean touchDown(InputEvent event, float x, float y, int pointer, int bu
154154

155155
// CLICK IN MOVE ICON
156156
if (!(selActor instanceof AnchorActor)
157-
&& scnWidget.inTransforIcon(p.x, p.y, DraggingModes.DRAGGING_ACTOR)) {
157+
&& scnWidget.inTransformIcon(p.x, p.y, DraggingModes.DRAGGING_ACTOR)) {
158158
draggingMode = DraggingModes.DRAGGING_ACTOR;
159159
undoOrg.set(selActor.getX(), selActor.getY());
160160
return true;
@@ -175,20 +175,20 @@ public boolean touchDown(InputEvent event, float x, float y, int pointer, int bu
175175

176176
// CHECK CLICK IN TRANSFORM ICON
177177
if (selActor instanceof SpriteActor) {
178-
if (scnWidget.inTransforIcon(p.x, p.y, DraggingModes.ROTATE_ACTOR)) {
178+
if (scnWidget.inTransformIcon(p.x, p.y, DraggingModes.ROTATE_ACTOR)) {
179179
draggingMode = DraggingModes.ROTATE_ACTOR;
180180
undoRot = ((SpriteActor) selActor).getRot();
181181
return true;
182182
}
183183

184184
if (!((SpriteActor) selActor).getFakeDepth()) {
185-
if (scnWidget.inTransforIcon(p.x, p.y, DraggingModes.SCALE_ACTOR)) {
185+
if (scnWidget.inTransformIcon(p.x, p.y, DraggingModes.SCALE_ACTOR)) {
186186
draggingMode = DraggingModes.SCALE_ACTOR;
187187
undoOrg.set(((SpriteActor) selActor).getScaleX(), ((SpriteActor) selActor).getScaleY());
188188
return true;
189189
}
190190

191-
if (scnWidget.inTransforIcon(p.x, p.y, DraggingModes.SCALE_LOCK_ACTOR)) {
191+
if (scnWidget.inTransformIcon(p.x, p.y, DraggingModes.SCALE_LOCK_ACTOR)) {
192192
draggingMode = DraggingModes.SCALE_LOCK_ACTOR;
193193
undoOrg.set(((SpriteActor) selActor).getScaleX(), ((SpriteActor) selActor).getScaleY());
194194
return true;

0 commit comments

Comments
 (0)