use of space.earlygrey.shapedrawer.ShapeDrawer in project jbump by implicit-invocation.
the class TestBump method create.
@Override
public void create() {
spriteBatch = new SpriteBatch();
// Create a TextureRegion containing a single, white pixel to enable rendering with ShapeDrawer.
Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.drawPixel(0, 0);
texture = new Texture(pixmap);
pixmap.dispose();
TextureRegion textureRegion = new TextureRegion(texture, 0, 0, 1, 1);
shapeDrawer = new ShapeDrawer(spriteBatch, textureRegion);
camera = new OrthographicCamera();
gameViewport = new ExtendViewport(10, 10, camera);
uiViewport = new ScreenViewport();
shapeDrawer.update();
font = new BitmapFont();
mode = POINT;
world = new World<Entity>(1f);
entities = new Array<Entity>();
String[] lines = MAP.split("\n");
for (int j = 0; j < lines.length; j++) {
String line = lines[j];
for (int i = 0; i < line.length(); i++) {
if (line.charAt(i) == '+') {
entities.add(new WallEntity(i, lines.length - j));
} else if (line.charAt(i) == 'p') {
entities.add(new PlayerEntity(i, lines.length - j));
}
}
}
}
use of space.earlygrey.shapedrawer.ShapeDrawer in project skin-composer by raeleus.
the class Main method create.
@Override
public void create() {
appFolder = Gdx.files.external(".skincomposer/");
skin = new FreeTypeSkin(Gdx.files.internal("skin-composer-ui/skin-composer-ui.json"));
viewport = new ScreenViewport();
// viewport.setUnitsPerPixel(.5f);
stage = new Stage(viewport);
Gdx.input.setInputProcessor(stage);
shapeDrawer = new ShapeDrawer(stage.getBatch(), skin.getRegion("white"));
graphDrawer = new GraphDrawer(shapeDrawer);
initDefaults();
populate();
resizeUiScale(projectData.getUiScale());
}
Aggregations