private void hexTextBox_Validated(object sender, EventArgs e) { OrisonColor col = color; OrisonParse.Parse(ref col, hexTextBox); Color = col; }
public ColorChooser() { InitializeComponent(); color = new OrisonColor(255, 255, 255); hexTextBox.Text = color.ToString(); colorButton.BackColor = color; }
static public void Parse(ref OrisonColor to, TextBox box) { try { to = new OrisonColor(box.Text); } catch { box.Text = to.ToString(); } }
private void colorButton_Click(object sender, EventArgs e) { //Show the dialog ColorDialog dialog = new ColorDialog(); dialog.Color = color; dialog.AllowFullOpen = true; //Handle cancel if (dialog.ShowDialog() == DialogResult.Cancel) { return; } //Get the new color Color = (OrisonColor)dialog.Color; }
public Project() { //Default project properties Name = Orison.NEW_PROJECT_NAME; BackgroundColor = OrisonColor.DefaultBackgroundColor; GridColor = OrisonColor.DefaultGridColor; Filename = ""; LevelDefaultSize = LevelMinimumSize = LevelMaximumSize = new Size(640, 480); CameraEnabled = false; CameraSize = new Size(640, 480); ExportCameraPosition = false; //Definitions LevelValueDefinitions = new List <ValueDefinition>(); LayerDefinitions = new List <LayerDefinition>(); Tilesets = new List <Tileset>(); EntityDefinitions = new List <EntityDefinition>(); }
public void CloneFrom(Project copy) { //Default project properties OrisonVersion = copy.OrisonVersion; Name = copy.Name; BackgroundColor = copy.BackgroundColor; GridColor = copy.GridColor; Filename = copy.Filename; LevelDefaultSize = copy.LevelDefaultSize; LevelMinimumSize = copy.LevelMinimumSize; LevelMaximumSize = copy.LevelMaximumSize; AngleMode = copy.AngleMode; CameraEnabled = copy.CameraEnabled; CameraSize = copy.CameraSize; ExportCameraPosition = copy.ExportCameraPosition; //Definitions LevelValueDefinitions = new List <ValueDefinition>(); foreach (var d in copy.LevelValueDefinitions) { LevelValueDefinitions.Add(d.Clone()); } LayerDefinitions = new List <LayerDefinition>(); foreach (var d in copy.LayerDefinitions) { LayerDefinitions.Add(d.Clone()); } Tilesets = new List <Tileset>(); foreach (var d in copy.Tilesets) { Tilesets.Add(d.Clone()); } EntityDefinitions = new List <EntityDefinition>(); foreach (var d in copy.EntityDefinitions) { EntityDefinitions.Add(d.Clone()); } }