Created
July 3, 2015 20:21
-
-
Save iammert/f83cefb26647ae30212a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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