Android Open Source - wannabe Isometric






From Project

Back to project page wannabe.

License

The source code is released under:

MIT License

If you think the Android project wannabe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

// Copyright 2013 Patrick Forhan.
package wannabe.projection;
/*from  www.ja  v  a2 s .c  o m*/
import wannabe.Camera;
import wannabe.Position;
import wannabe.Rendered;
import wannabe.Voxel;

/**
 * Renders {@link Voxel}s with a constant size, but with an offset to represent height.
 * Larger heights are placed up and to the left, lower values are down and to the right.
 */
public class Isometric implements Projection {
  private final Rendered rendered = new Rendered();

  @Override public Rendered render(Camera camera, Position position, int pixelSize) {
    position = camera.translate(position);
    rendered.left = pixelSize * position.x - position.z + camera.uiPosition.left;
    rendered.top = pixelSize * position.y - position.z + camera.uiPosition.top;
    rendered.size = pixelSize;

    return rendered;
  }
}




Java Source Code List

android.util.ArrayUtils.java
android.util.SparseArray.java
android.util.SparseIntArray.java
wannabe.Camera.java
wannabe.Position.java
wannabe.Rendered.java
wannabe.UI.java
wannabe.Voxel.java
wannabe.android.MainActivity.java
wannabe.grid.FixedGrid.java
wannabe.grid.Grid.java
wannabe.grid.SimpleGrid.java
wannabe.projection.Flat.java
wannabe.projection.Isometric.java
wannabe.projection.Projection.java
wannabe.projection.Projections.java
wannabe.projection.PseudoPerspective.java
wannabe.swing.SettingsPanel.java
wannabe.swing.SwingWannabe.java
wannabe.swing.WannabePanel.java
wannabe.util.SampleGrids.java
wannabe.util.UIs.java