protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitializeOpenGL();

            if (_level != null)
            {
                LoadLevel();
            }
            LoadDebugMeshes();

            gwenRenderer = new Gwen.Renderer.OpenTK();
            gwenSkin     = new Gwen.Skin.TexturedBase(gwenRenderer, "GwenSkin.png");
            gwenCanvas   = new Gwen.Control.Canvas(gwenSkin);
            gwenInput    = new Gwen.Input.OpenTK(this);

            gwenInput.Initialize(gwenCanvas);
            gwenCanvas.SetSize(Width, Height);
            gwenCanvas.ShouldDrawBackground = false;

            gwenProjection = Matrix4.CreateOrthographicOffCenter(0, Width, Height, 0, -1, 1);

            InitializeUI();
            if (true && _level == null && clientData == null)
            {
                LoadClient(@"C:\Dark Age of Camelot_Latest");
                //_levelId = 221;
                _levelId = 79;
            }
        }
Beispiel #2
0
        static MainCanvas()
        {
            GraphicsManager.keyboard.KeyDown += Keyboard_KeyDown;
            GraphicsManager.keyboard.KeyUp += Keyboard_KeyUp;

            GraphicsManager.mouse.ButtonDown += Mouse_ButtonDown;
            GraphicsManager.mouse.ButtonUp += Mouse_ButtonUp;
            GraphicsManager.mouse.Move += Mouse_Move;
            GraphicsManager.mouse.WheelChanged += Mouse_Wheel;

            Camera.OnRender += OnRenderFrame;
            Camera.Layer = 10;
            GraphicsManager.Update += OnUpdateFrame;
            GraphicsManager.OnWindowResize += new GraphicsManager.Resizer(OnWindowResize);

            GraphicsManager.OnDispose += new GraphicsManager.Disposer(Dispose);

            renderer = new Gwen.Renderer.OpenTK();
            skin = new Gwen.Skin.TexturedBase(renderer, @"media\DefaultSkin.png");
            //skin = new Gwen.Skin.Simple(renderer);
            //skin.DefaultFont = new Gwen.Font(renderer, "Courier", 10);
            canvas = new Canvas(skin);

            input = new Gwen.Input.OpenTK(GraphicsManager.Instance);
            input.Initialize(canvas);

            canvas.SetSize(GraphicsManager.WindowWidth, GraphicsManager.WindowHeight);
            canvas.ShouldDrawBackground = false;
            canvas.BackgroundColor = System.Drawing.Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;
        }
Beispiel #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitializeOpenGL();

            LoadLevel();
            LoadDebugMeshes();

            gwenRenderer = new Gwen.Renderer.OpenTK();
            gwenSkin     = new Gwen.Skin.TexturedBase(gwenRenderer, "GwenSkin.png");
            gwenCanvas   = new Gwen.Control.Canvas(gwenSkin);
            gwenInput    = new Gwen.Input.OpenTK(this);

            gwenInput.Initialize(gwenCanvas);
            gwenCanvas.SetSize(Width, Height);
            gwenCanvas.ShouldDrawBackground = false;

            gwenProjection = Matrix4.CreateOrthographicOffCenter(0, Width, Height, 0, -1, 1);

            InitializeUI();

            //Pre-JIT compile both SharpNav and this project for faster first-time runs.
            Assembly sharpNavAssebmly = Assembly.Load(Assembly.GetExecutingAssembly().GetReferencedAssemblies().First(n => n.Name == "SharpNav"));

            PreJITMethods(sharpNavAssebmly);
            PreJITMethods(Assembly.GetExecutingAssembly());
        }
Beispiel #4
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(Color.MidnightBlue);

            renderer = new Gwen.Renderer.OpenTK();
            skin     = new Gwen.Skin.TexturedBase(renderer, "/Users/abo781/Downloads/win_samples_2/OpenTK/gwen.png");
            //skin = new Gwen.Skin.Simple(renderer);
            //skin.DefaultFont = new Font(renderer, "Courier", 10);
            canvas = new Canvas(skin);

            input = new Gwen.Input.OpenTK(this);
            //input = new Gwen.Input.OpenTK();
            input.Initialize(canvas);

            canvas.SetSize(Width, Height);
            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor      = Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;

            //test = new UnitTest.UnitTest(canvas);

            stopwatch.Restart();
            lastTime = 0;

            scene.Init();
        }
Beispiel #5
0
        static MainCanvas()
        {
            Camera  = new Camera2D();
            GraphicsManager.keyboard.KeyDown += Keyboard_KeyDown;
            GraphicsManager.keyboard.KeyUp += Keyboard_KeyUp;

            GraphicsManager.mouse.ButtonDown += Mouse_ButtonDown;
            GraphicsManager.mouse.ButtonUp += Mouse_ButtonUp;
            GraphicsManager.mouse.Move += Mouse_Move;
            GraphicsManager.mouse.WheelChanged += Mouse_Wheel;

            Camera.OnRender += new GraphicsManager.Renderer(OnRenderFrame);
            Camera.Layer = 10;
            GraphicsManager.Update += new GraphicsManager.Updater(OnUpdateFrame);
            GraphicsManager.OnWindowResize += new GraphicsManager.Resizer(OnWindowResize);

            GraphicsManager.OnDispose += new GraphicsManager.Disposer(Dispose);

            Renderer = new Gwen.Renderer.OpenTK();
            Skin = new Gwen.Skin.TexturedBase(Renderer, @"Data\DefaultSkin.png");
            canvas = new Canvas(Skin);

            input = new Gwen.Input.OpenTK(GraphicsManager.Instance);
            input.Initialize(canvas);

            canvas.SetSize(GraphicsManager.WindowWidth, GraphicsManager.WindowHeight);
            canvas.ShouldDrawBackground = false;
            canvas.BackgroundColor = System.Drawing.Color.FromArgb(255, 150, 170, 170);
        }
Beispiel #6
0
        static MainCanvas()
        {
            Camera = new Camera2D();
            GraphicsManager.keyboard.KeyDown += Keyboard_KeyDown;
            GraphicsManager.keyboard.KeyUp   += Keyboard_KeyUp;

            GraphicsManager.mouse.ButtonDown   += Mouse_ButtonDown;
            GraphicsManager.mouse.ButtonUp     += Mouse_ButtonUp;
            GraphicsManager.mouse.Move         += Mouse_Move;
            GraphicsManager.mouse.WheelChanged += Mouse_Wheel;

            Camera.OnRender                += new GraphicsManager.Renderer(OnRenderFrame);
            Camera.Layer                    = 10;
            GraphicsManager.Update         += new GraphicsManager.Updater(OnUpdateFrame);
            GraphicsManager.OnWindowResize += new GraphicsManager.Resizer(OnWindowResize);

            GraphicsManager.OnDispose += new GraphicsManager.Disposer(Dispose);

            Renderer = new Gwen.Renderer.OpenTK();
            Skin     = new Gwen.Skin.TexturedBase(Renderer, @"Data\DefaultSkin.png");
            canvas   = new Canvas(Skin);

            input = new Gwen.Input.OpenTK(GraphicsManager.Instance);
            input.Initialize(canvas);

            canvas.SetSize(GraphicsManager.WindowWidth, GraphicsManager.WindowHeight);
            canvas.ShouldDrawBackground = false;
            canvas.BackgroundColor      = System.Drawing.Color.FromArgb(255, 150, 170, 170);
        }
Beispiel #7
0
        static MainCanvas()
        {
            GraphicsManager.keyboard.KeyDown += Keyboard_KeyDown;
            GraphicsManager.keyboard.KeyUp   += Keyboard_KeyUp;

            GraphicsManager.mouse.ButtonDown   += Mouse_ButtonDown;
            GraphicsManager.mouse.ButtonUp     += Mouse_ButtonUp;
            GraphicsManager.mouse.Move         += Mouse_Move;
            GraphicsManager.mouse.WheelChanged += Mouse_Wheel;

            Camera.OnRender                += OnRenderFrame;
            Camera.Layer                    = 10;
            GraphicsManager.Update         += OnUpdateFrame;
            GraphicsManager.OnWindowResize += new GraphicsManager.Resizer(OnWindowResize);

            GraphicsManager.OnDispose += new GraphicsManager.Disposer(Dispose);

            renderer = new Gwen.Renderer.OpenTK();
            skin     = new Gwen.Skin.TexturedBase(renderer, @"media\DefaultSkin.png");
            //skin = new Gwen.Skin.Simple(renderer);
            //skin.DefaultFont = new Gwen.Font(renderer, "Courier", 10);
            canvas = new Canvas(skin);

            input = new Gwen.Input.OpenTK(GraphicsManager.Instance);
            input.Initialize(canvas);

            canvas.SetSize(GraphicsManager.WindowWidth, GraphicsManager.WindowHeight);
            canvas.ShouldDrawBackground = false;
            canvas.BackgroundColor      = System.Drawing.Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;
        }
        protected override void OnLoad(EventArgs e)
        {
            Shaders.Load();
            MSAABuffer = new MsaaFbo();
            var renderer = new Gwen.Renderer.OpenTK();

            var skinpng = new Texture(renderer);

            Gwen.Renderer.OpenTK.LoadTextureInternal(
                skinpng,
                GameResources.DefaultSkin);

            var fontpng = new Texture(renderer);

            Gwen.Renderer.OpenTK.LoadTextureInternal(
                fontpng,
                GameResources.gamefont_15_png);

            var gamefont_15 = new Gwen.Renderer.BitmapFont(
                renderer,
                GameResources.gamefont_15_fnt,
                fontpng);

            var skin = new Gwen.Skin.TexturedBase(renderer,
                                                  skinpng,
                                                  GameResources.DefaultColors
                                                  )
            {
                DefaultFont = gamefont_15
            };

            Canvas = new GameCanvas(skin,
                                    this,
                                    renderer);

            _input = new Gwen.Input.OpenTK(this);
            _input.Initialize(Canvas);
            Canvas.ShouldDrawBackground = false;
            InitControls();
            Models.LoadModels();

            AddCursor("pencil", GameResources.cursor_pencil, 6, 25);
            AddCursor("line", GameResources.cursor_line, 11, 11);
            AddCursor("eraser", GameResources.cursor_eraser, 8, 8);
            AddCursor("hand", GameResources.cursor_move, 16, 16);
            AddCursor("closed_hand", GameResources.cursor_dragging, 16, 16);
            AddCursor("adjustline", GameResources.cursor_select, 4, 4);
            AddCursor("size_nesw", GameResources.cursor_size_nesw, 16, 16);
            AddCursor("size_nwse", GameResources.cursor_size_nwse, 16, 16);
            AddCursor("size_hor", GameResources.cursor_size_horz, 16, 16);
            AddCursor("size_ver", GameResources.cursor_size_vert, 16, 16);
            AddCursor("size_all", GameResources.cursor_size_all, 16, 16);
            AddCursor("default", GameResources.cursor_default, 7, 4);
            AddCursor("zoom", GameResources.cursor_zoom_in, 11, 10);
            Gwen.Platform.Neutral.CursorSetter = new UI.CursorImpl(this);
            Program.UpdateCheck();
            Track.AutoLoadPrevious();
        }
Beispiel #9
0
        protected override void OnLoad(EventArgs e)
        {
            MSAABuffer = new MsaaFbo();
            Canvas     = GameCanvas.CreateCanvas(this);
            _input     = new Gwen.Input.OpenTK(this);
            _input.Initialize(Canvas);
            Canvas.ShouldDrawBackground = false;
            InitControls();
            Models.LoadModels();

            AddCursor("pencil", GameResources.pencil_icon, 3, 28);
            AddCursor("line", GameResources.line_cursor, 5, 5);
            AddCursor("eraser", GameResources.eraser_cursor, 5, 5);
            AddCursor("hand", GameResources.move_icon, 16, 16);
            AddCursor("closed_hand", GameResources.closed_move_icon, 16, 16);
            AddCursor("adjustline", GameResources.cursor_adjustline, 0, 0);
            Canvas.UpdateSaveNodes();
        }
Beispiel #10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitializeOpenGL();

            LoadLevel();
            LoadDebugMeshes();

            gwenRenderer = new Gwen.Renderer.OpenTK();
            gwenSkin     = new Gwen.Skin.TexturedBase(gwenRenderer, "GwenSkin.png");
            gwenCanvas   = new Gwen.Control.Canvas(gwenSkin);
            gwenInput    = new Gwen.Input.OpenTK(this);

            gwenInput.Initialize(gwenCanvas);
            gwenCanvas.SetSize(Width, Height);
            gwenCanvas.ShouldDrawBackground = false;

            gwenProjection = Matrix4.CreateOrthographicOffCenter(0, Width, Height, 0, -1, 1);

            InitializeUI();
        }
Beispiel #11
0
        public bool Initialize(int Rows, int Columns)
        {
            this.Rows    = Rows;
            this.Columns = Columns;

            RenderHandler = new Gwen.Renderer.OpenTK();

#if DEBUG
            BaseSkin = new Gwen.Skin.TexturedBase(RenderHandler, @"../../../Assets/DefaultSkin.png");
#else
            BaseSkin = new Gwen.Skin.TexturedBase(RenderHandler, @"Assets/DefaultSkin.png");
#endif
            BaseSkin.DefaultFont = new Gwen.Font(RenderHandler, "Arial", 10);

            BaseCanvas = new Gwen.Control.Canvas(BaseSkin);
            BaseCanvas.SetSize(Width, Height);
            BaseCanvas.ShouldDrawBackground = true;
            BaseCanvas.BackgroundColor      = Color.White;

            InputHandler = new Gwen.Input.OpenTK(this);
            InputHandler.Initialize(BaseCanvas);

            // Setup Generic Window Callbacks
            Keyboard.KeyDown   += Keyboard_KeyDown;
            Keyboard.KeyUp     += Keyboard_KeyUp;
            Mouse.ButtonDown   += Mouse_ButtonDown;
            Mouse.ButtonUp     += Mouse_ButtonUp;
            Mouse.Move         += Mouse_Move;
            Mouse.WheelChanged += Mouse_Wheel;

            SetupMenu();
            SetupNetworkedSessionMenu();
            SetupHighscores();
            SetupUsernameMenu();

            Ready = true;

            return(true);
        }
		/// <summary>
		/// Setup OpenGL and load resources here.
		/// </summary>
		/// <param name="e">Not used.</param>
		protected override void OnLoad(EventArgs e)
		{
			GL.ClearColor(Color.MidnightBlue);

			renderer = new Gwen.Renderer.OpenTK();
			skin = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");

			skin.DefaultFont = new Font(renderer, "Arial", 10);
			canvas = new Canvas(skin);

			input = new Input.OpenTK(this);
			input.Initialize(canvas);

			canvas.SetSize (1024, 768);
			canvas.ShouldDrawBackground = true;
			canvas.BackgroundColor = Color.FromArgb(255, 150, 170, 170);
			//canvas.KeyboardInputEnabled = true;

			test = new UnitTest.UnitTest(canvas);

			stopwatch.Restart();
			lastTime = 0;
		}
Beispiel #13
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(Color.MidnightBlue);

            renderer = new Gwen.Renderer.OpenTK();
            skin = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");
            //skin = new Gwen.Skin.Simple(renderer);
            //skin.DefaultFont = new Font(renderer, "Courier", 10);
            canvas = new Canvas(skin);

            input = new Gwen.Input.OpenTK(this);
            input.Initialize(canvas);

            canvas.SetSize(Width, Height);
            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor = Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;

            var d = new DesignerBase(canvas);

            stopwatch.Restart();
            lastTime = 0;
        }
Beispiel #14
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(Color.MidnightBlue);

            renderer = new Gwen.Renderer.OpenTK();
            skin     = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");
            //skin = new Gwen.Skin.Simple(renderer);
            //skin.DefaultFont = new Font(renderer, "Courier", 10);
            canvas = new Canvas(skin);

            input = new Gwen.Input.OpenTK(this);
            input.Initialize(canvas);

            canvas.SetSize(Width, Height);
            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor      = Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;

            var d = new DesignerBase(canvas);

            stopwatch.Restart();
            lastTime = 0;
        }
Beispiel #15
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            input = new Gwen.Input.OpenTK(this);
            var renderer = new Gwen.Renderer.OpenTK();
            var skinimg  = new Bitmap(Image.FromFile("DefaultSkin.png"));
            // var font = new Bitmap(Image.FromFile("liberation_20_0.png"));
            // var fontdata = System.IO.File.ReadAllText("liberation_20.fnt");
            var font     = new Bitmap(Image.FromFile("gamefont_15_0.png"));
            var fontdata = System.IO.File.ReadAllText("gamefont_15.fnt");
            var colorxml = System.IO.File.ReadAllText("DefaultColors.xml");

            skinpng = renderer.CreateTexture(skinimg);

            var fontpng = renderer.CreateTexture(font);

            var gamefont_15 = new Gwen.Renderer.BitmapFont(
                renderer,
                fontdata,
                fontpng);

            var skin = new Gwen.Skin.TexturedBase(renderer, skinpng, colorxml)
            {
                DefaultFont = gamefont_15
            };

            // var skin = new Gwen.Skin.Simple(renderer) { DefaultFont = gamefont_15 };
            Canvas = new Canvas(skin);
            // Canvas.Scale = 2;
            Canvas.SetCanvasSize(ClientSize.Width, ClientSize.Height);
            input.Initialize(Canvas);
            TestContainer container = new TestContainer(Canvas);

            font.Dispose();
            skinimg.Dispose();
            ControlBase.LogLayout = true;
        }
Beispiel #16
0
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(Color.MidnightBlue);

            renderer = new Gwen.Renderer.OpenTK();
            skin     = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");

            skin.DefaultFont = new Font(renderer, "Arial", 10);
            canvas           = new Canvas(skin);

            input = new Input.OpenTK(this);
            input.Initialize(canvas);

            canvas.SetSize(Width, Height);
            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor      = Color.FromArgb(255, 150, 170, 170);
            ////canvas.KeyboardInputEnabled = true;

            //Control.TreeControl ctrl = new Control.TreeControl(canvas);

            //ctrl.AddNode("Node One");
            //ctrl.AddNode("Node Two").AddNode("Node Two Inside");
            //ctrl.SetBounds(20, 20, 400, 400);

            test = new UnitTest.UnitTest(canvas);

            //var button = new Button(canvas);
            //button.Font = new Font(renderer, "Times New Roman", 30);
            //button.AutoSizeToContents = false;
            //button.Text = "Hello I am a\n test button!";
            //button.SetPosition(500, 500);
            //button.SetSize(200, 30);

            stopwatch.Restart();
            lastTime = 0;
        }
Beispiel #17
0
        public void OnLoad(EventArgs e)
        {
            Renderer = new Gwen.Renderer.OpenTK();
            _skin    = new Gwen.Skin.TexturedBase(Renderer, "Content/DefaultSkin.png");
            Canvas   = new Gwen.Control.Canvas(_skin);

            _input = new Gwen.Input.OpenTK(Program.Game);
            _input.Initialize(Canvas);

            Canvas.SetSize((int)Program.Game.windowSize.X, (int)Program.Game.windowSize.Y);
            Canvas.ShouldDrawBackground = false;
            Canvas.BackgroundColor      = Color.FromArgb(255, 150, 170, 170);

            SetupInputEvents();

            _sideMenuBox = new Gwen.Control.GroupBox(_canvas);
            _sideMenuBox.SetSize(80, 128);
            _sideMenuBox.Position(Gwen.Pos.Center);
            _sideMenuBox.Position(Gwen.Pos.Right, 5);

            LoadElementCatagories();

            // Current element text
            _currentElementLabel = new Gwen.Control.Label(_canvas);
            _currentElementLabel.SetPosition(10, 10);
            _currentElementLabel.SetSize(100, 40);
            _currentElementLabel.SetText("");

            // Bottom menu
            _bottomMenuBox = new Gwen.Control.GroupBox(_canvas);
            _bottomMenuBox.SetSize(800, 36);

            _bottomMenuBox.Position(Gwen.Pos.Center);
            _bottomMenuBox.Position(Gwen.Pos.Bottom);
            _bottomMenuBox.ShouldDrawBackground = true;
        }
        /// <summary>
        /// Setup OpenGL and load resources here.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(Color.MidnightBlue);

            renderer = new Gwen.Renderer.OpenTK();
            skin = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");

            skin.DefaultFont = new Font(renderer, "Arial", 10);
            canvas = new Canvas(skin);

            input = new Input.OpenTK(this);
            input.Initialize(canvas);

            canvas.SetSize (1024, 768);
            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor = Color.FromArgb(255, 150, 170, 170);
            //canvas.KeyboardInputEnabled = true;

            test = new UnitTest.UnitTest(canvas);

            stopwatch.Restart();
            lastTime = 0;
        }
        protected override void OnLoad(EventArgs e)
        {
            Shaders.Load();
            MSAABuffer = new MsaaFbo();
            var renderer = new Gwen.Renderer.OpenTK();

            var skinpng = renderer.CreateTexture(GameResources.DefaultSkin);

            var fontpng     = renderer.CreateTexture(GameResources.liberation_sans_15_png);
            var fontpngbold = renderer.CreateTexture(GameResources.liberation_sans_15_bold_png);

            var gamefont_15 = new Gwen.Renderer.BitmapFont(
                renderer,
                GameResources.liberation_sans_15_fnt,
                fontpng);


            var gamefont_15_bold = new Gwen.Renderer.BitmapFont(
                renderer,
                GameResources.liberation_sans_15_bold_fnt,
                fontpngbold);

            var skin = new Gwen.Skin.TexturedBase(renderer,
                                                  skinpng,
                                                  GameResources.DefaultColors
                                                  )
            {
                DefaultFont = gamefont_15
            };

            Fonts f = new Fonts(gamefont_15, gamefont_15_bold);

            Canvas = new GameCanvas(skin,
                                    this,
                                    renderer,
                                    f);

            _input = new Gwen.Input.OpenTK(this);
            _input.Initialize(Canvas);
            Canvas.ShouldDrawBackground = false;
            Models.LoadModels();

            AddCursor("pencil", GameResources.cursor_pencil, 6, 25);
            AddCursor("line", GameResources.cursor_line, 11, 11);
            AddCursor("eraser", GameResources.cursor_eraser, 8, 8);
            AddCursor("hand", GameResources.cursor_move, 16, 16);
            AddCursor("hand_point", GameResources.cursor_hand, 14, 8);
            AddCursor("closed_hand", GameResources.cursor_dragging, 16, 16);
            AddCursor("adjustline", GameResources.cursor_select, 4, 4);
            AddCursor("size_nesw", GameResources.cursor_size_nesw, 16, 16);
            AddCursor("size_nwse", GameResources.cursor_size_nwse, 16, 16);
            AddCursor("size_hor", GameResources.cursor_size_horz, 16, 16);
            AddCursor("size_ver", GameResources.cursor_size_vert, 16, 16);
            AddCursor("size_all", GameResources.cursor_size_all, 16, 16);
            AddCursor("default", GameResources.cursor_default, 7, 4);
            AddCursor("zoom", GameResources.cursor_zoom_in, 11, 10);
            AddCursor("ibeam", GameResources.cursor_ibeam, 11, 11);
            Program.UpdateCheck();
            Track.AutoLoadPrevious();
            linerider.Tools.CurrentTools.Init();
        }
Beispiel #20
0
        private void setupUi()
        {
            renderer = new Gwen.Renderer.OpenTK();
            Gwen.Skin.Base skin = new Gwen.Skin.TexturedBase(renderer, "DefaultSkin.png");
            canvas = new Canvas(skin);
            canvas.SetSize(Width, Height);

            gwenInput = new Gwen.Input.OpenTK(this);
            gwenInput.Initialize(canvas);

            Mouse.ButtonDown += Mouse_ButtonDown;
            Mouse.ButtonUp += Mouse_ButtonUp;
            Mouse.Move += Mouse_Move;
            Mouse.WheelChanged += Mouse_Wheel;

            canvas.ShouldDrawBackground = true;
            canvas.BackgroundColor = System.Drawing.Color.FromArgb(122, 150, 170, 170);

            // controls
            radioCamera = new RadioButtonGroup(canvas);
            radioCamera.AutoSizeToContents = true;
            radioCamera.SetText("Тип камеры");
            radioCamera.AddOption("Свободная", "free");
            radioCamera.AddOption("Привязанная", "bound");
            radioCamera.SetSelection(0);
            radioCamera.SelectionChanged += radioCamera_SelectionChanged;

            // coord
            GroupBox posGroup = new GroupBox(canvas);
            posGroup.SetText("Позиция камеры");
            posGroup.SizeToChildren();
            posGroup.SetSize(150, 120);
            Gwen.Align.PlaceDownLeft(posGroup, radioCamera, 45);

            labelPosX = new Label(posGroup);
            labelPosY = new Label(posGroup);
            labelPosZ = new Label(posGroup);
            labelPosX.SetText("X: 0.0");
            labelPosY.SetText("Y: 1.0");
            labelPosZ.SetText("Z: 2.0");
            Gwen.Align.PlaceDownLeft(labelPosY, labelPosX, 5);
            Gwen.Align.PlaceDownLeft(labelPosZ, labelPosY, 5);

            // reset button
            Button resetCameraButton = new Gwen.Control.Button(posGroup);
            resetCameraButton.SetText("Сбросить позицию\nкамеры");
            resetCameraButton.Clicked += cameraReset_Clicked;
            resetCameraButton.SizeToContents();
            Gwen.Align.PlaceDownLeft(resetCameraButton, labelPosZ, 5);

            labelSpeed = new Label(canvas);
            Gwen.Align.PlaceDownLeft(labelSpeed, posGroup, 5);

            labelTips = new Label(canvas);
            labelTips.SetText(freeCameraTip + "\n\n" + nodeTransformTip);
            labelTips.SizeToContents();
            Gwen.Align.PlaceDownLeft(labelTips, labelSpeed, 15);

            statusBar = new Gwen.Control.StatusBar(canvas);
            statusBar.Dock = Gwen.Pos.Bottom;
        }
Beispiel #21
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitializeOpenGL();

            LoadLevel();
            LoadDebugMeshes();

            gwenRenderer = new Gwen.Renderer.OpenTK();
            gwenSkin = new Gwen.Skin.TexturedBase(gwenRenderer, "GwenSkin.png");
            gwenCanvas = new Gwen.Control.Canvas(gwenSkin);
            gwenInput = new Gwen.Input.OpenTK(this);

            gwenInput.Initialize(gwenCanvas);
            gwenCanvas.SetSize(Width, Height);
            gwenCanvas.ShouldDrawBackground = false;

            gwenProjection = Matrix4.CreateOrthographicOffCenter(0, Width, Height, 0, -1, 1);

            InitializeUI();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitializeOpenGL();

            if (_level != null) LoadLevel();
            LoadDebugMeshes();

            gwenRenderer = new Gwen.Renderer.OpenTK();
            gwenSkin = new Gwen.Skin.TexturedBase(gwenRenderer, "GwenSkin.png");
            gwenCanvas = new Gwen.Control.Canvas(gwenSkin);
            gwenInput = new Gwen.Input.OpenTK(this);

            gwenInput.Initialize(gwenCanvas);
            gwenCanvas.SetSize(Width, Height);
            gwenCanvas.ShouldDrawBackground = false;

            gwenProjection = Matrix4.CreateOrthographicOffCenter(0, Width, Height, 0, -1, 1);

            InitializeUI();
            if (true && _level == null && clientData == null)
            {
                LoadClient(@"C:\Dark Age of Camelot_Latest");
                //_levelId = 221;
                _levelId = 79;
            }
        }