diff --git a/resources-windows/HyperLap2D-setup-icon.bmp b/resources-windows/HyperLap2D-setup-icon.bmp new file mode 100644 index 00000000..722560a4 Binary files /dev/null and b/resources-windows/HyperLap2D-setup-icon.bmp differ diff --git a/src/main/java/games/rednblack/editor/view/stage/Sandbox.java b/src/main/java/games/rednblack/editor/view/stage/Sandbox.java index 0849db9b..0f313917 100644 --- a/src/main/java/games/rednblack/editor/view/stage/Sandbox.java +++ b/src/main/java/games/rednblack/editor/view/stage/Sandbox.java @@ -314,11 +314,8 @@ public class Sandbox { return sceneControl.getCurrentScene(); } - public void prepareSelectionRectangle(float x, float y, boolean setOpacity) { - // space is panning, so if we are not, then prepare the selection rectangle - if (setOpacity) { - selectionRec.setOpacity(0.6f); - } + public void prepareSelectionRectangle(float x, float y) { + selectionRec.setOpacity(0.8f); selectionRec.setWidth(0); selectionRec.setHeight(0); selectionRec.setX(x); diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java index f5d58cd6..8b6af439 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java @@ -23,6 +23,8 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.math.*; +import com.badlogic.gdx.scenes.scene2d.Action; +import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.Viewport; import com.kotcrab.vis.ui.util.OsUtils; @@ -105,18 +107,11 @@ public class SelectionTool extends SimpleTool { public boolean stageMouseDown(float x, float y) { sandbox = Sandbox.getInstance(); - boolean setOpacity = false; - - //TODO: Anyone can explain what was the purpose of this? - if (!Gdx.input.isKeyPressed(Input.Keys.SPACE)) { - setOpacity = true; - } - // transform stage coordinates to screen coordinates Vector2 screenCoords = Sandbox.getInstance().worldToScreen(x, y); // preparing selection tool rectangle to follow mouse - sandbox.prepareSelectionRectangle(screenCoords.x, screenCoords.y, setOpacity); + sandbox.prepareSelectionRectangle(screenCoords.x, screenCoords.y); return true; } diff --git a/src/main/java/games/rednblack/editor/view/ui/widget/actors/basic/PixelRect.java b/src/main/java/games/rednblack/editor/view/ui/widget/actors/basic/PixelRect.java index 51f90a42..539e8e86 100644 --- a/src/main/java/games/rednblack/editor/view/ui/widget/actors/basic/PixelRect.java +++ b/src/main/java/games/rednblack/editor/view/ui/widget/actors/basic/PixelRect.java @@ -19,19 +19,19 @@ package games.rednblack.editor.view.ui.widget.actors.basic; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.scenes.scene2d.Group; +import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.ui.Image; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.proxy.EditorTextureManager; -import games.rednblack.editor.proxy.ProjectManager; public class PixelRect extends Group { private final HyperLap2DFacade facade; - private final ProjectManager projectManager; - private PixelLine[] lines = new PixelLine[4]; - private Image fill; + private final PixelLine[] lines = new PixelLine[4]; + private final Image fill; public PixelRect() { this(0, 0); @@ -39,7 +39,6 @@ public class PixelRect extends Group { public PixelRect(float width, float height) { facade = HyperLap2DFacade.getInstance(); - projectManager = facade.retrieveProxy(ProjectManager.NAME); EditorTextureManager tm = facade.retrieveProxy(EditorTextureManager.NAME); lines[0] = new PixelLine(tm, 0, 0, width, 0); lines[1] = new PixelLine(tm, 0, 0, 0, height); @@ -95,9 +94,7 @@ public class PixelRect extends Group { } public void setOpacity(float opacity) { - Color clr = getColor(); - clr.a = opacity; - setColor(clr); + addAction(Actions.alpha(opacity, 0.3f, Interpolation.exp5Out)); } public Rectangle getRect() {