Skip to content

Instantly share code, notes, and snippets.

@iammert
Created July 3, 2015 20:21
Show Gist options
  • Save iammert/f83cefb26647ae30212a to your computer and use it in GitHub Desktop.
Save iammert/f83cefb26647ae30212a to your computer and use it in GitHub Desktop.
private int mWidth;
private int mHeight;
private float mCenterX;
private float mCenterY;
...
@Override
public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
super.onSurfaceChanged(holder, format, width, height);
mWidth = width;
mHeight = height;
//Genişliği ve yüksekliği ikiye bölerek saatin merkezini hesaplıyoruz.
//İşlemlerde float değerler kullanmanız gerekmektedir.
mCenterX = mWidth / 2f;
mCenterY = mHeight / 2f;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment