Skip to content

Commit

Permalink
Investigating libGDX version 1.7.0 which includes this needed fix: li…
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonC4 committed Oct 21, 2015
1 parent c64e4a1 commit 669e3a1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -18,7 +18,7 @@ allprojects {
version = '1.3.1'
ext {
appName = 'DestinationSol'
gdxVersion = '1.6.4'
gdxVersion = '1.7.0'
roboVMVersion = '1.5.0'
}

Expand Down
Expand Up @@ -2,6 +2,7 @@

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Cursor;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.math.Vector2;
Expand Down Expand Up @@ -120,7 +121,10 @@ private void setMouseTargetCursor() {
Pixmap pm = new Pixmap(Gdx.files.internal(debugPath + "res/imgs/cursors/cursorTarget.png"));
int xHotSpot = pm.getWidth() / 2;
int yHotSpot = pm.getHeight() / 2;
Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
// Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
Cursor cursor = Gdx.graphics.newCursor(pm, xHotSpot, yHotSpot);
Gdx.graphics.setCursor(cursor);

pm.dispose();
}

Expand Down
@@ -1,6 +1,7 @@
package com.miloshpetrov.sol2.game.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Cursor;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.math.Vector2;
Expand Down Expand Up @@ -93,7 +94,10 @@ private void setMouseCursorImage(BeaconHandler.Action cursorType) {
}
int xHotSpot = pm.getWidth() / 2;
int yHotSpot = pm.getHeight() / 2;
Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
// Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
Cursor cursor = Gdx.graphics.newCursor(pm, xHotSpot, yHotSpot);
Gdx.graphics.setCursor(cursor);

pm.dispose();
}

Expand Down
9 changes: 7 additions & 2 deletions main/src/com/miloshpetrov/sol2/ui/SolInputManager.java
Expand Up @@ -4,6 +4,7 @@
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Cursor;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.math.Rectangle;
Expand Down Expand Up @@ -227,7 +228,9 @@ private void setMouseUICursor() {
Pixmap pm = new Pixmap(Gdx.files.internal(debugPath + "res/imgs/cursors/cursor.png"));
int xHotSpot = pm.getWidth() / 2;
int yHotSpot = pm.getHeight() / 2;
Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
// Gdx.input.setCursorImage(pm, xHotSpot, yHotSpot);
Cursor cursor = Gdx.graphics.newCursor(pm, xHotSpot, yHotSpot);
Gdx.graphics.setCursor(cursor);
pm.dispose();
}

Expand All @@ -240,7 +243,9 @@ private void setMouseCursorHidden() {

// Load the cursor image - the hotspot is where the click point is which is in the middle in this image.
Pixmap pm = new Pixmap(Gdx.files.internal(debugPath + "res/imgs/cursors/cursorHidden.png"));
Gdx.input.setCursorImage(pm, 0, 0);
// Gdx.input.setCursorImage(pm, 0, 0);
Cursor cursor = Gdx.graphics.newCursor(pm, 0, 0);
Gdx.graphics.setCursor(cursor);
pm.dispose();
}

Expand Down

0 comments on commit 669e3a1

Please sign in to comment.