private void hexTextBox_Validated(object sender, EventArgs e) { OgmoColor col = color; OgmoParse.Parse(ref col, hexTextBox); Color = col; }
public ColorChooser() { InitializeComponent(); color = new OgmoColor(255, 255, 255); hexTextBox.Text = color.ToString(); colorButton.BackColor = color; }
static public void Parse(ref OgmoColor to, TextBox box) { try { to = new OgmoColor(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 = (OgmoColor)dialog.Color; }
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 = (OgmoColor)dialog.Color; }
public Project() { //Default project properties Name = Ogmo.NEW_PROJECT_NAME; BackgroundColor = OgmoColor.DefaultBackgroundColor; GridColor = OgmoColor.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 Project() { //Default project properties Name = Ogmo.NEW_PROJECT_NAME; BackgroundColor = OgmoColor.DefaultBackgroundColor; GridColor = OgmoColor.DefaultGridColor; Filename = ""; LevelDefaultSize = LevelMinimumSize = LevelMaximumSize = new Size(640, 480); CameraEnabled = false; CameraSize = new Size(640, 480); ExportCameraPosition = false; CustomPluginEntries = new SerializableDictionary<string, string>(); //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 OgmoVersion = copy.OgmoVersion; 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()); } }
public static void Parse(ref OgmoColor to, TextBox box) { try { to = new OgmoColor(box.Text); } catch { box.Text = to.ToString(); } }
public void CloneFrom(Project copy) { //Default project properties OgmoVersion = copy.OgmoVersion; 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; CustomPluginEntries = copy.CustomPluginEntries; //Definitions CustomPluginEntries = new SerializableDictionary<string, string>(); foreach (var d in copy.CustomPluginEntries) CustomPluginEntries.Add(d.Key, d.Value); 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()); }