This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 良くない例:画面いっぱいになってしまうので実際の画面の縦横比に影響されて、縦長or横長になってしまう | |
camera = new OrthographicCamera(); | |
camera.setToOrtho(false, 640, 400); | |
batch.setProjectionMatrix(camera.combined); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// テクスチャー読み込み (256x256 px) | |
img = new Texture("badlogic.jpg"); | |
// スプライト初期化 | |
sprite = new Sprite( new TextureRegion(img,0,0,256,256)); | |
sprite.setSize(256, 256); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* pseudo Coroutine for Java "Corouchan" | |
* コルーチンもどき クラス | |
* 派生してaction()をオーバーライドして使ってね。 | |
* @author F/T | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2011 F/T | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Serializable; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Modifier; | |
public class HelloWorld implements Serializable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderer.begin(ShapeType.Filled); | |
renderer.setColor(1, 0, 1, 0.5f); | |
renderer.rect(450, 50, 300, 300); | |
Gdx.gl.glEnable(GL20.GL_BLEND); | |
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); | |
renderer.end(); | |
Gdx.gl.glDisable(GL20.GL_BLEND); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyGdxApp implements ApplicationListener { | |
// 画面の論理座標 | |
static private final float WIDTH =320; | |
static private final float HEIGHT =640; | |
// カウンター(renderが呼ばれるたびにカウントアップ) | |
int count; | |
// Gdx用変数 | |
OrthographicCamera camera; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dokokano.gdxappforandroidonly; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.widget.Toast; | |
import com.badlogic.gdx.ApplicationListener; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.backends.android.AndroidApplication; | |
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dokokano.gdxappwithseveralmsgbox; | |
import com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.graphics.Texture; | |
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
public class MyGdxGame extends ApplicationAdapter { | |
SpriteBatch batch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dokokano.gdxappwithseveralmsgbox.android; | |
import android.app.AlertDialog; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import com.badlogic.gdx.backends.android.AndroidApplication; | |
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; | |
import com.dokokano.gdxappwithseveralmsgbox.MessageBoxShowable; |
OlderNewer