<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:textSize="24sp"
android:textColor= "#FF0000"
android:background="#99000000"
/>
int mHighScoreCoin = prefs.getInt(PreferenceConstants.PREFERENCE_COINS_COLLECTED, 0);
TextView text = (TextView) findViewById(R.id.text);
text.setText("Current High Score: " + mHighScoreCoin);
public int intToDigitArray(int value, int[] digits) {
int characterCount = 1;
if (value >= 1000) {characterCount = 4;}
else if (value >= 100) {characterCount = 3;}
else if (value >= 10) {characterCount = 2;}
int remainingValue = value;int count = 0;
do {
int index = remainingValue != 0 ? remainingValue % 10 : 0;
remainingValue /= 10;
digits[characterCount - 1 - count] = index;
count++;
} while (remainingValue > 0 && count < digits.length);
if (count < digits.length) {digits[count] = -1;}
return characterCount;
}
…
mdrawScore = findViewById(R.id.drawScore);
…
if(mdrawScore !=null){
HudSystem hud = new HudSystem();
int[] mCoinDigitsForMenu;
mCoinDigitsForMenu = new int[4];
hud.intToDigitArray(mHighScoreCoin, mCoinDigitsForMenu);
}
}
--
You received this message because you are subscribed to the Google Groups "ReplicaIsland Coding Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to replica-island-coding...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.