mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-12-27 23:49:03 +00:00
the Android version is now able to access honeycomb rules via assets
This commit is contained in:
@@ -48,6 +48,8 @@ import android.widget.FrameLayout.LayoutParams;
|
||||
import android.widget.Toast;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
public class HyperRogue extends Activity implements SensorEventListener {
|
||||
|
||||
private static final int RESULT_SETTINGS = 1;
|
||||
@@ -626,6 +628,18 @@ public class HyperRogue extends Activity implements SensorEventListener {
|
||||
pon.getTextBounds(s,0,s.length(),bounds);
|
||||
return bounds.width();
|
||||
}
|
||||
|
||||
public byte[] getAsset(String s) {
|
||||
try {
|
||||
InputStream is = getAssets().open(s);
|
||||
int length = is.available();
|
||||
byte[] data = new byte[length];
|
||||
is.read(data);
|
||||
return data;
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private SensorManager mSensorManager;
|
||||
private Sensor mSensor;
|
||||
|
||||
Reference in New Issue
Block a user