コード例 #1
0
ファイル: ChooseSongScene.cs プロジェクト: forki/turnt-ninja
 public ChooseSongScene(GUIComponentContainer guiComponents, PolarPolygon centerPolygon, Player player, ShaderProgram shaderProgram)
 {
     _guiComponents = guiComponents;
     _centerPolygon = centerPolygon;
     _player        = player;
     _shaderProgram = shaderProgram;
     Exclusive      = true;
 }
コード例 #2
0
        public override void Load()
        {
            SceneManager.GameWindow.Cursor = MouseCursor.Default;

            // Remap keypad enter to normal enter
            InputSystem.KeyRemappings.Add(Key.KeypadEnter, Key.Enter);

            _gameVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            // Choose correct version directive because OSX is dumb
            string version = "#version 130";

            if (PlatformDetection.RunningPlatform() == Platform.MacOSX)
            {
                version = "#version 150";
            }

            // Load shaders
            var vert = new Shader(Path.Combine(SceneManager.Directories["Shaders"].FullName, "simple.vs"), version);
            var frag = new Shader(Path.Combine(SceneManager.Directories["Shaders"].FullName, "simple.fs"), version);

            _shaderProgram = new ShaderProgram();
            _shaderProgram.Load(vert, frag);

            _player                      = new Player();
            _player.Position             = new PolarVector(1.5 * (Math.PI / 3) - _player.Length * 0.5f, _player.Position.Radius);
            _player.ShaderProgram        = _shaderProgram;
            _centerPolygon               = new PolarPolygon(Enumerable.Repeat(true, 6).ToList(), new PolarVector(0.5, 0), 50, 80, 0);
            _centerPolygon.ShaderProgram = _shaderProgram;

            _menuFont        = SceneManager.GameFontLibrary.GetFirstOrDefault("menuworld");
            _menuFontDrawing = new QFontDrawing();
            _menuFontDrawing.ProjectionMatrix = SceneManager.ScreenCamera.WorldModelViewProjection;
            _menuRenderOptions = new QFontRenderOptions {
                DropShadowActive = true, Colour = Color.White
            };

            _versionFont = SceneManager.GameFontLibrary.GetFirstOrDefault("versiontext");

            var guiRenderer = new Gwen.Renderer.OpenTK();
            var skin        = new TexturedBase(guiRenderer, Path.Combine(SceneManager.Directories["Images"].FullName, "DefaultSkin.png"));

            skin.DefaultFont = new Gwen.Font(guiRenderer, SceneManager.FontPath, 30);
            _GUIComponents   = new GUIComponentContainer(guiRenderer, skin);

            Loaded = true;
        }