Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceLibrary/Part.cs

    r23 r13  
    1515        {
    1616                private Image _image;
    17                 private string _imagePath;
     17                private string _filename;
    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               
    2027                public Part(String path, int x, int y)
    2128                {
    22                         _imagePath = path;
     29                        _filename = System.IO.Path.GetFileName(path);
    2330                        _image = Image.FromFile(path);
    24                         _point.X = x;
    25                         _point.Y = y;
     31                        this.X = x;
     32                        this.Y = y;
    2633                }
    2734
    2835                public Part(String path, Image image, int x, int y)
    2936                {
    30             _imagePath = path;
    31             _image = image;
    32                         _point.X = x;
    33                         _point.Y = y;
     37                        _filename = System.IO.Path.GetFileName(path);
     38                        _image = image;
     39                        this.X = x;
     40                        this.Y = y;
    3441                }
    3542
    3643                public string FileName
    3744                {
    38             get
    39             {
    40                 return System.IO.Path.GetFileName(_imagePath);
    41             }
    42         }
     45                        get { return _filename; }
     46                }
    4347
    4448                public Image Image
     
    6064                public int Y
    6165                {
    62                         get { return _point.Y; }
    63                         set { _point.Y = value; }
     66                        get { return 128 - _point.Y - _image.Height; }
     67                        set { _point.Y = 128 - value - _image.Height; }
    6468                }
    6569
Note: See TracChangeset for help on using the changeset viewer.