public void setPercent(float value) { fillBarBackground.setCenter(base.getCenterX(), base.getCenterY()); fillBarBackground.setSize(base.getWidth() - (edgeSize * 2.0f), base.getHeight() - (edgeSize * 2.0f)); percent = value; if (fillBar == null) { fillBar = new DrawRectangle(); fillBar.fillColor = Color.Chartreuse; fillBar.edgeColor = Color.FromArgb(0, 0, 0, 0); } if (percent <= 0.0f) { percent = 0.0f; fillBar.rectangleVisible = false; } else { if (percent > 1.0f) { percent = 1.0f; } fillBar.rectangleVisible = true; } float bufferSizeX = edgeSize; float bufferSizeY = edgeSize; float barSizeX = base.getWidth() - (bufferSizeX * 2.0f); float barSizeY = base.getHeight() - (bufferSizeY * 2.0f); if (fillOnX) { barSizeX *= percent; fillBar.setWidth(barSizeX); fillBar.setHeight(barSizeY); fillBar.setCenterX(base.getCenterX() - (base.getWidth() * 0.5f) + bufferSizeX + (barSizeX * 0.5f)); fillBar.setCenterY(base.getCenterY()); } else { barSizeY *= percent; fillBar.setWidth(barSizeX); fillBar.setHeight(barSizeY); fillBar.setCenterX(base.getCenterX()); fillBar.setCenterY(base.getCenterY() + (base.getHeight() * 0.5f) - bufferSizeY - (barSizeY * 0.5f)); } }
protected void setWebPositionSize() { if (hostSet != null && web != null && hangTop != null) { //updating web position and length web.setCenterX((hangTop.X + base.getCenterX()) / 2); web.setCenterY((hangTop.Y + base.getCenterY()) / 2); web.setWidth(1f); web.setHeight(dropStart.Y - base.getCenterY() + (hostSet.getRowSpacing() * (dropDistance - 1))); web.visible = true; } }
/** * Will scale this panel by the given amount in world coordinates * @param scale the amount that will be scaled by * @param affectSubPanels If TRUE, all of this panels subPanels size settings will be set to match this Panels size settings. */ public virtual void scalePanel(float XScale, float YScale, bool effectSubPanels) { Background.setWidth(Background.getWidth() * XScale); Background.setHeight(Background.getHeight() * YScale); if (effectSubPanels && subPanels != null) { int panelsFound = 0; for (int loop = 0; loop < subPanels.Length && panelsFound < numberOfPanels; loop++) { if (subPanels[loop] != null) { panelsFound++; subPanels[loop].movePanel(XScale, YScale, effectSubPanels); } } } }