/** If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget group is laid * out. */ public void draw (Batch batch, float parentAlpha) { validate(); super.draw(batch, parentAlpha); } }
/** If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget group is laid * out. */ public void draw (Batch batch, float parentAlpha) { validate(); super.draw(batch, parentAlpha); } }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
public void draw (Batch batch, float parentAlpha) { // Use Stage#toScreenCoordinates, which we know is correct. toScreenCoordinates.set(testX, testY).sub(getOriginX(), getOriginY()).scl(getScaleX(), getScaleY()).rotate(getRotation()) .add(getOriginX(), getOriginY()).add(getX(), getY()); getStage().toScreenCoordinates(toScreenCoordinates, batch.getTransformMatrix()); // Do the same as toScreenCoordinates via Actor#localToParentCoordinates. localToAscendantCoordinates(null, localToParentCoordinates.set(testX, testY)); getStage().stageToScreenCoordinates(localToParentCoordinates); // System.out.println(name + " " + toScreenCoordinates + " " + localToParentCoordinates); batch.setColor(getColor()); batch.draw(region, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation()); super.draw(batch, parentAlpha); } }
@Override public void draw(Batch batch, float parentAlpha) { //textFactory.configureShader(batch); super.draw(batch, parentAlpha); }
/** If this method is overridden, the super method or {@link #validate()} should be called to ensure the widget group is laid * out. */ public void draw (Batch batch, float parentAlpha) { validate(); super.draw(batch, parentAlpha); } }
public void draw(Batch batch, float parentAlpha) { bg0.act(Gdx.graphics.getDeltaTime()); bg0.draw(batch, 1); super.draw(batch, parentAlpha); }
@Override public void draw(Batch batch, float alpha) { super.draw(batch, alpha); // DRAW TARGET DESCRIPTION String desc = iActor.getDesc(); if (desc != null) { float margin = DPIUtils.UI_SPACE; float textX = x - layout.width / 2; float textY = y - layout.height - DPIUtils.UI_SPACE; if (textX < 0) textX = 0; RectangleRenderer.draw(batch, textX - margin, textY - layout.height - margin, layout.width + margin*2, layout.height + margin*2, Color.BLACK); font.draw(batch, layout, textX, textY); } }
@Override public void draw(Batch batch, float parentAlpha) { final Vector2 position = model.body.getPosition(); this.setPosition(position.x*RADIO -model.drawableOffsetX,position.y*RADIO -model.drawableOffsetY); this.setRotation(MathUtils.radiansToDegrees * model.body.getAngle()); super.draw(batch, parentAlpha); } /**
@Override public void draw(Batch batch, float alpha) { // check if the interactive or visible property has change and hide it. if (!iActor.canInteract()) { hide(); return; } super.draw(batch, alpha); // DRAW TARGET DESCRIPTION String desc = iActor.getDesc(); if (desc != null) { float margin = DPIUtils.UI_SPACE; float textX = x - layout.width / 2; float textY = y - layout.height - DPIUtils.UI_SPACE; if (textX < 0) textX = 0; RectangleRenderer.draw(batch, textX - margin, textY - layout.height - margin, layout.width + margin * 2, layout.height + margin * 2, Color.BLACK); font.draw(batch, layout, textX, textY); } }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
@Override public void draw (Batch batch, float parentAlpha) { if (color != null) { batch.setColor(color); batch.draw(texture, getX(), getY(), getWidth(), getHeight()); batch.setColor(Color.WHITE); } super.draw(batch, parentAlpha); } }
@Override public void draw() { if (!getRoot().isVisible()) return; Engine.getSpriteBatch().begin(); getRoot().draw(Engine.getSpriteBatch(), 1); Engine.getSpriteBatch().end(); } }
super.draw(batch, parentAlpha); int len = animatedEntities.size(); for (int i = 0; i < len; i++) {
@Override public void draw(Batch batch, float parentAlpha) { float currentX = - parallaxGroup.getResult().speedTracker.x * parallaxRatio.x % ( this.getWidth() + padding.x) ; if(currentX>0){ currentX -= ( this.getWidth() + padding.x); } do{ this.setX(startPosition.x + currentX); float currentY = - parallaxGroup.getResult().speedTracker.y * parallaxRatio.y % ( this.getHeight() + padding.y) ; if(currentY>0){ currentY -= ( this.getHeight() + padding.y); } do{ this.setY(startPosition.y+currentY); super.draw(batch, parentAlpha); currentY += ( this.getHeight() + padding.y); }while(currentY < parallaxGroup.getHeight()); currentX += ( this.getWidth() + padding.x); }while(currentX < parallaxGroup.getWidth() ); } }
@Override public void draw(Batch batch, float parentAlpha) { float x = getX(); float y = getY(); float width = getWidth() * getScaleX(); float height = getHeight() * getScaleY(); Texture pageTexture = page.getTexture(); if (pageTexture != null) { if (firstPageRender) { firstPageRender = false; startPageAppearAnimation(); } Color col = getColor(); batch.setColor(col.r, col.g, col.b, col.a * parentAlpha * pageAlpha); batch.draw(pageTexture, x, y, width, height); } batch.setColor(Color.BLACK); borderFrame.draw(batch, x, y, width, height); // Draws children after all super.draw(batch, parentAlpha); }
@Override public void draw(SpriteBatch batch, float parentAlpha) { super.draw(batch, parentAlpha); // For fade out/in effect batch.setColor(this.getColor().r, this.getColor().g, this.getColor().b, parentAlpha * this.getColor().a); // DRAW TEXTURE REGION (Draw only if set active and not null) // ################################################################## if (isTextureRegionActive && textureRegion != null) { // Draw it due to actors' settings batch.draw(textureRegion, getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation()); } }
@Override public void drawStage(Stage stage) { endRendering(); Camera stageCamera = stage.getViewport().getCamera(); stageCamera.up.set(0, -1, 0); stageCamera.direction.set(0, 0, 1); stageCamera.update(); if (!stage.getRoot().isVisible()) { return; } renderingStage = true; beginRendering(); spriteBatch.setProjectionMatrix(stageCamera.combined); polygonSpriteBatch.setProjectionMatrix(stageCamera.combined); shapeRenderer.setProjectionMatrix(stageCamera.combined); spriteBatch.begin(); stage.getRoot().draw(spriteBatch, 1); spriteBatch.end(); endRendering(); renderingStage = false; }
@Override public void draw(Batch batch, float alpha) { Inventory inventory = sceneScreen.getUI().getWorld().getInventory(); if (!inventory.isVisible()) { setVisible(false); return; } if (style.background != null) { style.background.draw(batch, getX(), getY(), getWidth(), getHeight()); } // DRAW ITEMS int capacity = cols * rows; for (int i = 0; i < inventory.getNumItems() && i < capacity; i++) { SpriteActor a = inventory.get(i); ActorRenderer r = a.getRenderer(); float size = (tileSize - rowSpace) / (r.getHeight() > r.getWidth() ? r.getHeight() : r.getWidth()); float x = i % cols; float y = (rows - 1) - i / cols; if (style.itemBackground != null) { style.itemBackground.draw(batch, getX() + x * tileSize + x * rowSpace + margin, getY() + y * tileSize + y * rowSpace + margin, tileSize, tileSize); } r.draw((SpriteBatch) batch, getX() + x * tileSize + x * rowSpace + tileSize / 2 + margin, getY() + (tileSize - r.getHeight() * size) / 2 + y * tileSize + y * rowSpace + margin, size, size, 0f, a.getTint()); } super.draw(batch, alpha); }