mirror of
https://github.com/Klagarge/PokeHES.git
synced 2024-11-22 17:33:27 +00:00
battleScreen and testYann
This commit is contained in:
parent
b3cdc58ec6
commit
d522fff056
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -3,5 +3,6 @@
|
||||
"java.project.outputPath": "bin",
|
||||
"java.project.referencedLibraries": [
|
||||
"lib/**/*.jar"
|
||||
]
|
||||
],
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
}
|
||||
|
BIN
bin/Control/Controller.class
Normal file
BIN
bin/Control/Controller.class
Normal file
Binary file not shown.
BIN
bin/Entity/Character$Direction.class
Normal file
BIN
bin/Entity/Character$Direction.class
Normal file
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
BIN
bin/testYann.class
Normal file
Binary file not shown.
BIN
resources/font/OptimusPrinceps.ttf
Normal file
BIN
resources/font/OptimusPrinceps.ttf
Normal file
Binary file not shown.
BIN
resources/font/RobotoSlab-Regular.ttf
Normal file
BIN
resources/font/RobotoSlab-Regular.ttf
Normal file
Binary file not shown.
BIN
resources/font/Starjedi.ttf
Normal file
BIN
resources/font/Starjedi.ttf
Normal file
Binary file not shown.
BIN
resources/font/Timeless.ttf
Normal file
BIN
resources/font/Timeless.ttf
Normal file
Binary file not shown.
BIN
resources/font/ice_pixel-7.ttf
Normal file
BIN
resources/font/ice_pixel-7.ttf
Normal file
Binary file not shown.
@ -1,5 +1,57 @@
|
||||
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
47
src/testYann.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user