From 82e62f64224c707f9301c5584e291f81d2421db8 Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Fri, 22 Mar 2024 01:31:46 +0300 Subject: [PATCH] PIXI Controls: Custom hitArea for DPAD --- www.eng/js/plugins/VND_ONSControls.js | 1 + www.rus/js/plugins/VND_ONSControls.js | 1 + 2 files changed, 2 insertions(+) diff --git a/www.eng/js/plugins/VND_ONSControls.js b/www.eng/js/plugins/VND_ONSControls.js index ed68d4f..39fe7a5 100644 --- a/www.eng/js/plugins/VND_ONSControls.js +++ b/www.eng/js/plugins/VND_ONSControls.js @@ -57,6 +57,7 @@ ONSControls.createDPad = function() { container.interactive = true; container.pressed = false; container.pressed_button = null; + container.hitArea = new PIXI.Polygon([-30,-83, 30,-83, 30,-30, 83,-30, 83,30, 30,30, 30,82, -30,82, -30,30, -83, 30, -83,-30, -30,-30]); container.down = function(x, y) { if (Math.abs(x) > container.width / 2 || Math.abs(y) > container.height / 2) { return; // Pointer out of dpad, ignoring event diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 079b567..b2d0fc8 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -57,6 +57,7 @@ ONSControls.createDPad = function() { container.interactive = true; container.pressed = false; container.pressed_button = null; + container.hitArea = new PIXI.Polygon([-30,-83, 30,-83, 30,-30, 83,-30, 83,30, 30,30, 30,82, -30,82, -30,30, -83, 30, -83,-30, -30,-30]); container.down = function(x, y) { if (Math.abs(x) > container.width / 2 || Math.abs(y) > container.height / 2) { return; // Pointer out of dpad, ignoring event