當前位置: 首頁>>代碼示例>>Java>>正文


Java Batch.setTransformMatrix方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.g2d.Batch.setTransformMatrix方法的典型用法代碼示例。如果您正苦於以下問題:Java Batch.setTransformMatrix方法的具體用法?Java Batch.setTransformMatrix怎麽用?Java Batch.setTransformMatrix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.g2d.Batch的用法示例。


在下文中一共展示了Batch.setTransformMatrix方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: draw

import com.badlogic.gdx.graphics.g2d.Batch; //導入方法依賴的package包/類
@Override
public void draw(Batch batch) {
    age += Gdx.graphics.getDeltaTime();

    final float progress = age * INV_LIFETIME;
    final float currentSize = Interpolation.pow2In.apply(size, 0, progress);
    final float currentRotation = Interpolation.sine.apply(0, TOTAL_ROTATION, progress);

    final Matrix4 original = batch.getTransformMatrix().cpy();
    final Matrix4 rotated = batch.getTransformMatrix();

    final float disp =
            + 0.5f * (size - currentSize) // the smaller, the more we need to "push" to center
            + currentSize * 0.5f; // center the cell for rotation

    rotated.translate(pos.x + disp, pos.y + disp, 0);
    rotated.rotate(0, 0, 1, currentRotation);
    rotated.translate(currentSize * -0.5f, currentSize * -0.5f, 0); // revert centering for rotation

    batch.setTransformMatrix(rotated);
    Cell.draw(color, batch, 0, 0, currentSize);
    batch.setTransformMatrix(original);
}
 
開發者ID:LonamiWebs,項目名稱:Klooni1010,代碼行數:24,代碼來源:SpinEffect.java

示例2: draw

import com.badlogic.gdx.graphics.g2d.Batch; //導入方法依賴的package包/類
public void draw(final Batch batch) {
    batch.setTransformMatrix(batch.getTransformMatrix().translate(pos.x, pos.y, 0));

    for (int i = 0; i < cellCount; ++i)
        for (int j = 0; j < cellCount; ++j)
            cells[i][j].draw(batch);

    for (int i = effects.size; i-- != 0;) {
        effects.get(i).draw(batch);
        if (effects.get(i).isDone())
            effects.removeIndex(i);
    }

    batch.setTransformMatrix(batch.getTransformMatrix().translate(-pos.x, -pos.y, 0));
}
 
開發者ID:LonamiWebs,項目名稱:Klooni1010,代碼行數:16,代碼來源:Board.java


注:本文中的com.badlogic.gdx.graphics.g2d.Batch.setTransformMatrix方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。