예제 #1
0
        private void hexTextBox_Validated(object sender, EventArgs e)
        {
            OgmoColor col = color;

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