コード例 #1
0
ファイル: JoystickControl.cs プロジェクト: slagusev/Krea
        public override CoronaControl Clone(CoronaLayer layerDest, bool incrementName)
        {
            JoystickControl newControl = new JoystickControl(layerDest);

            newControl.isEnabled = this.isEnabled;
            if (incrementName == true)
            {
                int res = -1;
                if (int.TryParse(this.joystickName.Substring(this.joystickName.Length - 1), out res) == true)
                {
                    newControl.joystickName = joystickName.Substring(0, joystickName.Length - 1) + (res + 1).ToString();
                }
                else
                {
                    newControl.joystickName = this.joystickName + 1;
                }

                newControl.ControlName = this.ControlName;
            }
            else
            {
                newControl.joystickName = this.joystickName;
                newControl.ControlName  = this.ControlName;
            }

            newControl.ghost       = this.ghost;
            newControl.innerAlpha  = this.innerAlpha;
            newControl.outerAlpha  = this.outerAlpha;
            newControl.outerRadius = this.outerRadius;
            newControl.innerRadius = this.innerRadius;

            if (this.innerImage != null)
            {
                newControl.innerImage = new Bitmap(this.innerImage);
            }

            if (this.outerImage != null)
            {
                newControl.outerImage = new Bitmap(this.outerImage);
            }

            newControl.joystickLocation  = new Point(this.joystickLocation.X, this.joystickLocation.Y);
            newControl.joystickAlpha     = this.joystickAlpha;
            newControl.joystickFade      = this.joystickFade;
            newControl.joystickFadeDelay = this.joystickFadeDelay;

            return(newControl);
        }
コード例 #2
0
ファイル: GameElementTreeView.cs プロジェクト: nadar71/Krea
        private void joystickToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            if (this.LayerSelected != null)
            {
                if(this.LayerSelected.Controls == null)
                    this.LayerSelected.Controls = new List<CoronaControl>();

                JoystickControl joy = new JoystickControl(this.LayerSelected);
                this.LayerSelected.Controls.Add(joy);

                joy.joystickLocation = this.LayerSelected.SceneParent.Camera.SurfaceFocus.Location;
                this.newCoronaControl(joy);
                GorgonLibrary.Gorgon.Go();
            }
        }
コード例 #3
0
ファイル: JoystickControl.cs プロジェクト: nadar71/Krea
        public override CoronaControl Clone(CoronaLayer layerDest,bool incrementName)
        {
            JoystickControl newControl = new JoystickControl(layerDest);
            newControl.isEnabled = this.isEnabled;
            if(incrementName ==true)
            {
                int res = -1;
                if (int.TryParse(this.joystickName.Substring(this.joystickName.Length - 1), out res) == true)
                    newControl.joystickName = joystickName.Substring(0, joystickName.Length - 1) + (res + 1).ToString();
                else
                    newControl.joystickName = this.joystickName + 1;

                newControl.ControlName = this.ControlName;
            }
            else
            {
                newControl.joystickName = this.joystickName;
                newControl.ControlName = this.ControlName;
            }

            newControl.ghost = this.ghost;
            newControl.innerAlpha = this.innerAlpha;
            newControl.outerAlpha = this.outerAlpha;
            newControl.outerRadius = this.outerRadius;
            newControl.innerRadius = this.innerRadius;

            if(this.innerImage != null)
                 newControl.innerImage = new Bitmap(this.innerImage);

            if (this.outerImage != null)
                newControl.outerImage = new Bitmap(this.outerImage);

            newControl.joystickLocation = new Point(this.joystickLocation.X,this.joystickLocation.Y);
            newControl.joystickAlpha = this.joystickAlpha;
            newControl.joystickFade = this.joystickFade;
            newControl.joystickFadeDelay = this.joystickFadeDelay;

            return newControl;
        }
コード例 #4
0
 public JoystickPropertyConverter(JoystickControl joy, Form1 MainForm)
 {
     this.joy = joy;
     this.mainForm = MainForm;
 }