mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-26 12:41:40 +00:00
change fov mode
This commit is contained in:
parent
4bd6aaec43
commit
2121bf000c
3 changed files with 12 additions and 7 deletions
|
|
@ -79,7 +79,7 @@ class CameraController extends Object {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
// level.scene.addEventListener(onEvent);
|
// level.scene.addEventListener(onEvent);
|
||||||
// Sdl.setRelativeMouseMode(true);
|
// Sdl.setRelativeMouseMode(true);
|
||||||
level.scene.camera.fovY = Settings.optionsSettings.fov;
|
level.scene.camera.setFovX(Settings.optionsSettings.fovX, Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
||||||
lockCursor();
|
lockCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ typedef OptionsSettings = {
|
||||||
var musicVolume:Float;
|
var musicVolume:Float;
|
||||||
var soundVolume:Float;
|
var soundVolume:Float;
|
||||||
var vsync:Bool;
|
var vsync:Bool;
|
||||||
var fov:Int;
|
var fovX:Int;
|
||||||
var frameRateVis:Bool;
|
var frameRateVis:Bool;
|
||||||
var oobInsults:Bool;
|
var oobInsults:Bool;
|
||||||
var reflectiveMarble:Bool;
|
var reflectiveMarble:Bool;
|
||||||
|
|
@ -95,7 +95,7 @@ class Settings {
|
||||||
shadows: false,
|
shadows: false,
|
||||||
musicVolume: 1,
|
musicVolume: 1,
|
||||||
soundVolume: 0.7,
|
soundVolume: 0.7,
|
||||||
fov: 60,
|
fovX: 90,
|
||||||
frameRateVis: true,
|
frameRateVis: true,
|
||||||
oobInsults: true,
|
oobInsults: true,
|
||||||
reflectiveMarble: true,
|
reflectiveMarble: true,
|
||||||
|
|
@ -300,8 +300,8 @@ class Settings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
optionsSettings = json.options;
|
optionsSettings = json.options;
|
||||||
if (optionsSettings.fov == 0 #if js || optionsSettings.fov == null #end)
|
if (optionsSettings.fovX == 0 #if js || optionsSettings.fovX == null #end)
|
||||||
optionsSettings.fov = 60;
|
optionsSettings.fovX = 90;
|
||||||
controlsSettings = json.controls;
|
controlsSettings = json.controls;
|
||||||
if (json.touch != null) {
|
if (json.touch != null) {
|
||||||
touchSettings = json.touch;
|
touchSettings = json.touch;
|
||||||
|
|
@ -385,6 +385,11 @@ class Settings {
|
||||||
|
|
||||||
MarbleGame.canvas.scene2d.scaleMode = Zoom(zoomRatio);
|
MarbleGame.canvas.scene2d.scaleMode = Zoom(zoomRatio);
|
||||||
|
|
||||||
|
if (MarbleGame.instance.world != null) {
|
||||||
|
MarbleGame.instance.world.scene.camera.setFovX(Settings.optionsSettings.fovX,
|
||||||
|
Settings.optionsSettings.screenWidth / Settings.optionsSettings.screenHeight);
|
||||||
|
}
|
||||||
|
|
||||||
MarbleGame.canvas.render(MarbleGame.canvas.scene2d);
|
MarbleGame.canvas.render(MarbleGame.canvas.scene2d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -288,8 +288,8 @@ class OptionsDlg extends GuiImage {
|
||||||
Settings.optionsSettings.soundVolume = val;
|
Settings.optionsSettings.soundVolume = val;
|
||||||
AudioManager.updateVolumes();
|
AudioManager.updateVolumes();
|
||||||
}, true);
|
}, true);
|
||||||
makeSlider("Field of View:", (Settings.optionsSettings.fov - 60) / (140 - 60), 298, generalPanel, (val) -> {
|
makeSlider("Field of View:", (Settings.optionsSettings.fovX - 60) / (140 - 60), 298, generalPanel, (val) -> {
|
||||||
Settings.optionsSettings.fov = cast(60 + val * (140 - 60));
|
Settings.optionsSettings.fovX = cast(60 + val * (140 - 60));
|
||||||
});
|
});
|
||||||
makeSlider("Mouse Speed:", (Settings.controlsSettings.cameraSensitivity - 0.2) / (3 - 0.2), 298, generalPanel, (val) -> {
|
makeSlider("Mouse Speed:", (Settings.controlsSettings.cameraSensitivity - 0.2) / (3 - 0.2), 298, generalPanel, (val) -> {
|
||||||
Settings.controlsSettings.cameraSensitivity = cast(0.2 + val * (3 - 0.2));
|
Settings.controlsSettings.cameraSensitivity = cast(0.2 + val * (3 - 0.2));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue