public ControlProgress(final IWidget parent, final int x, final int y, final Texture progressBlank, final Texture progressBar, final Alignment dir) { super(parent, x, y, (progressBlank == null) ? 0 : progressBlank.width(), (progressBlank == null) ? 0 : progressBlank.height()); this.progressBlank = progressBlank; this.progressBar = progressBar; this.progress = 0.0f; this.direction = dir; }
@Override public int width() { return this.getArea().width(); }
padding = parseBorder(array); Texture texture = new Texture(uv, padding, border, textureSheet); textures.put(name, texture); } catch (Exception e) {
@Override public ITexture crop(final Alignment anchor, final int dist) { return this.crop(new Border(anchor.opposite(), dist)); }
@Override public int height() { return this.getArea().height(); }
@Override public ITexture crop(final IBorder crop) { final Texture copy = new Texture(this.area, this.padding, this.border, this.binnieTexture); if (crop.getBottom() > 0) { copy.border.setBottom(0); copy.padding.setBottom(copy.padding.getBottom() - Math.min(crop.getBottom(), copy.padding.getBottom())); copy.area.setHeight(copy.area.height() - crop.getBottom()); } if (crop.getTop() > 0) { copy.border.setTop(0); copy.padding.setTop(copy.padding.getTop() - Math.min(crop.getTop(), copy.padding.getTop())); copy.area.setHeight(copy.area.height() - crop.getTop()); copy.area.setYPos(copy.area.yPos() + crop.getTop()); } if (crop.getRight() > 0) { copy.border.setRight(0); copy.padding.setRight(copy.padding.getRight() - Math.min(crop.getRight(), copy.padding.getRight())); copy.area.setWidth(copy.area.width() - crop.getRight()); } if (crop.getLeft() > 0) { copy.border.setLeft(0); copy.padding.setLeft(copy.padding.getLeft() - Math.min(crop.getLeft(), copy.padding.getLeft())); copy.area.setWidth(copy.area.width() - crop.getLeft()); copy.area.setXPos(copy.area.xPos() + crop.getLeft()); } return copy; }