Пример #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);
 }