Beispiel #1
0
 public PtaModel(UISubcomponentModel subcomponentModel) : base(subcomponentModel)
 {
     SpriteSheets = new ObservableCollection <UISpriteSheetModel>();
     for (int i = 0; i < subcomponentModel.Subcomponent.imageSource.Count; i++)
     {
         SpriteSheets.Add(new UISpriteSheetModel(subcomponentModel, subcomponentModel.Subcomponent.imageSource.Filenames[i], i, subcomponentModel.GetFileName));
     }
 }
Beispiel #2
0
 public UIGroupControlModel(GroupControl control, UISubcomponentModel subcomponent, UIGroupControlModel parent) : base(control, subcomponent, parent)
 {
     groupControl = control;
     foreach (Control child in groupControl.ChildControls)
     {
         Children.Add(CreateControlModel(child, subcomponent, this));
     }
 }
 public UISpriteCollectionModel(SpriteCollection control, UISubcomponentModel subcomponent, UIGroupControlModel parent) : base(control, subcomponent, parent)
 {
     spriteCollection = control;
     int index = 0;
     foreach (SpriteGroup child in spriteCollection.ChildSpriteGroups)
     {
         Children.Add(new UISpriteGroupModel(subcomponent, this, child, true,
             index == spriteCollection.DefaultSpriteIndex));
         index++;
     }
 }
Beispiel #4
0
 public UISpriteGroupModel(
     UISubcomponentModel subcomponent,
     UIControlModel parent,
     SpriteGroup spriteGroup,
     bool isSpriteCollectionChild,
     bool visibility) : base(subcomponent, null)
 {
     this.spriteGroup        = spriteGroup;
     parentControlModel      = parent;
     IsSpriteCollectionChild = isSpriteCollectionChild;
     currentVisibility       = visibility;
     foreach (Sprite sprite in spriteGroup.Sprites)
     {
         Children.Add(new UISpriteModel(subcomponent, this, sprite));
     }
 }
Beispiel #5
0
        public UISpriteSheetModel(UISubcomponentModel subcomponent, string name, int index, IGetFileName getFileName) : base(subcomponent, name)
        {
            this.index = index;
            GTF gtf = subcomponent.GetSpritesheet(index);

            colorGtfs     = new ColorChannelGTF(gtf);
            _bitmapSource = BitmapSource.Create(
                gtf.Width,
                gtf.Height,
                96,
                96,
                PixelFormats.Bgra32,
                null,
                gtf.BitmapDataPtr,
                4 * gtf.Stride * gtf.Height,
                4 * gtf.Stride);
            _bitmapSource.Freeze();
            _getfileName = getFileName;
            Sprites      = new List <UISpriteModel>();
            Rectangles   = new ObservableCollection <UISpriteSheetRectangleModel>();
        }
 public UITextBoxModel(TextBox control, UISubcomponentModel subcomponent, UIGroupControlModel parent) : base(control, subcomponent, parent)
 {
     textBox = control;
 }
 public PtaElementModel(UISubcomponentModel subcomponent, string name) : base(subcomponent, name)
 {
 }
Beispiel #8
0
 protected UIModel(UISubcomponentModel subcomponent, string name) : base(subcomponent, name, subcomponent.GetFileName)
 {
     this.subcomponent = subcomponent;
 }