예제 #1
0
파일: GuiList.cs 프로젝트: CallitMez/RPG
        private GuiList(Rectangle bounds, List <GuiLabel> labels) : base(bounds)
        {
            // Create the up-button
            up = new GuiButton(new Rectangle(new Point(0, 0), new Point(16)), "testure");
            up.ClickHandler = () => scroll(true);
            up.loadContent(RPGGame.AssetManager);

            // Create the down-button
            down = new GuiButton(new Rectangle(new Point(0, 0), new Point(16)), "testure");
            down.ClickHandler = () => scroll(false);
            down.loadContent(RPGGame.AssetManager);

            // Create the list-related variables
            labelList  = labels;
            currentTop = 0;

            // Make sure all labels know this is their parent
            foreach (GuiLabel label in labelList)
            {
                label.Parent = this;
            }

            // Make sure the buttons know this is their parent
            up.Parent   = this;
            down.Parent = this;

            maxWidth = bounds.Width;
        }
예제 #2
0
파일: GuiList.cs 프로젝트: CallitMez/RPG
 public override void loadContent(AssetManager content)
 {
     up.loadContent(content);
     down.loadContent(content);
     foreach (GuiLabel label in labelList)
     {
         label.loadContent(content);
     }
 }