1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-23 01:43:28 +00:00

battleScreen and testYann

This commit is contained in:
Fastium 2022-06-08 09:53:51 +02:00
parent b3cdc58ec6
commit d522fff056
20 changed files with 102 additions and 2 deletions

View File

@ -3,5 +3,6 @@
"java.project.outputPath": "bin", "java.project.outputPath": "bin",
"java.project.referencedLibraries": [ "java.project.referencedLibraries": [
"lib/**/*.jar" "lib/**/*.jar"
] ],
"java.configuration.updateBuildConfiguration": "interactive"
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/testYann.class Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
resources/font/Starjedi.ttf Normal file

Binary file not shown.

BIN
resources/font/Timeless.ttf Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,57 @@
package Screen; package Screen;
public class ScreenBattle { import ch.hevs.gdx2d.components.screen_management.RenderingScreen;
import ch.hevs.gdx2d.desktop.PortableApplication;
import ch.hevs.gdx2d.lib.GdxGraphics;
import java.io.File;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeType.Bitmap;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
import com.badlogic.gdx.utils.Align;
public class ScreenBattle extends RenderingScreen{
private BitmapFont optimus40;
@Override
public void onInit() {
//display the question
generateFont("resources//font//OptimusPrinceps.ttf", optimus40, 100, Color.WHITE);
}
@Override
public void onGraphicRender(GdxGraphics g) {
g.clear(Color.GREEN);
g.drawStringCentered(g.getScreenHeight()/2, "question", optimus40);
}
@Override
public void dispose() {
optimus40.dispose();
}
public void generateFont(String file, BitmapFont bitmapFont, int height, Color c ){
FileHandle fileHandle = Gdx.files.internal(file);
FreeTypeFontParameter parameter = new FreeTypeFontParameter();
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(fileHandle);
parameter.size = generator.scaleForPixelHeight(height);
parameter.color = c;
optimus40 = generator.generateFont(parameter);
generator.dispose();
}
} }

47
src/testYann.java Normal file
View File

@ -0,0 +1,47 @@
import Screen.ScreenBattle;
import ch.hevs.gdx2d.desktop.PortableApplication;
import ch.hevs.gdx2d.lib.GdxGraphics;
import ch.hevs.gdx2d.lib.ScreenManager;
public class testYann extends PortableApplication{
private ScreenManager s = new ScreenManager();
ScreenBattle b;
public static void main(String[] args) {
new testYann();
}
testYann(){
super(1000, 800);
}
@Override
public void onInit() {
b = new ScreenBattle();
s.registerScreen(b.getClass());
}
@Override
public void onGraphicRender(GdxGraphics g) {
s.render(g);
}
@Override
public void onKeyDown(int keycode) {
// TODO Auto-generated method stub
super.onKeyDown(keycode);
}
@Override
public void onKeyUp(int keycode) {
// TODO Auto-generated method stub
super.onKeyUp(keycode);
}
}