use of com.badlogic.gdx.graphics.g2d.SpriteBatch in project Alkahest-Coffee by AlkahestDev.
the class fakeMainGame method create.
@Override
public void create() {
viewport = new FitViewport(1080, 720, new PerspectiveCamera());
batch = new SpriteBatch();
img = new Texture("badAlkahest.png");
// Creating the menu
menu.create(MenuState.MAIN);
Gdx.input.setInputProcessor(menu);
}
use of com.badlogic.gdx.graphics.g2d.SpriteBatch in project myFirstGame by Juicebox47.
the class MyFirstGame method create.
@Override
public void create() {
spriteBatch = new SpriteBatch();
gameStateManager = new GameStateManager(new Stack<State>(), new OrthographicCamera(), new Vector3());
Gdx.gl.glClearColor(0, 0, 0, 0);
gameStateManager.push(new MenuState(gameStateManager));
}
use of com.badlogic.gdx.graphics.g2d.SpriteBatch in project gdx-skineditor by cobolfoo.
the class SkinEditorGame method create.
@Override
public void create() {
opt = new OptionalChecker();
fm = new SystemFonts();
fm.refreshFonts();
// Create projects folder if not already here
FileHandle dirProjects = new FileHandle("projects");
if (dirProjects.isDirectory() == false) {
dirProjects.mkdirs();
}
// Rebuild from raw resources, kind of overkill, might disable it for production
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.combineSubdirectories = true;
TexturePacker.process(settings, "resources/raw/", ".", "resources/uiskin");
batch = new SpriteBatch();
skin = new Skin();
atlas = new TextureAtlas(Gdx.files.internal("resources/uiskin.atlas"));
skin.addRegions(new TextureAtlas(Gdx.files.local("resources/uiskin.atlas")));
skin.load(Gdx.files.local("resources/uiskin.json"));
screenMain = new MainScreen(this);
screenWelcome = new WelcomeScreen(this);
setScreen(screenWelcome);
}
use of com.badlogic.gdx.graphics.g2d.SpriteBatch in project libgdx by libgdx.
the class FreeTypeMetricsTest method create.
@Override
public void create() {
spriteBatch = new SpriteBatch();
atlas = new TextureAtlas("data/pack");
smallFont = new BitmapFont();
FreeTypeFontParameter parameter = new FreeTypeFontParameter();
parameter.size = 60;
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("data/arial.ttf"));
font = generator.generateFont(parameter);
generator.dispose();
renderer = new ShapeRenderer();
renderer.setProjectionMatrix(spriteBatch.getProjectionMatrix());
}
use of com.badlogic.gdx.graphics.g2d.SpriteBatch in project libgdx by libgdx.
the class FreeTypePackTest method create.
@Override
public void create() {
camera = new OrthographicCamera();
batch = new SpriteBatch();
long start = System.currentTimeMillis();
int glyphCount = createFonts();
long time = System.currentTimeMillis() - start;
text = glyphCount + " glyphs packed in " + regions.size + " page(s) in " + time + " ms";
}
Aggregations