标签:
1 if (Gdx.input.isTouched()) { 2 System.out.println("Input occurred at x="+Gdx.input.getX() +", y="+Gdx.input.getY()); 3 }
1 GL20 gl =Gdx.graphics.getGL20 (); 2 gl.glClearColor(1f, 0.0f, 0.0f, 1); 3 gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
1 Texture myTexture =newTexture(Gdx.files.internal(“assets/texture/brick.png”));
1 Music music =Gdx.audio.newMusic(Gdx.files.getFileHandle("data/myMusicFile.mp3", FileType.Internal)); 2 music.setVolume(0.5f); 3 music.play(); 4 music.setLooping(true);
1 switch (Gdx.app.getType()) { 2 case Android:// android specific codebreak; 3 case Desktop:// desktop specific codebreak; 4 case WebGl:// HTML5 specific codebreak; 5 default:// Other platforms specific code 6 }
1 int androidVersion =Gdx.app.getVersion();
1 long javaHeap =Gdx.app.getJavaHeap(); 2 long nativeHeap =Gdx.app.getNativeHeap();
【开源java游戏框架libgdx专题】-05-模块描述与上下文
标签:
原文地址:http://www.cnblogs.com/AIThink/p/5837418.html