Update to libGDX 1.9.13-SNAPSHOT

This commit is contained in:
MiChinao
2020-11-11 10:42:18 +01:00
parent bbd5d3758c
commit 5a8fa24938
16 changed files with 34 additions and 39 deletions
Binary file not shown.
+1 -9
View File
@@ -4,7 +4,7 @@ buildscript {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.badlogicgames.gdx:gdx-tools:1.9.11'
classpath "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
classpath 'com.novoda:bintray-release:0.9.2'
}
}
@@ -25,14 +25,6 @@ repositories {
ext {
appName = 'HyperLap2D'
gdxVersion = '1.9.11'
gdxVersionBeta = '1.9.11'
box2dlightsVersion = '1.6-SNAPSHOT'
ashleyVersion = '1.7.3'
spineVersion = '3.8.55.1'
visuiVersion = '1.4.7-SNAPSHOT'
typingLabelVersion = '1.2.0'
shapedrawerVersion = '2.3.0'
packMain = ["art/textures", "assets/style/", "uiskin"]
packSplash = ["art/splash_textures", "assets/splash/", "splash"]
+8
View File
@@ -0,0 +1,8 @@
gdxVersion = 1.9.13-SNAPSHOT
gdxVersionBeta = 1.9.13-SNAPSHOT
box2dlightsVersion = 1.6-SNAPSHOT
ashleyVersion = 1.7.3
spineVersion = 3.8.55.1
visuiVersion = 1.4.7-SNAPSHOT
typingLabelVersion = 1.2.0
shapedrawerVersion = 2.3.0
@@ -233,7 +233,7 @@ public class EditingZone extends Actor {
batch.setColor(Color.WHITE.r, Color.WHITE.g, Color.WHITE.b, Color.WHITE.a * parentAlpha);
}
public void zoomBy(int amount) {
public void zoomBy(float amount) {
float defaultSize = 1.0f - amount*0.12f;
currZoom*=defaultSize;
}
@@ -99,8 +99,8 @@ public class MainPanel extends H2DDialog {
public void setListeners(Stage stage) {
stage.addListener(new InputListener() {
@Override
public boolean scrolled(InputEvent event, float x, float y, int amount) {
editingZone.zoomBy(amount);
public boolean scrolled(InputEvent event, float x, float y, float amountX, float amountY) {
editingZone.zoomBy(amountX);
return false;
}
});
@@ -56,7 +56,7 @@ public class DeleteTileTool implements Tool {
}
@Override
public void stageMouseScrolled(int amount) {
public void stageMouseScrolled(float amountX, float amountY) {
}
@@ -67,7 +67,7 @@ public class DrawTileTool implements Tool {
}
@Override
public void stageMouseScrolled(int amount) {
public void stageMouseScrolled(float amountX, float amountY) {
}
@@ -238,7 +238,7 @@ public class HyperLap2DScreen implements Screen, InputProcessor {
}
@Override
public boolean scrolled(int amount) {
public boolean scrolled(float amountX, float amountY) {
return false;
}
@@ -24,6 +24,7 @@ import com.badlogic.ashley.core.Family;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.SnapshotArray;
import games.rednblack.editor.utils.KeyBindingsLayout;
@@ -170,16 +171,10 @@ public class SandboxMediator extends Mediator<Sandbox> {
}
public Vector2 getStageCoordinates() {
// TODO: remove this shit
Engine engine = getViewComponent().getEngine();
Family rootFamily = Family.all(ViewPortComponent.class).get();
Entity rootEntity = engine.getEntitiesFor(rootFamily).iterator().next();
Vector3 vec = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 1);
viewComponent.getCamera().unproject(vec);
ViewPortComponent viewPortComponent = ComponentRetriever.get(rootEntity, ViewPortComponent.class);
Vector2 vec = new Vector2(Gdx.input.getX(), Gdx.input.getY());
viewPortComponent.viewPort.unproject(vec);
return vec;
return new Vector2(vec.x, vec.y);
}
public class SandboxItemEventListener extends EntityClickListener {
@@ -238,7 +233,7 @@ public class SandboxMediator extends Mediator<Sandbox> {
}
@Override
public boolean scrolled(Entity entity, int amount) {
public boolean scrolled(Entity entity, float amountX, float amountY) {
return false;
}
@@ -433,22 +428,22 @@ public class SandboxMediator extends Mediator<Sandbox> {
@Override
public boolean scrolled(Entity entity, int amount) {
public boolean scrolled(Entity entity, float amountX, float amountY) {
Sandbox sandbox = Sandbox.getInstance();
// well, duh
if (amount == 0) return false;
if (amountX == 0) return false;
// Control pressed as well
if (isControlPressed()) {
float zoomPercent = sandbox.getZoomPercent();
zoomPercent-=amount*4f;
zoomPercent-= amountX *4f;
if(zoomPercent < 5 ) zoomPercent = 5;
sandbox.setZoomPercent(zoomPercent, true);
}
if (currentSelectedTool != null) {
currentSelectedTool.stageMouseScrolled(amount);
currentSelectedTool.stageMouseScrolled(amountX, amountY);
}
return false;
@@ -216,7 +216,7 @@ public class EntityClickListener implements InputListener {
}
@Override
public boolean scrolled(Entity entity, int amount) {
public boolean scrolled(Entity entity, float amountX, float amountY) {
// TODO Auto-generated method stub
return false;
}
@@ -18,6 +18,6 @@ public interface InputListener {
public boolean mouseMoved(Entity entity, float screenX, float screenY);
public boolean scrolled(Entity entity, int amount);
public boolean scrolled(Entity entity, float amountX, float amountY);
}
@@ -185,7 +185,7 @@ public class SandboxInputAdapter implements InputProcessor {
}
@Override
public boolean scrolled(int amount) {
public boolean scrolled(float amountX, float amountY) {
rootEntity = sandbox.getCurrentViewingEntity();
if(rootEntity == null){
@@ -194,7 +194,7 @@ public class SandboxInputAdapter implements InputProcessor {
Array<InputListener> sandboxListeners = sandbox.getAllListeners();
for (int i = 0, s = sandboxListeners.size; i < s; i++) {
sandboxListeners.get(i).scrolled(null, amount);
sandboxListeners.get(i).scrolled(null, amountX, amountY);
}
//TODO scroll for other Entities don't know how deep tis should go all entities or only hit tested
@@ -61,7 +61,7 @@ public class PanTool extends SimpleTool {
}
@Override
public void stageMouseScrolled(int amount) {
public void stageMouseScrolled(float amountX, float amountY) {
}
@@ -276,13 +276,13 @@ public class SelectionTool extends SimpleTool {
}
@Override
public void stageMouseScrolled(int amount) {
public void stageMouseScrolled(float amountX, float amountY) {
if (isItemDown) {
for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) {
transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class);
float degreeAmount = 1;
if (amount < 0) degreeAmount = -1;
if (amountX < 0) degreeAmount = -1;
// And if shift is pressed, the rotation amount is bigger
if (isShiftPressed()) {
degreeAmount = degreeAmount * 30;
+2 -2
View File
@@ -519,8 +519,8 @@ public class Box2dLightTest extends InputAdapter implements ApplicationListener
}
@Override
public boolean scrolled(int amount) {
camera.rotate((float) amount * 3f, 0, 0, 1);
public boolean scrolled(float amountX, float amountY) {
camera.rotate((float) amountX * 3f, 0, 0, 1);
return false;
}