Ejemplo n.º 1
0
        private void hexTextBox_Validated(object sender, EventArgs e)
        {
            OgmoColor col = color;

            OgmoParse.Parse(ref col, hexTextBox);
            Color = col;
        }
Ejemplo n.º 2
0
 public ColorChooser()
 {
     InitializeComponent();
     color                 = new OgmoColor(255, 255, 255);
     hexTextBox.Text       = color.ToString();
     colorButton.BackColor = color;
 }
Ejemplo n.º 3
0
 public ColorChooser()
 {
     InitializeComponent();
     color = new OgmoColor(255, 255, 255);
     hexTextBox.Text = color.ToString();
     colorButton.BackColor = color;
 }
Ejemplo n.º 4
0
 static public void Parse(ref OgmoColor to, TextBox box)
 {
     try
     {
         to = new OgmoColor(box.Text);
     }
     catch
     {
         box.Text = to.ToString();
     }
 }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
        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;
        }
Ejemplo n.º 7
0
        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>();
        }
Ejemplo n.º 8
0
        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>();
        }
Ejemplo n.º 9
0
        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());
            }
        }
Ejemplo n.º 10
0
 public static void Parse(ref OgmoColor to, TextBox box)
 {
     try
     {
         to = new OgmoColor(box.Text);
     }
     catch
     {
         box.Text = to.ToString();
     }
 }
Ejemplo n.º 11
0
        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());
        }
Ejemplo n.º 12
0
 private void hexTextBox_Validated(object sender, EventArgs e)
 {
     OgmoColor col = color;
     OgmoParse.Parse(ref col, hexTextBox);
     Color = col;
 }