Exemplo n.º 1
0
 private void OnMenuButtonDown(GUIButton sender, MouseEventArgs mea)
 {
     sender.BorderWidth = 2;
 }
Exemplo n.º 2
0
 private static void OnMenuButtonLeave(GUIButton sender, MouseEventArgs mea)
 {
     sender.BorderWidth = 1;
     sender.TextColor = new float4(0f, 0f, 0f, 1);
 }
Exemplo n.º 3
0
        private void OnDiffButtonDown(GUIButton sender, MouseEventArgs mea)
        {
            sender.BorderWidth = 2;

            var guiButton = sender.Tag as GUIButton;
            if (guiButton != null) guiButton.BorderWidth = 2;
        }
Exemplo n.º 4
0
 private void OnGUIButtonLeave(GUIButton sender, MouseEventArgs mea)
 {
     sender.TextColor = _color2;
 }
Exemplo n.º 5
0
 private void _guiFuseeLink_OnGUIButtonEnter(GUIButton sender, MouseEventArgs mea)
 {
     _guiFuseeLink.ButtonColor = new float4(0, 0.6f, 0.2f, 0.4f);
     _guiFuseeLink.BorderWidth = 1;
     SetCursor(CursorType.Hand);
 }
        private void OnButtonUp(object sender, MouseEventArgs mea)
        {
            if (OnGUIPanelUp == null)
                return;

            if (MouseOnPanel(mea))
                OnGUIPanelUp(this, mea);
        }
Exemplo n.º 7
0
        private void OnGUIButtonDown(GUIButton sender, MouseEventArgs mea)
        {
            sender.BorderWidth = 2;

            if (sender == _startPanelButtonStart)
            {
                _gw.SetGamestate((int)GameState.Running);
            }
        }
        private void OnMenuButtonDown(GUIButton sender, MouseEventArgs mea)
        {
            if (sender == _guiExampleOneButton)
            {
                //particelcount,minLife, maxLife,minSize, maxSize,transparency, randPosX,randPosY,randPosY,randVelX,randVelY,randVelZ,gravityX, gravityY, gravityZ,
                _smokeEmitter               = new ParticleEmitter(10000, 999999, 999999, 0.9f, 1.0f, 0.012f, 0.01f, 50.6f, 1.6f, 50.6f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
                //deactivate other emitter
                _fireYellowEmitter          = null;
                _fireRedEmitter             = null;
                _starEmitter                = null;

            }

            if (sender == _guiExampleTwoButton)
            {
                //particelcount,minLife, maxLife,minSize, maxSize, rotation, transparency, randPosX,randPosY,randPosY,randVelX,randVelY,randVelZ,gravityX, gravityY, gravityZ,
                _smokeEmitter               = new ParticleEmitter(600, 0, 200, 0.4f, 0.5f, 0.012f, 0.2f, 0.5f, 1.0f, 0.5f, 1.0f, 1.5f, 1.0f, 0.0f, -0.05f, 0.0f);
                _fireYellowEmitter          = new ParticleEmitter(150, 5, 200, 0.5f, 0.9f, 0.012f, 0.1f, 1.0f, 0.5f, 1.0f, 0.025f, 0.0f, 0.025f, 0.0f, -0.03f, 0.0f);
                _fireRedEmitter             = new ParticleEmitter(450, 0, 200, 0.3f, 0.6f, 0.012f, 0.4f, 0.5f, 0.1f, 0.5f, 0.4f, 1.5f, 0.4f, 0.0f, -0.03f, 0.0f);

                //deactivate other emitter
                _starEmitter                = null;
            }

            if (sender == _guiExampleThreeButton)
            {
                //particelcount,minLife, maxLife,minSize, maxSize,rotation,transparency, randPosX,randPosY,randPosY,randVelX,randVelY,randVelZ,gravityX, gravityY, gravityZ,
                _starEmitter                = new ParticleEmitter(200, 600, 600, 0.2f, 0.2f, 0.012f, 1.0f, 0.5f, 0.0f, 0.5f, 8.2f, 8.0f, 8.2f, 0.0f, 0.032f, 0.0f);
                //deactivate other emitter
                _smokeEmitter               = null;
                _fireYellowEmitter          = null;
                _fireRedEmitter             = null;
            }
        }
Exemplo n.º 9
0
 private void OnMenuButtonDown(GUIButton sender, MouseEventArgs mea)
 {
     sender.BorderWidth = 2;
     //sender.ButtonColor = colorHighlightedButton;
 }
Exemplo n.º 10
0
 private void MouseMove(object sender, MouseEventArgs mea)
 {
     if (OnMouseMove != null)
         OnMouseMove(this, mea);
 }
 private static void OnMenuButtonEnter(GUIButton sender, MouseEventArgs mea)
 {
     sender.TextColor = new float4(0.8f, 0.1f, 0.1f, 1);
 }
Exemplo n.º 12
0
        private void ButtonUp(object sender, MouseEventArgs mea)
        {
            if (OnMouseButtonUp != null)
                OnMouseButtonUp(this, mea);

            if (_buttonsPressed.Contains((int) mea.Button))
                _buttonsPressed.Remove((int) mea.Button);
        }
Exemplo n.º 13
0
        private void ButtonDown(object sender, MouseEventArgs mea)
        {
            if (OnMouseButtonDown != null)
                OnMouseButtonDown(this, mea);

            if (!_buttonsPressed.Contains((int) mea.Button))
                _buttonsPressed.Add((int) mea.Button);
        }
Exemplo n.º 14
0
 private void _guiFuseeLink_OnGUIButtonLeave(GUIButton sender, MouseEventArgs mea)
 {
     _guiFuseeLink.ButtonColor = new float4(0, 0, 0, 0);
     _guiFuseeLink.BorderWidth = 0;
     SetCursor(CursorType.Standard);
 }
Exemplo n.º 15
0
        private void OnMenuButtonUp(GUIButton sender, MouseEventArgs mea)
        {
            sender.BorderWidth = 1;

            var bWidth = (sender == _guiSolveButton) ? 2 : 0;

            foreach (var guiButton in _guiUDiffs)
                guiButton.BorderWidth = bWidth;
            foreach (var guiButton in _guiBDiffs)
                guiButton.BorderWidth = bWidth;
        }
Exemplo n.º 16
0
        private void OnMenuButtonUp(GUIButton sender, MouseEventArgs mea)
        {
            sender.BorderWidth = 1;
            if (!IsButtonSelected(sender))
            {
                sender.ButtonColor = ColorHighlightedButton;
            }

            switch (sender.Text)
            {
                case "Diffuse Color":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    _currentShader = _shaderDiffuseColor;
                    _paramColor = _currentShader.GetShaderParam("color");
                    break;

                case "Texture Only":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    _currentShader = _shaderTexture;
                    _paramTexture = _currentShader.GetShaderParam("texture1");
                    break;

                case "Diffuse Texture":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    _currentShader = _shaderDiffuseTexture;
                    _paramTexture = _currentShader.GetShaderParam("texture1");
                    break;

                case "Diffuse Bump Texture":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    _currentShader = _shaderDiffuseBumpTexture;
                    _paramTexture = _currentShader.GetShaderParam("texture1");
                    _paramBumpTexture = _currentShader.GetShaderParam("normalTex");
                    _paramSpecular = _currentShader.GetShaderParam("specularLevel");
                    _paramShininess = _currentShader.GetShaderParam("shininess");
                    break;

                case "Specular Texture":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    _currentShader = _shaderSpecularTexture;
                    _paramTexture = _currentShader.GetShaderParam("texture1");
                    _paramSpecular = _currentShader.GetShaderParam("specularLevel");
                    _paramShininess = _currentShader.GetShaderParam("shininess");
                    break;

                case "Toon":
                    _textShaderName = sender.Text;
                    DeselectOtherButtonsFromPanel(_panelSelectShader, sender);
                    break;

                case "Cube":
                    DeselectOtherButtonsFromPanel(_panelSelectMesh, sender);
                    SetMesh(_meshCube);
                    _currentTexture = _texCube;
                    _currentBumpTexture = _texBumpCube;
                    break;

                case "Sphere":
                    DeselectOtherButtonsFromPanel(_panelSelectMesh, sender);
                    SetMesh(_meshSphere);
                    _currentTexture = _texSphere;
                    _currentBumpTexture = _texBumpSphere;
                    break;

                case "Teapot":
                    DeselectOtherButtonsFromPanel(_panelSelectMesh, sender);
                    SetMesh(_meshTeapot);
                    _currentTexture = _texTeapot;
                    _currentBumpTexture = _texBumpTeapot;
                    break;

                case "Directional Light":
                    DeselectOtherButtonsFromPanel(_panelLightSettings, sender);
                    RC.SetLightActive(0, 1);
                    break;

                case "Point Light":
                    DeselectOtherButtonsFromPanel(_panelLightSettings, sender);
                    RC.SetLightActive(0, 2);
                    break;

                case "Spot Light":
                    DeselectOtherButtonsFromPanel(_panelLightSettings, sender);
                    RC.SetLightActive(0, 3);
                    break;
            }
        }
Exemplo n.º 17
0
        private bool MouseOnPanel(MouseEventArgs mea)
        {
            var x = mea.Position.x;
            var y = mea.Position.y;

            return x >= PosX + OffsetX &&
                   x <= PosX + OffsetX + Width &&
                   y >= PosY + OffsetY &&
                   y <= PosY + OffsetY + Height;
        }
Exemplo n.º 18
0
        private void OnButtonDown(object sender, MouseEventArgs mea)
        {
            if (OnGUIButtonDown == null)
                return;

            if (MouseOnButton(mea))
                OnGUIButtonDown(this, mea);
        }
Exemplo n.º 19
0
        private void OnMouseMove(object sender, MouseEventArgs mea)
        {
            if (MouseOnPanel(mea))
            {
                if (_mouseOnPanel) return;
                _mouseOnPanel = true;

                if (OnGUIPanelEnter == null) return;
                OnGUIPanelEnter(this, mea);
            }
            else
            {
                if (!_mouseOnPanel) return;
                _mouseOnPanel = false;

                if (OnGUIPanelLeave == null) return;
                OnGUIPanelLeave(this, mea);
            }
        }
Exemplo n.º 20
0
        private void OnMouseMove(object sender, MouseEventArgs mea)
        {
            if (MouseOnButton(mea))
            {
                if (_mouseOnButton) return;
                _mouseOnButton = true;

                if (OnGUIButtonEnter == null) return;
                OnGUIButtonEnter(this, mea);
            }
            else
            {
                if (!_mouseOnButton) return;
                _mouseOnButton = false;

                if (OnGUIButtonLeave == null) return;
                OnGUIButtonLeave(this, mea);
            }
        }
Exemplo n.º 21
0
 private void OnGUIButtonEnter(GUIButton sender, MouseEventArgs mea)
 {
     sender.TextColor = _color1;
 }
Exemplo n.º 22
0
        private static void OnMenuButtonEnter(GUIButton sender, MouseEventArgs mea)
        {
            if (Input.Instance.IsButton(MouseButtons.Left))
                sender.BorderWidth = 2;

            sender.TextColor = new float4(0.8f, 0.1f, 0.1f, 1);
        }
Exemplo n.º 23
0
 private void OnGUIButtonUp(GUIButton sender, MouseEventArgs mea)
 {
     sender.BorderWidth = 1;
 }
Exemplo n.º 24
0
 void _guiFuseeLink_OnGUIButtonDown(GUIButton sender, MouseEventArgs mea)
 {
     OpenLink("http://fusee3d.org");
 }