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); }
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(); } }
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; }
public JoystickPropertyConverter(JoystickControl joy, Form1 MainForm) { this.joy = joy; this.mainForm = MainForm; }