I recently learned learning libgdx little information very difficult. Want to join a gravity sensor function but do not know which place should be added (in some places, but no matter the gravity changed) online that InputMode gravity sensor but the application can accept nothing. Find Great God help thank you.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I do not know that they have read point there is no use gravity.x = Gdx.input.getAccelerometerX ();
gravity.y = Gdx.input.getAccelerometerY ();
Reply:
Results posted usage above.
Reply:
public static String bSubstring (String s, int length) throws Exception
{
byte [] bytes = s.getBytes ("Unicode");
int n = 0; / / represents the current number of bytes
int i = 2; number of bytes to be intercepted / / start from the first three bytes
for (; i
/ / Odd position, such as 3,5,7, is the second byte of the two byte encoding UCS2
if (i% 2 == 1)
{
n + +; / / in the second byte UCS2 n plus 1
}
else
{
/ / When the first byte UCS2 encoding is not equal to 0, the UCS2 character is Kanji, a two-byte characters count
if (bytes [i]! = 0)
{
n + +;
}
}
}
/ / If i is odd, even processed into
if (i% 2 == 1)
{
/ / This is the kanji characters UCS2 when removing the cut half of the characters
if (bytes [i - 1]! = 0)
i = i - 1;
/ / The UCS2 character is a letter or number, then retain the character
else
i = i + 1;
}
return new String (bytes, 0, i, "Unicode");
}
Reply:
Thank LZ, are you saying ..
Cough ~ Thank LZ.
No comments:
Post a Comment