Java 类com.badlogic.gdx.scenes.scene2d.utils.ScissorStack 实例源码

项目:libgdx_ui_editor    文件:EditingZone.java   
@Override
public void draw (Batch batch, float parentAlpha) {
    Rectangle scissors = new Rectangle();
    Rectangle clipBounds = new Rectangle(getX(),getY(),getWidth(),getHeight());
    ScissorStack.calculateScissors(getStage().getCamera(), batch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);

    drawBg(batch, parentAlpha);

    batch.draw(texture,
            getX() + getWidth() / 2 - texture.getRegionWidth() / 2 + shift.x,
            getY() + getHeight() / 2 - texture.getRegionHeight() / 2 + shift.y,
            texture.getRegionWidth() / 2f,
            texture.getRegionHeight() / 2f,
            texture.getRegionWidth(), texture.getRegionHeight(),
            currZoom, currZoom, 0);

    drawSplits(batch, parentAlpha);

    batch.flush();
    ScissorStack.popScissors();
}
项目:cachebox3.0    文件:ScrollLabel.java   
@Override
public void draw(Batch batch, float parentAlpha) {
    BitmapFontCache cache = super.getBitmapFontCache();

    validate();
    Color color = tempColor.set(getColor());
    color.a *= parentAlpha;
    if (style.background != null) {
        batch.setColor(color.r, color.g, color.b, color.a);
        style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }
    if (style.fontColor != null) color.mul(style.fontColor);
    cache.tint(color);
    cache.setPosition(getX() + scrollPosition, getY());

    getStage().calculateScissors(localRec, scissorRec);
    ScissorStack.pushScissors(scissorRec);
    cache.draw(batch);
    batch.flush();
    try {
        ScissorStack.popScissors();
    } catch (Exception e) {
    }
}
项目:METRO    文件:AbstractTrainStatisticView.java   
/**
 * Draws the view with all information depending on the subclass.
 * 
 * @param sp
 *            The sprite batch to draw on.
 * @param position
 *            The position of the view in pixel coordinates.
 */
public void draw(SpriteBatch sp, Point position)
{
    METRO.__spriteBatch.end();
    METRO.__spriteBatch.begin();

    // Create scissor to draw only in the area of the statistic view.
    com.badlogic.gdx.math.Rectangle scissors = new com.badlogic.gdx.math.Rectangle();
    com.badlogic.gdx.math.Rectangle clipBounds = new com.badlogic.gdx.math.Rectangle(position.x + METRO.__getXOffset(), position.y + METRO.__getYOffset(), _size.x + 1, _size.y
            + 1);
    ScissorStack.calculateScissors((Camera) METRO.__camera, METRO.__spriteBatch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);

    drawView(sp);

    ScissorStack.popScissors();
}
项目:METRO    文件:List.java   
@Override
protected void draw()
{
    METRO.__spriteBatch.end();
    METRO.__spriteBatch.begin();

    // Create scissor to draw only in the area of the list box.
    com.badlogic.gdx.math.Rectangle scissors = new com.badlogic.gdx.math.Rectangle();
    com.badlogic.gdx.math.Rectangle clipBounds = new com.badlogic.gdx.math.Rectangle(_area.x + METRO.__getXOffset(), _area.y + METRO.__getYOffset(), _area.width
            + 1, _area.height + 1);
    ScissorStack.calculateScissors((Camera) METRO.__camera, METRO.__spriteBatch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);

    if (_decorated) clearBackground();

    drawEntries();

    if (_decorated) drawBorders();

    drawScrollbar();

    ScissorStack.popScissors();
}
项目:METRO    文件:Canvas.java   
@Override
protected void draw()
{
    Contract.RequireNotNull(_painter);

    Draw.setOffset(_area.x, _area.y);
    Fill.setOffset(_area.x, _area.y);

    com.badlogic.gdx.math.Rectangle scissors = new com.badlogic.gdx.math.Rectangle();
    com.badlogic.gdx.math.Rectangle clipBounds = new com.badlogic.gdx.math.Rectangle(_area.x + METRO.__getXOffset(), _area.y + METRO.__getYOffset(), _area.width
            + 1, _area.height + 1);

    ScissorStack.calculateScissors((Camera) METRO.__camera, METRO.__spriteBatch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);

    _painter.paint();

    ScissorStack.popScissors();

    Draw.setOffset(METRO.__getXOffset(), METRO.__getYOffset());
    Fill.setOffset(METRO.__getXOffset(), METRO.__getYOffset());
}
项目:SMC-Android    文件:HUD.java   
public void render(SpriteBatch batch, OrthographicCamera camera)
{
    if(!showing)return;

    batch.setProjectionMatrix(camera.combined);
    batch.begin();

    ScissorStack.calculateScissors(camera, batch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);

    batch.draw(back, x, y, w, h);
    glyphLayout.setText(font, text, Color.WHITE, w - 20, Align.left, true);
    font.draw(batch, glyphLayout, x + 10, y + h - 10 - scrollY);

    batch.end();
    ScissorStack.popScissors();
}
项目:ingress-indonesia-dev    文件:Table.java   
private Rectangle calculateScissors(Matrix4 paramMatrix4)
{
  Rectangle localRectangle = Rectangle.tmp;
  localRectangle.width = getWidth();
  localRectangle.height = getHeight();
  if (this.background == null)
  {
    localRectangle.x = 0.0F;
    localRectangle.y = 0.0F;
  }
  while (true)
  {
    ScissorStack.calculateScissors(getStage().getCamera(), paramMatrix4, localRectangle, Rectangle.tmp2);
    return Rectangle.tmp2;
    localRectangle.x = this.layout.getPadLeft().b(this);
    localRectangle.y = this.layout.getPadBottom().c(this);
    localRectangle.width -= localRectangle.x + this.layout.getPadRight().b(this);
    localRectangle.height -= localRectangle.y + this.layout.getPadTop().c(this);
  }
}
项目:ingress-indonesia-dev    文件:Table.java   
public void draw(SpriteBatch paramSpriteBatch, float paramFloat)
{
  validate();
  drawBackground(paramSpriteBatch, paramFloat);
  if (isTransform())
  {
    applyTransform(paramSpriteBatch, computeTransform());
    if (this.clip)
      if (ScissorStack.pushScissors(calculateScissors(paramSpriteBatch.getTransformMatrix())))
      {
        drawChildren(paramSpriteBatch, paramFloat);
        ScissorStack.popScissors();
      }
    while (true)
    {
      resetTransform(paramSpriteBatch);
      return;
      drawChildren(paramSpriteBatch, paramFloat);
    }
  }
  super.draw(paramSpriteBatch, paramFloat);
}
项目:ingress-indonesia-dev    文件:ak.java   
public final void e()
{
  validate();
  if ((this.c.width == 0.0F) || (this.c.height == 0.0F));
  GL20 localGL20;
  do
  {
    return;
    localGL20 = Gdx.gl20;
    if (!this.d)
      break;
  }
  while (!ScissorStack.pushScissors(this.c));
  Color localColor = getColor();
  localGL20.glClearColor(localColor.r, localColor.g, localColor.b, localColor.a);
  localGL20.glClear(16640);
  ScissorStack.popScissors();
  localGL20.glViewport((int)this.c.x, (int)this.c.y, (int)this.c.width, (int)this.c.height);
  a();
  localGL20.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
项目:Box2dCamera    文件:Box2DCamera.java   
/**
 * Rebuilds the cache and clears the background if clearBackground == true. Colour can be set with {@link #setGlClearColor(Color)}
 */
public void update(){
    this.viewport.update(false);        
    if(clearBackground){
        ScissorStack.pushScissors(scissors);
        Gdx.gl.glClearColor(glClearColor.r, glClearColor.g, glClearColor.b, glClearColor.a);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        ScissorStack.popScissors();
    }
    rebuildCache();
}
项目:kreativity-ui    文件:KrLwjgl3Renderer.java   
@Override
public boolean beginClip(float x, float y, float width, float height) {
    flush();
    Rectangle clipRectangle = Pools.obtain(Rectangle.class);
    clipRectangle.set(x + translation.x, viewportSize.y - y - height - translation.y, width, height);
    if (ScissorStack.pushScissors(clipRectangle)) {
        return true;
    }
    Pools.free(clipRectangle);
    return false;
}
项目:gdx-texture-packer-gui    文件:Canvas.java   
@Override
public void draw(Batch batch, float parentAlpha) {
    batch.flush();
    getStage().calculateScissors(widgetAreaBounds.set(getX(), getY(), getWidth(), getHeight()), scissorBounds);
    if (ScissorStack.pushScissors(scissorBounds)) {
        super.draw(batch, parentAlpha);
        batch.flush();
        ScissorStack.popScissors();
    }
}
项目:Mundus    文件:MundusSplitPane.java   
@Override
public void draw(Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    applyTransform(batch, computeTransform());
    // Matrix4 transform = batch.getTransformMatrix();
    if (firstWidget != null) {
        getStage().calculateScissors(firstWidgetBounds, firstScissors);
        if (ScissorStack.pushScissors(firstScissors)) {
            if (firstWidget.isVisible()) firstWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }
    if (secondWidget != null) {
        getStage().calculateScissors(secondWidgetBounds, secondScissors);
        if (ScissorStack.pushScissors(secondScissors)) {
            if (secondWidget.isVisible()) secondWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }

    Drawable handle = style.handle;
    if (mouseOnHandle && isTouchable() && style.handleOver != null) handle = style.handleOver;
    batch.setColor(color.r, color.g, color.b, parentAlpha * color.a);
    handle.draw(batch, handleBounds.x, handleBounds.y, handleBounds.width, handleBounds.height);
    resetTransform(batch);

}
项目:Mundus    文件:MundusMultiSplitPane.java   
@Override
public void draw(Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    applyTransform(batch, computeTransform());

    SnapshotArray<Actor> actors = getChildren();
    for (int i = 0; i < actors.size; i++) {
        Actor actor = actors.get(i);
        Rectangle bounds = widgetBounds.get(i);
        Rectangle scissor = scissors.get(i);
        getStage().calculateScissors(bounds, scissor);
        if (ScissorStack.pushScissors(scissor)) {
            if (actor.isVisible()) actor.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }

    batch.setColor(color.r, color.g, color.b, parentAlpha * color.a);

    Drawable handle = style.handle;
    Drawable handleOver = style.handle;
    if (isTouchable() && style.handleOver != null) handleOver = style.handleOver;
    for (Rectangle rect : handleBounds) {
        if (this.handleOver == rect) {
            handleOver.draw(batch, rect.x, rect.y, rect.width, rect.height);
        } else {
            handle.draw(batch, rect.x, rect.y, rect.width, rect.height);
        }
    }
    resetTransform(batch);
}
项目:GdxDemo3D    文件:GameStage.java   
@Override
public void calculateScissors (Rectangle localRect, Rectangle scissorRect) {
    ScissorStack.calculateScissors(cameraUI, viewport.getScreenX(), viewport.getScreenY(), viewport.getScreenWidth(), viewport.getScreenHeight(), batch.getTransformMatrix(), localRect, scissorRect);
    Matrix4 transformMatrix;
    if (shapeRenderer != null && shapeRenderer.isDrawing())
        transformMatrix = shapeRenderer.getTransformMatrix();
    else
        transformMatrix = batch.getTransformMatrix();
    ScissorStack.calculateScissors(cameraUI, viewport.getScreenX(), viewport.getScreenY(), viewport.getScreenWidth(), viewport.getScreenHeight(), transformMatrix, localRect, scissorRect);
}
项目:libgdxcn    文件:ScrollPane.java   
public void drawDebug (ShapeRenderer shapes) {
    drawDebugBounds(shapes);
    applyTransform(shapes, computeTransform());
    if (ScissorStack.pushScissors(scissorBounds)) {
        drawDebugChildren(shapes);
        ScissorStack.popScissors();
    }
    resetTransform(shapes);
}
项目:libgdxcn    文件:SplitPane.java   
@Override
public void draw (Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    Drawable handle = style.handle;
    applyTransform(batch, computeTransform());
    Matrix4 transform = batch.getTransformMatrix();
    if (firstWidget != null) {
        getStage().calculateScissors(firstWidgetBounds, firstScissors);
        if (ScissorStack.pushScissors(firstScissors)) {
            if (firstWidget.isVisible()) firstWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }
    if (secondWidget != null) {
        getStage().calculateScissors(secondWidgetBounds, secondScissors);
        if (ScissorStack.pushScissors(secondScissors)) {
            if (secondWidget.isVisible()) secondWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }
    batch.setColor(color.r, color.g, color.b, color.a);
    handle.draw(batch, handleBounds.x, handleBounds.y, handleBounds.width, handleBounds.height);
    resetTransform(batch);
}
项目:libgdxcn    文件:Actor.java   
/** Clips the specified screen aligned rectangle, specified relative to the transform matrix of the stage's Batch. The transform
 * matrix and the stage's camera must not have rotational components. Calling this method must be followed by a call to
 * {@link #clipEnd()} if true is returned.
 * @return false if the clipping area is zero and no drawing should occur.
 * @see ScissorStack */
public boolean clipBegin (float x, float y, float width, float height) {
    if (width <= 0 || height <= 0) return false;
    Rectangle tableBounds = Rectangle.tmp;
    tableBounds.x = x;
    tableBounds.y = y;
    tableBounds.width = width;
    tableBounds.height = height;
    Stage stage = this.stage;
    Rectangle scissorBounds = Pools.obtain(Rectangle.class);
    stage.calculateScissors(tableBounds, scissorBounds);
    if (ScissorStack.pushScissors(scissorBounds)) return true;
    Pools.free(scissorBounds);
    return false;
}
项目:vis-editor    文件:MultiSplitPane.java   
@Override
public void draw (Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    applyTransform(batch, computeTransform());

    SnapshotArray<Actor> actors = getChildren();
    for (int i = 0; i < actors.size; i++) {
        Actor actor = actors.get(i);
        Rectangle bounds = widgetBounds.get(i);
        Rectangle scissor = scissors.get(i);
        getStage().calculateScissors(bounds, scissor);
        if (ScissorStack.pushScissors(scissor)) {
            if (actor.isVisible()) actor.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }

    batch.setColor(color.r, color.g, color.b, parentAlpha * color.a);

    Drawable handle = style.handle;
    Drawable handleOver = style.handle;
    if (isTouchable() && style.handleOver != null) handleOver = style.handleOver;
    for (Rectangle rect : handleBounds) {
        if (this.handleOver == rect) {
            handleOver.draw(batch, rect.x, rect.y, rect.width, rect.height);
        } else {
            handle.draw(batch, rect.x, rect.y, rect.width, rect.height);
        }
    }
    resetTransform(batch);
}
项目:vis-editor    文件:VisSplitPane.java   
@Override
public void draw (Batch batch, float parentAlpha) {
    validate();

    Color color = getColor();

    applyTransform(batch, computeTransform());
    // Matrix4 transform = batch.getTransformMatrix();
    if (firstWidget != null) {
        getStage().calculateScissors(firstWidgetBounds, firstScissors);
        if (ScissorStack.pushScissors(firstScissors)) {
            if (firstWidget.isVisible()) firstWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }
    if (secondWidget != null) {
        getStage().calculateScissors(secondWidgetBounds, secondScissors);
        if (ScissorStack.pushScissors(secondScissors)) {
            if (secondWidget.isVisible()) secondWidget.draw(batch, parentAlpha * color.a);
            batch.flush();
            ScissorStack.popScissors();
        }
    }

    Drawable handle = style.handle;
    if (mouseOnHandle && isTouchable() && style.handleOver != null) handle = style.handleOver;
    batch.setColor(color.r, color.g, color.b, parentAlpha * color.a);
    handle.draw(batch, handleBounds.x, handleBounds.y, handleBounds.width, handleBounds.height);
    resetTransform(batch);

}
项目:ead    文件:TestGameView.java   
@Override
public void drawChildren(Batch batch, float parentAlpha) {
    getStage().calculateScissors(gameViewport, stageViewport);
    if (ScissorStack.pushScissors(stageViewport)) {
        super.drawChildren(batch, parentAlpha);
        batch.flush();
        ScissorStack.popScissors();
    }
}
项目:ead    文件:ScrollPane.java   
public void drawDebug(ShapeRenderer shapes) {
    drawDebugBounds(shapes);
    applyTransform(shapes, computeTransform());
    if (ScissorStack.pushScissors(scissorBounds)) {
        drawDebugChildren(shapes);
        ScissorStack.popScissors();
    }
    resetTransform(shapes);
}
项目:spezi-gdx    文件:MapWidget.java   
@Override
public void draw(SpriteBatch batch, float parentAlpha) {
    checkTasks();

    if (oldProjection == null) {
        oldProjection = getStage().getCamera().combined;
    }
    ScissorStack.pushScissors(scissor);
    super.draw(batch, parentAlpha);
    ScissorStack.popScissors();
    batch.setProjectionMatrix(oldProjection);
}
项目:ingress-indonesia-dev    文件:SplitPane.java   
public void draw(SpriteBatch paramSpriteBatch, float paramFloat)
{
  validate();
  Color localColor = getColor();
  Drawable localDrawable = this.style.handle;
  applyTransform(paramSpriteBatch, computeTransform());
  Matrix4 localMatrix4 = paramSpriteBatch.getTransformMatrix();
  if (this.firstWidget != null)
  {
    ScissorStack.calculateScissors(getStage().getCamera(), localMatrix4, this.firstWidgetBounds, this.firstScissors);
    if (ScissorStack.pushScissors(this.firstScissors))
    {
      if (this.firstWidget.isVisible())
        this.firstWidget.draw(paramSpriteBatch, paramFloat * localColor.a);
      paramSpriteBatch.flush();
      ScissorStack.popScissors();
    }
  }
  if (this.secondWidget != null)
  {
    ScissorStack.calculateScissors(getStage().getCamera(), localMatrix4, this.secondWidgetBounds, this.secondScissors);
    if (ScissorStack.pushScissors(this.secondScissors))
    {
      if (this.secondWidget.isVisible())
        this.secondWidget.draw(paramSpriteBatch, paramFloat * localColor.a);
      paramSpriteBatch.flush();
      ScissorStack.popScissors();
    }
  }
  paramSpriteBatch.setColor(localColor.r, localColor.g, localColor.b, localColor.a);
  localDrawable.draw(paramSpriteBatch, this.handleBounds.x, this.handleBounds.y, this.handleBounds.width, this.handleBounds.height);
  resetTransform(paramSpriteBatch);
}
项目:Mindustry    文件:MapView.java   
@Override
public void draw(Batch batch, float alpha){
    float ratio = 1f / ((float)editor.pixmap().getWidth() / editor.pixmap().getHeight());
    float size = Math.min(width, height);
    float sclwidth = size * zoom;
    float sclheight = size * zoom * ratio;
    float centerx = x + width/2 + offsetx * zoom;
    float centery = y + height/2 + offsety * zoom;

    image.setImageSize(editor.pixmap().getWidth(), editor.pixmap().getHeight());

    batch.flush();
    boolean pop = ScissorStack.pushScissors(Tmp.r1.set(x + width/2 - size/2, y + height/2 - size/2, size, size));

    batch.draw(editor.texture(), centerx - sclwidth/2, centery - sclheight/2, sclwidth, sclheight);

    if(grid){
        Draw.color(Color.GRAY);
        image.setBounds(centerx - sclwidth/2, centery - sclheight/2, sclwidth, sclheight);
        image.draw(batch, alpha);
        Draw.color();
    }

    if(tool == EditorTool.line && drawing){
        Vector2 v1 = unproject(startx, starty).add(x, y);
        float sx = v1.x, sy = v1.y;
        Vector2 v2 = unproject(lastx, lasty).add(x, y);

        Draw.color(Tmp.c1.set(ColorMapper.getColor(editor.getDrawBlock())));
        Draw.thick(Unit.dp.scl(3f * zoom));
        Draw.line(sx, sy, v2.x, v2.y);

        Draw.polygon(sx, sy, 40, editor.getBrushSize() * zoom * 3);

           Draw.polygon(v2.x, v2.y, 40, editor.getBrushSize() * zoom * 3);
    }

    batch.flush();

    if(pop) ScissorStack.popScissors();

    Draw.color(Colors.get("accent"));
    Draw.thick(Unit.dp.scl(3f));
    Draw.linerect(x + width/2 - size/2, y + height/2 - size/2, size, size);
    Draw.reset();
}
项目:planetbusters    文件:ArcadeCanvas.java   
public final void clipRect(int x, int y, int w, int h) {
    Rectangle scissors = new Rectangle();
    Rectangle clipBounds = new Rectangle(x,y,w,h);
    ScissorStack.calculateScissors(camera, batch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);
}
项目:planetbusters    文件:ArcadeCanvas.java   
public final void endClip() {
    ScissorStack.popScissors();
}
项目:kreativity-ui    文件:KrLwjgl3Renderer.java   
@Override
public void endClip() {
    flush();
    Pools.free(ScissorStack.popScissors());
}
项目:origin    文件:GUIGDX.java   
static public boolean pushScissor(Rect s)
{
    Rectangle clipBounds = new Rectangle(s.x, Gdx.graphics.getHeight() - s.y, s.w, -s.h);
    _spriteBatch.flush();
    return ScissorStack.pushScissors(clipBounds);
}
项目:origin    文件:GUIGDX.java   
static public void popScissor()
{
    _spriteBatch.flush();
    ScissorStack.popScissors();
}
项目:planetbusters    文件:ArcadeCanvas.java   
public final void clipRect(int x, int y, int w, int h) {
    Rectangle scissors = new Rectangle();
    Rectangle clipBounds = new Rectangle(x,y,w,h);
    ScissorStack.calculateScissors(camera, batch.getTransformMatrix(), clipBounds, scissors);
    ScissorStack.pushScissors(scissors);
}
项目:planetbusters    文件:ArcadeCanvas.java   
public final void endClip() {
    ScissorStack.popScissors();
}
项目:libgdxcn    文件:Actor.java   
/** Ends clipping begun by {@link #clipBegin(float, float, float, float)}. */
public void clipEnd () {
    Pools.free(ScissorStack.popScissors());
}
项目:libgdxcn    文件:Viewport.java   
/** @see ScissorStack#calculateScissors(Camera, float, float, float, float, Matrix4, Rectangle, Rectangle) */
public void calculateScissors (Matrix4 batchTransform, Rectangle area, Rectangle scissor) {
    ScissorStack.calculateScissors(camera, screenX, screenY, screenWidth, screenHeight, batchTransform, area, scissor);
}
项目:ingress-indonesia-dev    文件:ScrollPane.java   
public void draw(SpriteBatch paramSpriteBatch, float paramFloat)
{
  if (this.widget == null)
    return;
  validate();
  applyTransform(paramSpriteBatch, computeTransform());
  if (this.scrollX)
    this.hKnobBounds.x = (this.hScrollBounds.x + (int)((this.hScrollBounds.width - this.hKnobBounds.width) * getScrollPercentX()));
  if (this.scrollY)
    this.vKnobBounds.y = (this.vScrollBounds.y + (int)((this.vScrollBounds.height - this.vKnobBounds.height) * (1.0F - getScrollPercentY())));
  float f1 = this.widgetAreaBounds.y;
  if (!this.scrollY);
  for (float f2 = f1 - (int)this.maxY; ; f2 = f1 - (int)(this.maxY * (1.0F - this.amountY / this.maxY)))
  {
    float f3 = this.widgetAreaBounds.x;
    if (this.scrollX)
      f3 -= (int)(this.maxX * this.amountX / this.maxX);
    this.widget.setPosition(f3, f2);
    if ((this.widget instanceof Cullable))
    {
      this.widgetCullingArea.x = (-this.widget.getX() + this.widgetAreaBounds.x);
      this.widgetCullingArea.y = (-this.widget.getY() + this.widgetAreaBounds.y);
      this.widgetCullingArea.width = this.widgetAreaBounds.width;
      this.widgetCullingArea.height = this.widgetAreaBounds.height;
      ((Cullable)this.widget).setCullingArea(this.widgetCullingArea);
    }
    ScissorStack.calculateScissors(getStage().getCamera(), paramSpriteBatch.getTransformMatrix(), this.widgetAreaBounds, this.scissorBounds);
    Color localColor = getColor();
    paramSpriteBatch.setColor(localColor.r, localColor.g, localColor.b, paramFloat * localColor.a);
    if (this.style.background != null)
      this.style.background.draw(paramSpriteBatch, 0.0F, 0.0F, getWidth(), getHeight());
    paramSpriteBatch.flush();
    if (ScissorStack.pushScissors(this.scissorBounds))
    {
      drawChildren(paramSpriteBatch, paramFloat);
      ScissorStack.popScissors();
    }
    paramSpriteBatch.setColor(localColor.r, localColor.g, localColor.b, paramFloat * localColor.a * Interpolation.fade.apply(this.fadeAlpha / this.fadeAlphaSeconds));
    if (this.scrollX)
    {
      if (this.style.hScroll != null)
        this.style.hScroll.draw(paramSpriteBatch, this.hScrollBounds.x, this.hScrollBounds.y, this.hScrollBounds.width, this.hScrollBounds.height);
      if (this.style.hScrollKnob != null)
        this.style.hScrollKnob.draw(paramSpriteBatch, this.hKnobBounds.x, this.hKnobBounds.y, this.hKnobBounds.width, this.hKnobBounds.height);
    }
    if (this.scrollY)
    {
      if (this.style.vScroll != null)
        this.style.vScroll.draw(paramSpriteBatch, this.vScrollBounds.x, this.vScrollBounds.y, this.vScrollBounds.width, this.vScrollBounds.height);
      if (this.style.vScrollKnob != null)
        this.style.vScrollKnob.draw(paramSpriteBatch, this.vKnobBounds.x, this.vKnobBounds.y, this.vKnobBounds.width, this.vKnobBounds.height);
    }
    resetTransform(paramSpriteBatch);
    return;
  }
}
项目:ingress-indonesia-dev    文件:Stage.java   
public void toScreenCoordinates(Vector2 paramVector2, Matrix4 paramMatrix4)
{
  ScissorStack.toWindowCoordinates(this.camera, paramMatrix4, paramVector2);
}
项目:ingress-indonesia-dev    文件:WidgetCarousel.java   
public void draw(SpriteBatch paramSpriteBatch, float paramFloat)
{
  aj.a("WidgetCarousel.draw");
  applyTransform(paramSpriteBatch, computeTransform());
  Color localColor = getColor();
  if (this.f.background != null)
  {
    paramSpriteBatch.setColor(localColor.r, localColor.g, localColor.b, paramFloat * localColor.a);
    this.f.background.draw(paramSpriteBatch, 0.0F, 0.0F, getWidth(), getHeight());
  }
  if (this.G)
    b();
  int i1;
  if (this.r)
  {
    float f1 = this.e;
    this.c.set(f1, f1, getWidth() - 2.0F * f1, getHeight() - 2.0F * f1);
    ScissorStack.calculateScissors(getStage().getCamera(), paramSpriteBatch.getTransformMatrix(), this.c, this.d);
    if (ScissorStack.pushScissors(this.d))
    {
      drawChildren(paramSpriteBatch, paramFloat);
      ScissorStack.popScissors();
    }
    if ((this.l != null) && (this.m != null))
    {
      if (this.v >= 0.1F * this.s)
        break label397;
      i1 = 1;
      label201: if (i1 == 0)
        this.l.draw(paramSpriteBatch, paramFloat);
      if (this.v <= this.x - 0.1F * this.s)
        break label403;
    }
  }
  label397: label403: for (int i2 = 1; ; i2 = 0)
  {
    if (i2 == 0)
      this.m.draw(paramSpriteBatch, paramFloat);
    if (this.u)
    {
      paramSpriteBatch.setColor(localColor.r, localColor.g, localColor.b, paramFloat * localColor.a);
      this.f.hScroll.draw(paramSpriteBatch, this.a.x, this.a.y - (this.a.height - this.b.height) / 2.0F, this.a.width, this.a.height);
      this.f.hScrollKnob.draw(paramSpriteBatch, this.b.x, this.b.y, this.b.width, this.b.height);
    }
    resetTransform(paramSpriteBatch);
    aj.b();
    return;
    drawChildren(paramSpriteBatch, paramFloat);
    break;
    i1 = 0;
    break label201;
  }
}