From 52fbe9aaf79612b107aa0a9c83c672b04e292915 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=8D=9A=7ENex?=
<87421482+NexIsDumb@users.noreply.github.com>
Date: Tue, 16 Apr 2024 22:25:10 +0200
Subject: [PATCH] slightly better and alpha value
---
assets/editors/layouts/stage/spriteEditScreen.xml | 7 ++++++-
source/funkin/editors/stage/StageEditor.hx | 7 ++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/assets/editors/layouts/stage/spriteEditScreen.xml b/assets/editors/layouts/stage/spriteEditScreen.xml
index 611e5feb..6968066b 100644
--- a/assets/editors/layouts/stage/spriteEditScreen.xml
+++ b/assets/editors/layouts/stage/spriteEditScreen.xml
@@ -22,7 +22,9 @@
-
+
+
+
@@ -79,6 +81,7 @@
previewSprite.skew.x = skewXStepper.value;
previewSprite.skew.y = skewYStepper.value;
previewSprite.angle = angleStepper.value;
+ previewSprite.alpha = alphaStepper.value;
previewSprite.antialiasing = antialiasingCheckbox.checked;
var ratio = sprite.width / sprite.height;
previewSprite.setGraphicSize(50 * scaleXStepper.value * ratio, 50 * scaleYStepper.value);
@@ -99,6 +102,7 @@
//sprite.color = colorWheel.color;
//sprite.spriteAnimType = animType.value;
sprite.angle = angleStepper.value;
+ sprite.alpha = alphaStepper.value;
function saveXY(obj:Dynamic, name:String, x:UINumericStepper, y:UINumericStepper) {
button.xml.remove(name + "");
@@ -124,6 +128,7 @@
button.xml.set("type", animType.key);
button.xml.set("antialiasing", antialiasingCheckbox.checked);
button.xml.set("angle", angleStepper.value);
+ button.xml.set("alpha", alphaStepper.value);
saveXY(sprite.scrollFactor, "scroll", scrollXStepper, scrollYStepper);
saveXY(sprite.scale, "scale", scaleXStepper, scaleYStepper);
diff --git a/source/funkin/editors/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx
index 51b66abc..e0e4fc33 100644
--- a/source/funkin/editors/stage/StageEditor.hx
+++ b/source/funkin/editors/stage/StageEditor.hx
@@ -416,20 +416,21 @@ class StageEditor extends UIState {
if (mouseMode == NONE) {
if (FlxG.mouse.pressed) {
var pos = [FlxG.mouse.deltaScreenX, FlxG.mouse.deltaScreenY];
- movedTillRel.x += Math.abs(pos[0]); movedTillRel.y += Math.abs(pos[1]);
+ movedTillRel.x += pos[0]; movedTillRel.y += pos[1];
nextScroll.set(nextScroll.x - pos[0], nextScroll.y - pos[1]);
currentCursor = HAND;
}
if (FlxG.mouse.justReleased) {
- if (movedTillRel.x < 16 && movedTillRel.y < 16) {
+ if (Math.abs(movedTillRel.x) < 16 && Math.abs(movedTillRel.y) < 16) {
+ var point = FlxG.mouse.getWorldPosition(stageCamera, _point);
var sprites = getRealSprites();
for (i in 0...sprites.length) {
var sprite = sprites[sprites.length - i - 1];
if(sprite.animateAtlas != null) continue;
calcSpriteBounds(sprite);
- if (cast(sprite.extra.get(exID("bounds")), FlxRect).containsPoint(FlxG.mouse.getWorldPosition(stageCamera, _point))) {
+ if (cast(sprite.extra.get(exID("bounds")), FlxRect).containsPoint(point)) {
selectSprite(sprite); break;
}
}