示例#1
0
        public SliderElement(Screen screen, Renderer renderer, Rectangle sliderBar)
        {
            SliderBar    = new RenderableElement(screen, renderer, sliderBar, TextureName.BasicButtonHover);
            SliderButton = new Button(screen, renderer, new Rectangle(sliderBar.X, sliderBar.Y, sliderBar.Width, sliderBar.Width));
            SliderButton.setTexture(TextureName.Ball);
            SliderButton.hoverableTile.Highlight = false;

            SliderButton.clickableElement.setOnDrag(dragSlider);
            SliderButton.clickableElement.setOnDragRelease(sliderStopped);
            isVisible = true;
        }
示例#2
0
        public DraggableElement(Screen screen, Renderer renderer, Rectangle origin)
        {
            DragOrigin = new Button(screen, renderer, origin);
            OriginIcon = new RenderableElement(screen, renderer, origin);
            DragIcon   = new RenderableElement(screen, renderer, origin);
            DragIcon.moveToTopLayer();
            cursorIcon = true;
            dragging   = false;
            DragIcon.setVisibility(false);
            hasCustomDragRelease = false;

            DragOrigin.clickableElement.setOnDrag(dragItem);
            DragOrigin.clickableElement.setOnDragRelease(onDragRelease);
        }
示例#3
0
        public ScrollableElement(Screen screen, Renderer renderer, Rectangle viewRect)
        {
            this.Screen         = screen;
            TotalFrame          = viewRect;
            ViewFrame           = new HoverableElement(screen, renderer, viewRect);
            ViewFrame.Highlight = false;
            //for testing
            ScrollingFrame = new RenderableElement(screen, renderer, TotalFrame);

            SliderBar = new SliderElement(screen, renderer, new Rectangle(viewRect.X + viewRect.Width - (int)(viewRect.Width * .1), viewRect.Y, (int)(viewRect.Width * .1), viewRect.Height));
            ScrollingFrame.Texture = TextureName.MainScreenBackground;

            scrollUnit = (int)((ViewFrame.Rect.Height) * .1);
            Screen.scrollableChildren.Insert(0, this);
        }