VibratorTest.java :  » Game » libgdx » com » badlogic » gdx » tests » Android Open Source

Android Open Source » Game » libgdx 
libgdx » com » badlogic » gdx » tests » VibratorTest.java
package com.badlogic.gdx.tests;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.tests.utils.GdxTest;

public class VibratorTest extends GdxTest {

  @Override public boolean needsGL20 () {
    return false;
  }

  SpriteBatch batch;
  BitmapFont font;
  
  @Override
  public void create() {
    batch = new SpriteBatch();
    font = new BitmapFont();
  }
  
  @Override 
  public void render() {
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    batch.begin();
    font.draw(batch, "Touch screen to vibrate", 100, 100);
    batch.end();
    
    if(Gdx.input.justTouched())
      Gdx.input.vibrate(100);    
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.