From 9f0f7fd1ce5ac46d4f04e823a463265f87a9651d Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 25 Aug 2022 17:57:17 +0900 Subject: [PATCH] another music composer ui ideas --- .../gameactors/FixtureSwingingDoorBase.kt | 25 +++++++++++++------ work_files/graphics/gui/composer/mockup.png | 3 +++ .../gui/composer/piano_roll_paper_print.png | 3 +++ .../piano_roll_paper_print_mockup.png | 3 +++ .../graphics/gui/composer/tape_punched.png | 3 +++ 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 work_files/graphics/gui/composer/mockup.png create mode 100644 work_files/graphics/gui/composer/piano_roll_paper_print.png create mode 100644 work_files/graphics/gui/composer/piano_roll_paper_print_mockup.png create mode 100644 work_files/graphics/gui/composer/tape_punched.png diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt index b2294d2e7..e9b8093df 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureSwingingDoorBase.kt @@ -1,5 +1,6 @@ package net.torvald.terrarum.modulebasegame.gameactors +import com.badlogic.gdx.graphics.Color import net.torvald.gdx.graphics.Cvec import net.torvald.spriteanimation.SheetSpriteAnimation import net.torvald.terrarum.* @@ -208,17 +209,22 @@ open class FixtureSwingingDoorBase : FixtureBase, Luminous { } private fun mouseOnLeftSide(): Boolean { - val ww = INGAME.world.width - val mouseRelX = Terrarum.mouseX - hitbox.hitboxStart.x - val mouseRelY = Terrarum.mouseY - hitbox.hitboxStart.y - return 0.0 <= mouseRelX && mouseRelX < hitbox.width / 2 && mouseRelY in 0.0..hitbox.height + val ww = INGAME.world.width * TILE_SIZED + val pivot = this@FixtureSwingingDoorBase.hitbox.centeredX + // note: this function uses startX while the dual other function uses endX; the "dist" must be same between two functions + val dist = pivot - Terrarum.mouseX // NOTE: order is different from the other function + val dist2 = pivot - (Terrarum.mouseX - ww) + val distLim = this@FixtureSwingingDoorBase.hitbox.width + return (dist in 0.0..distLim || dist2 in 0.0..distLim) && (Terrarum.mouseY - hitbox.hitboxStart.y) in 0.0..hitbox.height } private fun mouseOnRightSide(): Boolean { - val ww = INGAME.world.width - val mouseRelX = Terrarum.mouseX - hitbox.hitboxStart.x - val mouseRelY = Terrarum.mouseY - hitbox.hitboxStart.y - return hitbox.width / 2 < mouseRelX && mouseRelX <= hitbox.width && mouseRelY in 0.0..hitbox.height + val ww = INGAME.world.width * TILE_SIZED + val pivot = this@FixtureSwingingDoorBase.hitbox.centeredX + val dist = Terrarum.mouseX - pivot // NOTE: order is different from the other function + val dist2 = (Terrarum.mouseX + ww) - pivot + val distLim = this@FixtureSwingingDoorBase.hitbox.width + return dist in 0.0..distLim || dist2 in 0.0..distLim && (Terrarum.mouseY - hitbox.hitboxStart.y) in 0.0..hitbox.height } private fun ActorWithBody.ontheLeftSideOfDoor(): Boolean { @@ -266,6 +272,9 @@ open class FixtureSwingingDoorBase : FixtureBase, Luminous { // if (doorCloseQueued) Color.YELLOW // else if (doorStateTimer > doorHoldLength[doorState]!!) Color.LIME // else Color.CORAL + this.sprite?.colourFilter = if (mouseOnLeftSide()) Color.CORAL + else if (mouseOnRightSide()) Color.LIME + else Color.WHITE if (!flagDespawn && worldBlockPos != null) { diff --git a/work_files/graphics/gui/composer/mockup.png b/work_files/graphics/gui/composer/mockup.png new file mode 100644 index 000000000..f703ae01a --- /dev/null +++ b/work_files/graphics/gui/composer/mockup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dabb3e2c12dc8d977e957ae49cdfef6df215a2b22ac792531970d248292ce306 +size 93301 diff --git a/work_files/graphics/gui/composer/piano_roll_paper_print.png b/work_files/graphics/gui/composer/piano_roll_paper_print.png new file mode 100644 index 000000000..d31c9fa04 --- /dev/null +++ b/work_files/graphics/gui/composer/piano_roll_paper_print.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e7daa894deaf72f4587dafc439995d8b9fa81059d22007d14a7763f08d65ab +size 2929 diff --git a/work_files/graphics/gui/composer/piano_roll_paper_print_mockup.png b/work_files/graphics/gui/composer/piano_roll_paper_print_mockup.png new file mode 100644 index 000000000..ee97aad93 --- /dev/null +++ b/work_files/graphics/gui/composer/piano_roll_paper_print_mockup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ba81be91bcd492a5e720ce4ba26d7e6f51d902508ca01e6078cc26ede244d70 +size 5931 diff --git a/work_files/graphics/gui/composer/tape_punched.png b/work_files/graphics/gui/composer/tape_punched.png new file mode 100644 index 000000000..06df6595a --- /dev/null +++ b/work_files/graphics/gui/composer/tape_punched.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04e501dd64972177b0526064805ebe0d16401f2a64c37149ad93a6c1950b927f +size 253