예제 #1
0
파일: Label.cs 프로젝트: MyEyes/Igorr
 public Label(UIElement parent, Vector2 position, string text="")
     : base(parent, position)
 {
     if (_font == null)
         _font = ContentInterface.LoadFont("font2");
     _text = text;
 }
예제 #2
0
파일: ItemIcon.cs 프로젝트: MyEyes/Igorr
 public ItemIcon(UIElement parent, Vector2 position, Logic.ICollectible item)
     : base(parent, position, new Vector2(32, 32), item != null ? item.Texture : null)
 {
     oldPos = position;
     _item = item;
     backgroundPanel = new Panel(this, new Vector2(-2, -2), new Vector2(40, 40), Content.ContentInterface.LoadTexture("UITest"));
 }
예제 #3
0
파일: UIElement.cs 프로젝트: MyEyes/Igorr
 public UIElement(UIElement parent, Vector2 offset)
 {
     _parent = parent;
     _offset = offset;
     _childs = new List<UIElement>();
     depth=minDepth;
     if (parent != null)
         depth = parent.depth + maxDepth - parent.depth / 10.0f;
 }
예제 #4
0
파일: Button.cs 프로젝트: MyEyes/Igorr
 public Button(UIElement parent, Vector2 position, Vector2 size, Texture2D buttonTex, Action action, string text="")
     : base(parent, position)
 {
     buttonBorder = new Panel(this, Vector2.Zero, size, buttonTex);
     this.AddChild(buttonBorder);
     _action=action;
     _size = size;
     if (_font == null)
         _font = ContentInterface.LoadFont("font2");
     Text = text;
     _state = UIButtonState.Nothing;
 }
예제 #5
0
파일: ItemIcon.cs 프로젝트: MyEyes/Igorr
 public void Drop(UIElement element)
 {
     IDroppable drop = _parent as IDroppable;
     if (_parent != null)
     {
         drop.Remove(this);
     }
     else
     {
         _parent.RemoveChild(this);
     }
 }
예제 #6
0
파일: UIElement.cs 프로젝트: MyEyes/Igorr
 public bool TryDrop(UIElement caller, IDraggable obj)
 {
     IDroppable drop = this as IDroppable;
     if(drop!=null && obj.Rect.Intersects(new Rectangle((int)TotalOffset.X,(int)TotalOffset.Y,(int)_size.X,(int)_size.Y)))
     {
         if (drop.Drop(obj))
             return true;
     }
     for (int x = 0; x < _childs.Count; x++)
         if (_childs[x] != caller) if (_childs[x].TryDrop(this, obj)) return true;
     if (_parent!=null && _parent != caller)
         if (_parent.TryDrop(this, obj)) return true;
     return false;
 }
예제 #7
0
파일: Panel.cs 프로젝트: MyEyes/Igorr
 //Texture is assumed to be consisting of 3x3 tiles which are 8x8 pixels each, one for each side, one for each corner and the center
 public Panel(UIElement parent, Vector2 offset, Vector2 size, Texture2D texture)
     : base(parent,offset)
 {
     SetSize(size);
     _texture = texture;
 }
예제 #8
0
파일: UIElement.cs 프로젝트: MyEyes/Igorr
 public void RemoveChild(UIElement element)
 {
     _childs.Remove(element);
 }
예제 #9
0
파일: UIElement.cs 프로젝트: MyEyes/Igorr
 public void AddChild(UIElement element)
 {
     _childs.Add(element);
     element._parent = this;
 }
예제 #10
0
파일: PictureBox.cs 프로젝트: MyEyes/Igorr
 public PictureBox(UIElement parent, Vector2 offset, Vector2 size, Texture2D texture)
     : base(parent, offset)
 {
     _texture = texture;
     _size = size;
 }