コード例 #1
0
  // TODO This should be part of NovaCore -> Move to NativeContainer interface
  @Override
  public void draw(int mouseX, int mouseY, float partial, Graphics graphics) {
    for (GuiComponent<?, ?> component : components) {
      Outline outline = component.getOutline();
      int width = outline.minXi(), height = outline.minYi();
      Canvas canvas = graphics.getCanvas();

      canvas.push();
      canvas.setScissor(component.getOutline());
      canvas.translate(width, height);
      ((DrawableGuiComponent) component.getNative())
          .draw(mouseX - width, mouseY - height, partial, graphics);
      canvas.pop();
    }
    super.draw(mouseX, mouseY, partial, graphics);
  }