mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-28 05:31:37 +00:00
change fov mode
This commit is contained in:
parent
34da65ea6d
commit
12b505fe7c
2 changed files with 10 additions and 5 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ControlsSettings = {
|
typedef ControlsSettings = {
|
||||||
|
|
@ -74,7 +74,7 @@ class Settings {
|
||||||
shadows: false,
|
shadows: false,
|
||||||
musicVolume: 1,
|
musicVolume: 1,
|
||||||
soundVolume: 0.7,
|
soundVolume: 0.7,
|
||||||
fov: 60,
|
fovX: 90,
|
||||||
vsync: #if js true #end
|
vsync: #if js true #end
|
||||||
#if hl
|
#if hl
|
||||||
false
|
false
|
||||||
|
|
@ -217,8 +217,8 @@ class Settings {
|
||||||
highScores.set(key, value);
|
highScores.set(key, value);
|
||||||
}
|
}
|
||||||
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;
|
||||||
|
|
@ -270,6 +270,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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue