Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceLibrary/Part.cs

    r13 r23  
    1515        {
    1616                private Image _image;
    17                 private string _filename;
     17                private string _imagePath;
    1818                private Point _point;
    1919
    20                 /*public Part(string basePath, Hashtable partDef)
    21                 {
    22                         this.path = (string)Path.Combine(partDef["filename"]);
    23                         this.x = (int)partDef["pos x"];
    24                         this.y = (int)partDef["pos y"];
    25                 }*/
    26                
    2720                public Part(String path, int x, int y)
    2821                {
    29                         _filename = System.IO.Path.GetFileName(path);
     22                        _imagePath = path;
    3023                        _image = Image.FromFile(path);
    31                         this.X = x;
    32                         this.Y = y;
     24                        _point.X = x;
     25                        _point.Y = y;
    3326                }
    3427
    3528                public Part(String path, Image image, int x, int y)
    3629                {
    37                         _filename = System.IO.Path.GetFileName(path);
    38                         _image = image;
    39                         this.X = x;
    40                         this.Y = y;
     30            _imagePath = path;
     31            _image = image;
     32                        _point.X = x;
     33                        _point.Y = y;
    4134                }
    4235
    4336                public string FileName
    4437                {
    45                         get { return _filename; }
    46                 }
     38            get
     39            {
     40                return System.IO.Path.GetFileName(_imagePath);
     41            }
     42        }
    4743
    4844                public Image Image
     
    6460                public int Y
    6561                {
    66                         get { return 128 - _point.Y - _image.Height; }
    67                         set { _point.Y = 128 - value - _image.Height; }
     62                        get { return _point.Y; }
     63                        set { _point.Y = value; }
    6864                }
    6965
Note: See TracChangeset for help on using the changeset viewer.