Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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