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


Java Image.setRotation方法代碼示例

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


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

示例1: updateImage

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
private void updateImage() {
    Image toUse;
    Image toRemove;
    if (currentIndex % 2 == 0) { // even
        toUse = dia;
        toRemove = orto;
    } else {
        toUse = orto;
        toRemove = dia;
    }
    toRemove.remove();
    group.addActor(toUse);
    toUse.setRotation(getRotation(currentIndex));
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:15,代碼來源:RotateODImagesSubView.java

示例2: visualize

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
@Override public IFuture<Void> visualize(final T result) {
    final Future<Void> future = Future.make();
    final WorldObjectView actorView = visualizer.viewController.getView(result.getActor());
    WorldObjectView targetView = visualizer.viewController.getView(result.getTarget());
    visualizer.viewController.world.dispatcher.dispatch(ResultVisualizer.VISUALIZE_ATTACK, result.getActor());
    Vector2 direction = tmp
        .set(result.getTarget().getX(), result.getTarget().getY())
        .sub(result.getActor().getX(), result.getActor().getY());

    float dx = targetView.getX() - actorView.getX();
    float dy = targetView.getY() - actorView.getY();
    visualizer.viewController.scroller.centerOn(result.getTarget());

    final Image arrow = new Image(Config.skin,"animation/" + result.getAbility().name + "-shot");
    arrow.setPosition(actorView.getX(), actorView.getY());
    visualizer.viewController.effectLayer.addActor(arrow);
    arrow.setOrigin(13, 14);
    arrow.setRotation(direction.angle() - 45);
    arrow.addAction(Actions.sequence(
        Actions.moveBy(dx, dy, tmp.set(dx, dy).len() * 0.002f),
        Actions.run(new Runnable() {
            @Override public void run() {
                SoundManager.instance.playSoundIfExists(result.getAbility().soundName);
                arrow.remove();
                future.happen();
            }
        })
    ));
    return future;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:31,代碼來源:CommonShotVisualizer.java

示例3: addBackgroundObject

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
private void addBackgroundObject(boolean anywhere) {
    final Image image = new Image(backgroundDrawables.random());
    backgroundLayer.addActor(image);


    float scale = 0.5f * MathUtils.random(1, 2);
    image.setSize(image.getPrefWidth() * scale, image.getPrefHeight() * scale);
    image.setRotation(MathUtils.random(0, 1) * 180);
    image.getColor().a = MathUtils.random(0.1f, 0.3f);

    float w = Math.max(world.stage.getWidth(), root.getWidth() + ViewScroller.LEFT + ViewScroller.RIGHT);
    float h = Math.max(world.stage.getHeight(), root.getHeight() + ViewScroller.TOP + ViewScroller.BOTTOM);

    if (anywhere)
        image.setPosition(-root.getX() + w * MathUtils.random(), -root.getY() + h * MathUtils.random());
    else
        image.setPosition(-root.getX() - image.getWidth(), -root.getY() + h * MathUtils.random());

    image.addAction(Actions.sequence(
        Actions.moveBy(w + image.getWidth() - image.getX(), 0, 15 + MathUtils.random(6)),
        Actions.run(new Runnable() {
            @Override public void run() {
                image.remove();
                addBackgroundObject(false);
            }
        })
    ));
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:29,代碼來源:ViewController.java

示例4: addTopRightCornerTransition

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addTopRightCornerTransition(String name, int x, int y, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    layer.addActor(image);
    image.setRotation(-90);
    image.setPosition(x * CELL_SIZE, (y + 1) * CELL_SIZE);
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java

示例5: addBottomLeftCornerTransition

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addBottomLeftCornerTransition(String name, int x, int y, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    layer.addActor(image);
    image.setRotation(90);
    image.setPosition((x + 1) * CELL_SIZE, (y) * CELL_SIZE);
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java

示例6: addBottomRightCornerTransition

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addBottomRightCornerTransition(String name, int x, int y, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("transitions/" + name + "-corner").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    layer.addActor(image);
    image.setRotation(180);
    image.setPosition((x + 1) * CELL_SIZE, (y + 1) * CELL_SIZE);
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java

示例7: addLeftOutline

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addLeftOutline(int x, int y, String name, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    image.setRotation(180);
    layer.addActor(image);
    image.setPosition(x * CELL_SIZE + image.getWidth(), (y + 1) * CELL_SIZE);
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java

示例8: addBottomOutline

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addBottomOutline(int x, int y, String name, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    image.setRotation(-90);
    layer.addActor(image);
    image.setPosition(x * CELL_SIZE, y * CELL_SIZE + image.getWidth());
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java

示例9: addTopOutline

import com.badlogic.gdx.scenes.scene2d.ui.Image; //導入方法依賴的package包/類
public static Image addTopOutline(int x, int y, String name, Group layer) {
    TextureAtlas.AtlasRegion region = Config.findRegions("tile/" + name + "-outline").random();
    if (region == null)
        return null;
    Image image = new Image(region);
    image.setRotation(90);
    layer.addActor(image);
    image.setPosition((x + 1) * CELL_SIZE, (y + 1) * CELL_SIZE - image.getWidth());
    return image;
}
 
開發者ID:ratrecommends,項目名稱:dice-heroes,代碼行數:11,代碼來源:ViewController.java


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