@Override
  protected void layout() {

    height = 32;

    shield.size(width, shield.height);

    avatar.x = PixelScene.align(camera(), shield.x + 15 - avatar.width / 2);
    avatar.y = PixelScene.align(camera(), shield.y + 16 - avatar.height / 2);

    compass.x = avatar.x + avatar.width / 2 - compass.origin.x;
    compass.y = avatar.y + avatar.height / 2 - compass.origin.y;

    hp.x = 30;
    hp.y = 3;

    depth.x = width - 24 - depth.width() - 18;
    depth.y = 6;

    keys.y = 6;

    danger.setPos(width - danger.width(), 18);

    buffs.setPos(31, 9);

    btnMenu.setPos(width - btnMenu.width(), 1);
  }
Exemplo n.º 2
0
  public void onClick_startNavigate(View view) {
    userLatitude = Float.valueOf(userLatitudeTxt.getText().toString());
    userLongitude = Float.valueOf(userLongitudeTxt.getText().toString());

    compass = new Compass(this);

    compass.adjustArrow();
  }
Exemplo n.º 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_compass);

    compass = new Compass(this);
    compass.arrowView = (ImageView) findViewById(R.id.main_image_hands);

    userLatitudeTxt = (EditText) findViewById(R.id.Latitude);
    userLongitudeTxt = (EditText) findViewById(R.id.Longitude);

    findMyCurrentLocation();
  }
Exemplo n.º 4
0
 @Override
 public void onCompassPointerRotate(int roseAngle, int needleAngle) {
   compass.rotateRose(roseAngle);
   compass.rotateNeedle(needleAngle);
 }
Exemplo n.º 5
0
 @Override
 protected void onStop() {
   super.onStop();
   Log.d(TAG, "stop compass");
   compass.stop();
 }
Exemplo n.º 6
0
 @Override
 protected void onResume() {
   super.onResume();
   compass.start();
 }
Exemplo n.º 7
0
 @Override
 protected void onPause() {
   super.onPause();
   compass.stop();
 }