Example #1
0
  public void onVideoInit(boolean use_gl2) {

    //		mView = new GodotView(getApplication(),io,use_gl2);
    //		setContentView(mView);

    layout = new FrameLayout(this);
    layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    setContentView(layout);

    // GodotEditText layout
    GodotEditText edittext = new GodotEditText(this);
    edittext.setLayoutParams(
        new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
    // ...add to FrameLayout
    layout.addView(edittext);

    mView = new GodotView(getApplication(), io, use_gl2, this);
    layout.addView(mView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    mView.setKeepScreenOn(true);

    edittext.setView(mView);
    io.setEdit(edittext);

    // Ad layout
    adLayout = new RelativeLayout(this);
    adLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
    layout.addView(adLayout);
  }
Example #2
0
  private void initializeGodot() {

    if (expansion_pack_path != null) {

      String[] new_cmdline;
      int cll = 0;
      if (command_line != null) {
        Log.d("GODOT", "initializeGodot: command_line: is not null");
        new_cmdline = new String[command_line.length + 2];
        cll = command_line.length;
        for (int i = 0; i < command_line.length; i++) {
          new_cmdline[i] = command_line[i];
        }
      } else {
        Log.d("GODOT", "initializeGodot: command_line: is null");
        new_cmdline = new String[2];
      }

      new_cmdline[cll] = "-main_pack";
      new_cmdline[cll + 1] = expansion_pack_path;
      command_line = new_cmdline;
    }

    io = new GodotIO(this);
    io.unique_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
    GodotLib.io = io;
    Log.d("GODOT", "command_line is null? " + ((command_line == null) ? "yes" : "no"));
    /*if(command_line != null){
        Log.d("GODOT", "Command Line:");
        for(int w=0;w <command_line.length;w++){
            Log.d("GODOT","   " + command_line[w]);
        }
    }*/
    GodotLib.initialize(this, io.needsReloadHooks(), command_line);
    mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME);

    result_callback = null;

    mPaymentsManager = PaymentsManager.createManager(this).initService();
    godot_initialized = true;
  }
Example #3
0
  @Override
  protected void onCreate(Bundle icicle) {

    super.onCreate(icicle);

    Window window = getWindow();
    window.addFlags(
        WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
            | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    io = new GodotIO(this);
    io.unique_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
    GodotLib.io = io;
    GodotLib.initialize(this, io.needsReloadHooks());
    mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
    mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);

    result_callback = null;

    //	instanceSingleton( new GodotFacebook(this) );

  }