Java 类com.badlogic.gdx.Gdx 实例源码

项目:enklave    文件:ScreenChat.java   
public void Addtogroup(){
    grchatfaction = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Welcome Chat!"));
        grchatfaction.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.BLUE,"Faction!"));
        grchatfaction.addActor(labelTest1);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    sp = new ScrollPane(grchatfaction);
    sp.layout();
    sp.setScrollingDisabled(true, false);
    sp.setFillParent(true);sp.setLayoutEnabled(true);
    ta = new Table();
    ta.setFillParent(false);
    ta.add(sp).fill().expand();
    ta.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    ta.setVisible(false);
    groupbotttom.addActor(ta);
    sp.setScrollPercentY(200);
    sp.act(Gdx.graphics.getDeltaTime());
    sp.updateVisualScroll();
}
项目:Klooni1010    文件:VanishEffect.java   
@Override
public void draw(Batch batch) {
    vanishElapsed += Gdx.graphics.getDeltaTime();

    // vanishElapsed might be < 0 (delay), so clamp to 0
    float progress = Math.min(1f,
            Math.max(vanishElapsed, 0f) / vanishLifetime);

    // If one were to plot the elasticIn function, they would see that the slope increases
    // a lot towards the end- a linear interpolation between the last size + the desired
    // size at 20% seems to look a lot better.
    vanishSize = MathUtils.lerp(
            vanishSize,
            Interpolation.elasticIn.apply(cell.size, 0, progress),
            0.2f
    );

    float centerOffset = cell.size * 0.5f - vanishSize * 0.5f;
    Cell.draw(vanishColor, batch, cell.pos.x + centerOffset, cell.pos.y + centerOffset, vanishSize);
}
项目:drc-sim-client    文件:StageLoad.java   
/**
 * Loading stage
 * @param doLoad should resources be loaded? It acts as a splash screen otherwise.
 */
public StageLoad(boolean doLoad) {
    this.doLoad = doLoad;
    // Create icon
    icon = new Image(new Texture("image/icon-512.png"));
    int size = Gdx.graphics.getHeight();
    if (Gdx.graphics.getHeight() > Gdx.graphics.getWidth())
        size = Gdx.graphics.getWidth();
    icon.setSize(size, size);
    icon.setPosition(Gdx.graphics.getWidth() / 2 - size / 2,
            Gdx.graphics.getHeight() / 2 - icon.getHeight() / 2);
    addActor(icon);
    // Loading Text
    Label.LabelStyle loadingStyle = new Label.LabelStyle();
    loadingStyle.font = new BitmapFont(Gdx.files.internal("font/collvetica.fnt"));
    loadingStyle.font.getData().setScale(Gdx.graphics.getHeight() * 2 / 720);
    loading = new Label("DRC Sim", loadingStyle);
    loading.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight() * .2f);
    loading.setAlignment(Align.center);
    addActor(loading);
}
项目:enklave    文件:ScreenChat.java   
public void addchatlocation(){
    grchatlocation = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.RED,"Welcome Chat!"));
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.GREEN,"Location!"));
        grchatlocation.addActor(labelTest);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    scrollchatpublic = new ScrollPane(grchatlocation);
    scrollchatpublic.layout();
    scrollchatpublic.setScrollingDisabled(true, false);
    scrollchatpublic.setFillParent(true);
    scrollchatpublic.setLayoutEnabled(true);
    tablechatpublic = new Table();
    tablechatpublic.setFillParent(false);
    tablechatpublic.add(scrollchatpublic).fill().expand();
    tablechatpublic.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    groupbotttom.addActor(tablechatpublic);
    scrollchatpublic.setScrollPercentY(100);
    scrollchatpublic.act(Gdx.graphics.getDeltaTime());
    scrollchatpublic.updateVisualScroll();
}
项目:ProjektGG    文件:BaseUIScreen.java   
@Override
public void render(float delta) {
    Gdx.gl.glClearColor(backgroundColor.r, backgroundColor.g,
            backgroundColor.b, backgroundColor.a);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    game.getSpriteBatch().begin();

    if (backgroundTexture != null)
        game.getSpriteBatch().draw(this.backgroundTexture, 0, 0,
                game.getViewportWidth(), game.getViewportHeight());

    game.getSpriteBatch().setProjectionMatrix(game.getUICamera().combined);

    stage.act(delta);
    stage.draw();

    game.getSpriteBatch().end();
}
项目:ProjektGG    文件:ScreenshotUtils.java   
public static void takeScreenshot() {
    byte[] pixels = ScreenUtils.getFrameBufferPixels(0, 0,
            Gdx.graphics.getBackBufferWidth(),
            Gdx.graphics.getBackBufferHeight(), true);

    Pixmap pixmap = new Pixmap(Gdx.graphics.getBackBufferWidth(),
            Gdx.graphics.getBackBufferHeight(), Pixmap.Format.RGBA8888);
    BufferUtils.copy(pixels, 0, pixmap.getPixels(), pixels.length);

    SimpleDateFormat dateFormat = new SimpleDateFormat(
            "yyyy-MM-dd HH-mm-ss");

    PixmapIO.writePNG(
            Gdx.files.external(dateFormat.format(new Date()) + ".png"),
            pixmap);
    pixmap.dispose();
}
项目:Klooni1010    文件:PauseMenuStage.java   
@Override
public void draw() {
    if (shown) {
        // Draw an overlay rectangle with not all the opacity
        // This is the only place where ShapeRenderer is OK because the batch hasn't started
        Gdx.gl.glEnable(GL20.GL_BLEND);
        shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
        Color color = new Color(Klooni.theme.bandColor);
        color.a = 0.1f;
        shapeRenderer.setColor(color);
        shapeRenderer.rect(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        shapeRenderer.end();
    }

    super.draw();
}
项目:Tower-Defense-Galaxy    文件:FileHandler.java   
public static List<Spawn> loadSpawns(BufferedReader data) {
    if (data == null)
        return null;
    List<Spawn> spawns = new ArrayList<com.logicmaster63.tdgalaxy.map.Spawn>();
    try {
        int spawnNum = Integer.parseInt(data.readLine());
        for (int i = 0; i < spawnNum; i++) {
            int repeatNum = Integer.parseInt(data.readLine());
            String name = data.readLine();
            int delay = Integer.parseInt(data.readLine());
            for (int j = 0; j < repeatNum; j++)
                spawns.add(new Spawn(name, delay));
            data.close();
        }
    } catch (IOException e) {
        Gdx.app.error("Error", e.toString());
    }
    return spawns;
}
项目:Cubes_2    文件:DedicatedServer.java   
private static Save getSave(CubesCmdLineOptions.ServerCmdLineOptions options) {
    FileHandle worldFolder = Compatibility.get().getBaseFolder().child("world");
    if (options.worldFolder != null)
        worldFolder = Gdx.files.absolute(options.worldFolder);
    Save save = new Save("world", worldFolder);
    if (save.readSaveOptions() == null) {
        SaveOptions saveOptions = save.getSaveOptions();
        if (options.worldSeedString != null)
            saveOptions.setWorldSeed(options.worldSeedString);
        if (options.worldGenerator != null)
            saveOptions.worldType = options.worldGenerator;
        if (options.worldGamemode != null)
            saveOptions.worldGamemode = options.worldGamemode;
    }
    return save;
}
项目:Flappy-Baranus    文件:GameOver.java   
public GameOver(GameStateManager gsm, int score) {
    super(gsm);
    this.score = score;
    camera.setToOrtho(false, FlappyBaran.WIDTH / 2, FlappyBaran.HEIGHT / 2);
    background = new Texture("backgrnd.jpg");
    gameover = new Texture("gameover.png");
    font = new BitmapFont();
    prefs = Gdx.app.getPreferences("FlappyBaran");

    if (!prefs.contains("highScore")) {
        prefs.putInteger("highScore", 0);
    }

    prevHighScore = getHighScore();

    if (prevHighScore < this.score) {
        setHighScore(this.score);
        highscore = this.score;
    } else {
        highscore = prevHighScore;
    }

}
项目:NoRiskNoFun    文件:LobbyScene.java   
private void initImageButtons() {

        if (!sceneData.isGameHost()) {
            return; // player is not hosting - don't offer the player to start the game.
        }

        imageButtonStartGame = new ImageButtonSceneObject(sceneData.createImageButton(Assets.START_GAME_BUTTON_FILENAME), buttonPressedSound);
        imageButtonStartGame.setBounds((Gdx.graphics.getWidth() / 2.0f) - 137.5f, Gdx.graphics.getHeight() / 10.0f, 275f, 240f);
        imageButtonStartGame.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                sceneData.sendMessageFromGui(new StartGameClicked());
            }
        });
        addSceneObject(imageButtonStartGame);
        imageButtonStartGame.setDisabled();
    }
项目:NoRiskNoFun    文件:ClientConnectedState.java   
@Override
public void handleOutboundMessage(Message message) {

    if (message instanceof DisconnectClient) {
        handleDisconnect(((DisconnectClient)message).isTerminateClient());
        return;
    }

    try {
        byte[] data = new MessageSerializer(message).serialize();
        write(data);
    } catch (IOException | ProtocolException e) {
        Gdx.app.error(getClass().getSimpleName(), "Handling outbound message failed", e);
        handleDisconnect(true);
    }
}
项目:enklave    文件:ProgressBarEnergy.java   
public void downenergy(int value){
    bar.act(Gdx.graphics.getDeltaTime());
    infoProfile.getDateUserGame().setEnergy(infoProfile.getDateUserGame().getEnergy() - value);
    FadeIn();
    new Timer().schedule(new Timer.Task() {
        @Override
        public void run() {
            bar.setAnimateDuration(3);
            bar.setValue((float) infoProfile.getDateUserGame().getEnergy());
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            mapsScreen.startTimer();
        }
    }, 1000);
}
项目:NoRiskNoFun    文件:WaitingForNextTurnState.java   
@Override
public void handleMessage(String senderId, Message message) {
    if(message.getType().equals(NextPlayer.class)){
        setNextPlayer(((NextPlayer)message).getPlayername());
    } else if (message.getType().equals(IsAttacked.class)) {
        context.setState(new AttackState(context, false));
    } else if (message.getType().equals(AttackResult.class)) { // react on broadcast attack result as we have to update the regions
        updateRegions((AttackResult)message);
    } else if (message.getType().equals(SpawnTroop.class)) {
        doSpawnTroop((SpawnTroop) message);
    } else if (message.getType().equals(MoveTroop.class)) {
        doMoveTroop((MoveTroop) message);
    }
    else{
        Gdx.app.log("WaitingForNextTurnState","unknown messgae:"+message.getType().getSimpleName());
    }
}
项目:enklave    文件:ScreenRooms.java   
@Override
    public void show() {
        if(drawone){
            addroomselect();
            addButtonBottom();
            addPuls();
            addimagebg();
            addbuildRoom();
            addtimerbuildroom();
            drawone = false;
        }
        cameraGroupStrategy = new CameraGroupStrategy(camera);
//        CameraInputController controller = new CameraInputController(camera);
        stage = new Stage(new StretchViewport(Gdx.graphics.getWidth(),Gdx.graphics.getHeight()));
        batchsprite = new SpriteBatch();
        addtostage();
        batch = new DecalBatch(this.cameraGroupStrategy);
        Gdx.input.setCatchBackKey(true);
        InputMultiplexer inputmulti = new InputMultiplexer();
        inputmulti.addProcessor(stage);
        Gdx.input.setInputProcessor(inputmulti);
    }
项目:Cubes_2    文件:AssetFinder.java   
private static void extractAssets(URL jar, AssetManager assetManager) {
    String assets = "assets";
    try {
        ZipInputStream zip = new ZipInputStream(getInputStream(jar));
        ZipEntry ze = zip.getNextEntry();
        while (ze != null) {
            String name = ze.getName().replace("\\", "/");
            if (name.startsWith(assets) && !ze.isDirectory()) {
                name = name.substring(ze.getName().lastIndexOf(assets) + assets.length() + 1);
                assetManager.assets.put(name, new Asset(assetManager, name, Gdx.files.internal(ze.getName())));
            }
            ze = zip.getNextEntry();
        }
        zip.close();
    } catch (Exception e) {
        Log.error("Failed to extract assets", e);
    }
}
项目:gdx-gamesvcs    文件:GpgsClient.java   
public boolean connect(boolean autoStart) {
    if (mGoogleApiClient == null) {
        Gdx.app.error(GAMESERVICE_ID, "Call initialize first.");
        throw new IllegalStateException();
    }

    if (isSessionActive())
        return true;

    Gdx.app.log(GAMESERVICE_ID, "Trying to connect with autostart " + autoStart);
    mAutoStartSignInflow = autoStart;
    mSignInClicked = !autoStart;
    isConnectionPending = true;
    mGoogleApiClient.connect();

    return true;
}
项目:feup-lpoo-armadillo    文件:LevelMenuScreen.java   
/**
 * {@inheritDoc}
 */
@Override
public void show() {
    super.show();

    // Table containing the Level Buttons
    Table levels = new Table();
    levels.top();
    levels.padTop(TOP_EDGE);
    createLevelButtons(levels);

    // Table containing the Static Elements
    Table staticElements = new Table();
    staticElements.setFillParent(true);
    createStaticElements(staticElements, levels);

    stage.addActor(staticElements);
    Gdx.input.setInputProcessor(stage);
}
项目:school-game    文件:AudioManager.java   
/**
 * Erstellt einen Sound in der Sound-Datenbank und lädt ihn.
 *
 * @see AudioManager#createSound(String, String)
 * @see AudioManager#unloadSound(SoundKey)
 * @see AudioManager#playSound(SoundKey)
 * @see AudioManager#playSound(SoundKey, float)
 *
 * @param group zu welcher Gruppe gehört der Sound?
 * @param name der Name der Sounddatei mit Endung
 * @param autoUnload true damit der Sound beim Beenden ohne Warnung entladen wird. Sparsam benutzen.
 * @return ein Verweis auf den Sound der zum Abspielen benutzt werden kann
 */
public SoundKey createSound(String group, String name, boolean autoUnload)
{
    String soundId = group + "/" +name;

    if (soundMap.containsKey(soundId))
        return new SoundKey(soundId);

    Sound sound = Gdx.audio.newSound(Gdx.files.internal("data/sound/" + soundId));
    soundMap.put(soundId, sound);

    SoundKey soundKey = new SoundKey(soundId);

    if (autoUnload)
        autoUnloadSounds.add(soundKey);

    return soundKey;
}
项目:gdx-gamesvcs    文件:GameJoltClient.java   
protected void sendOpenSessionEvent() {
    if (!isSessionActive())
        return;

    Map<String, String> params = new HashMap<String, String>();
    addGameIDUserNameUserToken(params);

    final Net.HttpRequest http = buildJsonRequest("sessions/open/", params);

    if (http != null)
        Gdx.net.sendHttpRequest(http, new NoOpResponseListener());

    pingTask = Timer.schedule(new Timer.Task() {
        @Override
        public void run() {
            sendKeepSessionOpenEvent();
        }
    }, GJ_PING_INTERVAL, GJ_PING_INTERVAL);

}
项目:enklave    文件:ScreenCombat.java   
private void drawdefenders(){
    defenders = new DrawDefenders();
    groupBtnDefender = new Group();
    Button btn1 = new Button(new ImageButton.ImageButtonStyle());
    btn1.setName("btn1");
    btn1.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn1.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f - Gdx.graphics.getHeight() * 0.14f);
    groupBtnDefender.addActor(btn1);
    Button btn2 = new Button(new ImageButton.ImageButtonStyle());
    btn2.setName("btn2");
    btn2.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn2.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f);
    groupBtnDefender.addActor(btn2);
    Button btn3 = new Button(new ImageButton.ImageButtonStyle());
    btn3.setName("btn3");
    btn3.setSize(Gdx.graphics.getWidth() * 0.18f, Gdx.graphics.getWidth() * 0.2f);
    btn3.setPosition(Gdx.graphics.getWidth() * 0.025f, Gdx.graphics.getHeight() / 2.3f + Gdx.graphics.getHeight() * 0.14f);
    groupBtnDefender.addActor(btn3);
}
项目:Parasites-of-HellSpace    文件:Rocket.java   
@Override
public void update(Player player)
{
    posY -= speed * Gdx.graphics.getDeltaTime();
    sprite.setPosition(posX, posY);
    lifeTime--;
    flashLTime--;

    if(lifeTime < 0)
        alive = false;
    if(flashLTime < 0)
        stopRenderFlash = true;

    if(player != null && SIUtils.intersectsWith(this.sprite, player.getSprite()))
    {
        this.alive = false;
        if(!player.isGodMode())
            player.setHealth(player.getHealth() - damage);
    }
}
项目:summer17-android    文件:Level1.java   
@Override
protected void handleInput() {
    if (Gdx.input.justTouched()) {
        if (a == 1) {
            sheep.jump();
        }
        if (a == 2) {
            cow.jump();
        }
        if (a == 3) {
            pig.jump();
        }
        if (a == 4) {
            bunny.jump();
        }
        if (a == 5) {
            chick.jump();
        }
    }
}
项目:NoRiskNoFun    文件:LibGdxAssetCache.java   
/**
 * Generate new bitmap font.
 *
 * @param fontDescriptor Descriptor object describing font properties.
 * @return Newly generated bitmap font.
 */
private static BitmapFont generateFont(FontDescriptor fontDescriptor) {

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal(fontDescriptor.getFontFilename()));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.color = fontDescriptor.getForegroundColor();
    parameter.size = fontDescriptor.getFontSize();
    parameter.borderWidth = fontDescriptor.getBorderWidth();
    parameter.borderColor = fontDescriptor.getBorderColor();
    parameter.borderStraight = fontDescriptor.isStraightBorderUsed();
    BitmapFont font = generator.generateFont(parameter);
    generator.dispose();

    return font;
}
项目:INFSEN01-2    文件:Program.java   
@Override
   public void render () {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

this.batch.begin();
this.batch.draw(this.backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
       this.guiManager.update(this.updateVisitor, Gdx.graphics.getDeltaTime());
       this.guiManager.draw(this.drawVisitor);
this.batch.end();
   }
项目:school-game    文件:MenuState.java   
/**
 * Aufräumarbeiten.
 */
@Override
public void dispose() {
    Gdx.app.getApplicationLogger().log("INFO", "Menu dispose...");

    entries.clear();

    batch.dispose();

    Gdx.app.getApplicationLogger().log("INFO", "Menu leave.");
}
项目:SpaceGame    文件:SelectionSystem.java   
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
    if (checkProcessing() && button == Buttons.LEFT) {
        Vector3 vec = camera.unproject(new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0));
        selectionBegin = new Vector2(vec.x, vec.y);
        return true;
    }
    return false;
}
项目:Cubes_2    文件:CameraController.java   
private void update(float forward, float backward, float left, float right, boolean jump, boolean descend) {
    int deltaTime = Gdx.graphics.getRawDeltaTime();

    updateIf(deltaTime);

    tryMove();
    boolean onBlock = WorldGravity.onBlock(Cubes.getClient().world, Cubes.getClient().player.position,
            Player.PLAYER_HEIGHT, Player.PLAYER_RADIUS);

    if (flying) {

        innestedIf1(jump, onBlock);

    } else if (jumping) {
        if (!jump) {
            Cubes.getClient().player.motion.y = Math.min(JUMP_RELEASE_VELOCITY, Cubes.getClient().player.motion.y);
            jumping = false;
        }
    } else {
        if (jump && onBlock) {
            Cubes.getClient().player.motion.y = JUMP_START_VELOCITY;
            jumping = true;
        }
    }

    innestedIf2(jump, deltaTime);

}
项目:KyperBox    文件:KyperMapLoader.java   
public TiledMap load(String fileName, AtlasTiledMapLoaderParameters parameter) {

        try {
            if (parameter != null) {
                convertObjectToTileSpace = parameter.convertObjectToTileSpace;
                flipY = parameter.flipY;
            } else {
                convertObjectToTileSpace = false;
                flipY = true;
            }

            FileHandle tmxFile = resolve(fileName);
            root = xml.parse(tmxFile);
            ObjectMap<String, TextureAtlas> atlases = new ObjectMap<String, TextureAtlas>();
            FileHandle atlasFile = Gdx.files
                    .internal(KyperBoxGame.IMAGE_FOLDER + KyperBoxGame.FILE_SEPARATOR + KyperBoxGame.GAME_ATLAS);
            if (atlasFile == null) {
                throw new GdxRuntimeException("Couldn't load atlas");
            }

            TextureAtlas atlas = new TextureAtlas(atlasFile);
            atlases.put(atlasFile.path(), atlas);

            AtlasResolver.DirectAtlasResolver atlasResolver = new AtlasResolver.DirectAtlasResolver(atlases);
            TiledMap map = loadMap(root, tmxFile, atlasResolver);
            map.setOwnedResources(atlases.values().toArray());
            setTextureFilters(parameter.textureMinFilter, parameter.textureMagFilter);
            return map;
        } catch (IOException e) {
            throw new GdxRuntimeException("Couldn't load tilemap '" + fileName + "'", e);
        }
    }
项目:guitar-finger-trainer    文件:TrainingScreen.java   
private void update() {
    if (Gdx.input.justTouched()) {
        this.guiCam.unproject(this.touchPoint.set(Gdx.input.getX(), Gdx.input.getY(), 0));

        if (this.backBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            this.game.setScreen(new LevelScreen(this.game));
            return;
        }
        if (this.playPauseBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            SettingsUtil.playEnabled = !SettingsUtil.playEnabled;
            return;
        }
        if (this.restartBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            this.firstRun = 3;
            this.grid.currentPosition = 0;
            this.grid.forward = true;
            return;
        }
        if (this.backFowardtBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            SettingsUtil.backForwardEnabled = !SettingsUtil.backForwardEnabled;
            return;
        }
        if (this.soundBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            SettingsUtil.soundEnabled = !SettingsUtil.soundEnabled;
            return;
        }
        if (this.minusBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            if (SettingsUtil.bpm > 1) {
                SettingsUtil.bpm--;
                this.bpm = MINUTE_IN_MILLIS / SettingsUtil.bpm;
            }
            return;
        }
        if (this.plusBounds.contains(this.touchPoint.x, this.touchPoint.y)) {
            SettingsUtil.bpm++;
            this.bpm = MINUTE_IN_MILLIS / SettingsUtil.bpm;
        }
    }
}
项目:summer17-android    文件:YouWon.java   
@Override
public void render(SpriteBatch sb) {
    sb.begin();
    sb.draw(black, 0, 0, GameTutorial.WIDTH, GameTutorial.HEIGHT);
    sb.end();

    stage.act(Gdx.graphics.getDeltaTime());
    stage.draw();

}
项目:FlappyChapa    文件:GameOverState.java   
@Override
public void handleInput() {
    if (Gdx.input.justTouched()) {
        music.stop();
        gsm.set(new MenuState(gsm));
    }
}
项目:NoRiskNoFun    文件:ClientContext.java   
public void setState(State state) {

        if (state == null) {
            throw new IllegalArgumentException("state is null");
        }

        Gdx.app.log(getClass().getSimpleName(), this.state.getClass().getSimpleName() + " -> " + state.getClass().getSimpleName());
        data.setCurrentStateName(state.getClass().getSimpleName());
        data.setChangedFlag(true);

        this.state.exit();
        this.state=state;
        this.state.enter();
    }
项目:INFSEN01-2    文件:GDXDrawingAdapter.java   
@Override
public void drawRectangle(Point top_left, Float width, Float height, CustomColor color) {
    this.batch.draw(
            this.textureWhite,
            top_left.getX(),
            Gdx.graphics.getHeight() - (top_left.getY() + height),
            width, height);
}
项目:JGame    文件:GameScreen.java   
public void updateTitle(boolean onMap) {

        if (onMap) {
            Gdx.graphics.setTitle("JGame " + Integer.toString(Gdx.graphics.getFramesPerSecond()) + " FPS "
                    + eHandler.tileHover(eHandler.handleMouseX(deltaTime), eHandler.handleMouseY(deltaTime)).GetType()
                    + " " + entity.buildPercentage + "%");
        } else {
            Gdx.graphics.setTitle("JGame " + Integer.toString(Gdx.graphics.getFramesPerSecond()) + " FPS "
                    + "No Tile Selected" + " " + entity.buildPercentage + "%");
        }

    }
项目:MMORPG_Prototype    文件:AuthenticationState.java   
public AuthenticationState(Client client, StateManager states)
{
    this.client = client;
    this.states = states;
    authenticationDialog = new AuthenticationDialog(this);
    authenticationDialog.show(stage);
    Gdx.input.setInputProcessor(stage);
    try
    {
        Thread.sleep(100);
    } catch (InterruptedException e)
    {
        e.printStackTrace();
    }
}
项目:PixelDungeonTC    文件:PixelScene.java   
@Override
public void draw() {
    if (light) {
        Gdx.gl.glBlendFunc( GL20.GL_SRC_ALPHA, GL20.GL_ONE );
        super.draw();
        Gdx.gl.glBlendFunc( GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA );
    } else {
        super.draw();
    }
}
项目:Parasites-of-HellSpace    文件:HealthPack.java   
public HealthPack() 
{
    posX = MathUtils.random(350)+ 50;
    posY = Gdx.graphics.getHeight();
    speed = 150f;
    texture = AssetLoader.assetManager.get("medkit.png", Texture.class);
    powerUpSound = AssetLoader.assetManager.get("powerupsnd.wav", Sound.class);
    sprite = new Sprite(texture);
    sprite.setOriginCenter();
    sprite.setScale(0.7f);
    sprite.setPosition(posX, posY);
}
项目:LibGDX-SplashScreen-Example    文件:Core.java   
@Override
public void render() {
    Gdx.gl.glClearColor(1, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    batch.begin();
    batch.draw(img, 0, 0);
    batch.end();
}
项目:Onyx    文件:FTFGeneratorCache.java   
/**
 * Returns a {@link FreeTypeFontGenerator} that generates a {@link BitmapFont} with a specified path
 *
 * @param fontPath the path of the desired font, relative to {@link Gdx#files#internal()}
 *
 * @return the requested {@link FreeTypeFontGenerator}
 */
public static FreeTypeFontGenerator getFTFGenerator(String fontPath) {
    if (fontPath.equals("default")) throw new IllegalArgumentException("fontPath must not be default, use getDefaultFTFGenerator() instead");
    if (cache.containsKey(fontPath)) return cache.get(fontPath);
    else {
        cache.put(fontPath, new FreeTypeFontGenerator(Gdx.files.internal(fontPath)));
        return cache.get(fontPath);
    }
}