コード例 #1
0
ファイル: Carousel.cs プロジェクト: parhelia512/phantom
        public Carousel(string name, Vector2 position, OABB shape, UIElementOrientation orientation, int visibleOptions, bool wrap, float offset, float fallOff)
            : base(name, position, shape)
        {
            this.ElementOrientation = orientation;
            this.VisibleOptions     = visibleOptions;
            this.Wrap       = wrap;
            this.fallOff    = fallOff;
            elements        = new List <UIElement>();
            selectedElement = -1;
            switch (orientation)
            {
            default:
            case UIElementOrientation.LeftRight:
                this.offset = new Vector2(offset, 0);
                break;

            case UIElementOrientation.TopDown:
                this.offset = new Vector2(0, offset);
                break;
            }
        }
コード例 #2
0
        public CarouselContainer(string name, string caption, Vector2 position, OABB shape, int capacity, UIElementOrientation orientation, int visibleOptions, bool wrap, float offset)
            : base(name, caption, position, shape)
        {
            this.ElementOrientation = orientation;
            this.Contents           = new List <ContainerItem>();
            this.Capacity           = capacity;
            this.VisibleOptions     = visibleOptions;
            this.Wrap            = wrap;
            this.selectedContent = -1;
            this.hovering        = null;

            switch (orientation)
            {
            default:
            case UIElementOrientation.LeftRight:
                this.offset = new Vector2(offset, 0);
                break;

            case UIElementOrientation.TopDown:
                this.offset = new Vector2(0, offset);
                break;
            }
        }