示例#1
0
  @Override
  public void dispose() {
    super.dispose();

    res.dispose();
    textureAtlas.dispose();
    batch.dispose();
  }
示例#2
0
 @Override
 public void dispose() {
   super.dispose();
   instances.clear();
   blocks.clear();
   invaders.clear();
   assets.dispose();
   modelBatch.dispose();
 }
 @Override
 public void resume() {
   super.resume();
   atlas = DefaultResources.getIconAtlas();
   region = atlas.findRegion("haunting");
   for (Monster mon : monsters) {
     mon.entity =
         display.animateActor(
             mon.entity.gridX,
             mon.entity.gridY,
             region,
             fgCenter.filter(display.getPalette().get(11)),
             true);
   }
 }
  @Override
  public void resize(int width, int height) {
    super.resize(width, height);

    // message box won't respond to clicks on the far right if the stage hasn't been updated with a
    // larger size
    currentZoomX = width * 1f / (this.width * 2);
    // total new screen height in pixels divided by total number of rows on the screen
    currentZoomY = height * 1f / (this.height + messages.getGridHeight());
    // message box should be given updated bounds since I don't think it will do this automatically
    messages.setBounds(0, 0, width, currentZoomY * messages.getGridHeight());
    // SquidMouse turns screen positions to cell positions, and needs to be told that cell sizes
    // have changed
    input.reinitialize(
        currentZoomX, currentZoomY, (this.width * 2), this.height, 0, 0, width, height);
    currentZoomX = cellWidth / currentZoomX;
    currentZoomY = cellHeight / currentZoomY;
    input.update(width, height, true);
    stage.getViewport().update(width, height, true);
  }
示例#5
0
  @Override
  public void create() {
    super.create();
    modelBatch = new ModelBatch();
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
    environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

    cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    cam.position.set(0f, 7f, 10f);
    cam.lookAt(0, 0, 0);
    cam.near = 1f;
    cam.far = 300f;
    cam.update();

    camController = new CameraInputController(cam);
    Gdx.input.setInputProcessor(camController);

    assets = new AssetManager();
    assets.load("data/invaderscene5.g3dj", Model.class);

    loading = true;
  }
 @Override
 public void dispose() {
   stage.dispose();
   super.dispose();
 }
 @Override
 public void dispose() {
   super.dispose();
   batch.dispose();
   atlas.dispose();
 }
示例#8
0
 @Override
 public void resize(int width, int height) {
   super.resize(width, height);
 }
示例#9
0
 @Override
 public void resume() {
   super.resume();
 }
示例#10
0
 @Override
 public void pause() {
   super.pause();
 }