This commit is contained in:
RandomityGuy 2023-07-15 14:34:51 +05:30
parent 4241792a1e
commit b10f071d87
4 changed files with 7 additions and 6 deletions

View file

@ -27,6 +27,7 @@ import h3d.Vector;
import hxsl.Types.Matrix;
import h3d.scene.Scene;
import src.Gamepad;
import src.MarbleGame;
enum CameraMode {
FreeOrbit;
@ -237,7 +238,9 @@ class CameraController extends Object {
deltaX = deltaNew;
// Center the pitch
if (!Settings.controlsSettings.alwaysFreeLook && !Key.isDown(Settings.controlsSettings.freelook)) {
if (!Settings.controlsSettings.alwaysFreeLook
&& !Key.isDown(Settings.controlsSettings.freelook)
&& !MarbleGame.instance.touchInput.cameraInput.pressed) {
var rescaledY = deltaY;
if (rescaledY <= 0.0)
rescaledY = 0.4 - rescaledY * -0.75;

View file

@ -147,7 +147,7 @@ class GuiConsoleScrollCtrl extends GuiControl {
public override function render(scene2d:Scene) {
this.dirty = true;
this.scrollTrack.position = new Vector(extent.x - 18 * Settings.uiScale, 0);
this.scrollTrack.position = new Vector(extent.x - 18, 0);
this.scrollTrack.extent = new Vector(18, this.extent.y);
scrollUpButton.position = new Vector(this.extent.x - 18, 0);
@ -180,7 +180,6 @@ class GuiConsoleScrollCtrl extends GuiControl {
var scrollBarYSize = (renderRect.extent.y * renderRect.extent.y / (maxScrollY * Settings.uiScale));
var scrollYOld = scrollY;
this.scrollTrack.bmp.scaleY = renderRect.extent.y;
this.scrollY = Util.clamp(scrollY, 0, renderRect.extent.y - scrollBarYSize * Settings.uiScale);
scrollBarYSize = Math.max(scrollBarYSize, 13);

View file

@ -13,6 +13,7 @@ class CameraInput {
var identifier:Int = -1;
public var enabled = false;
public var pressed = false;
var added = false;
@ -35,8 +36,6 @@ class CameraInput {
this.collider.horizSizing = Width;
this.collider.vertSizing = Height;
var pressed = false;
var prevMouse = new Vector(0, 0);
interactive.onPush = (e) -> {
e.propagate = true;

View file

@ -34,7 +34,7 @@ class TouchEventState {
}
class TouchInput {
var cameraInput:CameraInput;
public var cameraInput:CameraInput;
public var movementInput:MovementInput;