예제 #1
0
 public ScrollPanel(ScrollMask scrollMask, int scrollIncrements = 12, Image2D containerBackgroundImage = null, Scrollbar scrollbar = null)
 {
     ScrollMask       = scrollMask;
     ScrollContainer  = new ScrollContainer(ScrollMask, containerBackgroundImage);
     ScrollIncrements = scrollIncrements;
     Scrollbar        = scrollbar;
 }
예제 #2
0
 public ScrollContainer(ScrollMask scrollMask, Image2D backgroundImage = null)
 {
     Elements        = new List <ScrollElement>();
     Area            = new Rectangle(scrollMask.Area.X, scrollMask.Area.Y, scrollMask.Area.Width, scrollMask.Area.Height);
     OriginalArea    = Area;
     BackgroundImage = backgroundImage == null ? new Image2D(null, Vector2.Zero, Color.White, 0f) : backgroundImage;
     BackgroundImage.ParentPosition = new Vector2(Area.X, Area.Y); // offset drawing the image relative to scrollmask position
     //BuildContainer(Container.X, Container.Y);
 }
예제 #3
0
 public Scrollbar(Rectangle area, Image2D handleImage, Image2D backgroundImage = null)
 {
     Area        = area;
     HandleImage = handleImage;
     HandleImage.ParentPosition     = new Vector2(Area.X, Area.Y);
     BackgroundImage                = backgroundImage == null ? new Image2D(null, Vector2.Zero, Color.White, 0f) : backgroundImage;
     BackgroundImage.ParentPosition = new Vector2(Area.X, Area.Y); // offset drawing the image relative to scrollmask position
     handleMin = HandleImage.Position;
     handleMax = new Vector2(handleMin.X, Area.Height);
 }
예제 #4
0
 public Button(Image2D image, Rectangle area, Color defaultColor, Color hoverColor, Color clickColor)
 {
     Image = image;
     Area  = area;
     Image.ParentPosition = new Vector2(Area.X, Area.Y);
     MouseArea            = new Rectangle(0, 0, 2, 2);
     DefaultColor         = defaultColor;
     HoverColor           = hoverColor;
     ClickColor           = clickColor;
 }
예제 #5
0
 public ScrollMask(Rectangle area, Image2D backgroundImage = null)
 {
     Area            = area;
     BackgroundImage = backgroundImage == null ? new Image2D(null, Vector2.Zero, Color.White, 0f) : backgroundImage;
     BackgroundImage.ParentPosition = new Vector2(Area.X, Area.Y); // offset drawing the image relative to scrollmask position
 }