PlayN Tripleplay does not work with Android Nexus 7

I defined the main menus for my game using the PlayN Tripleplay framework. unfortunately I cannot display it on my Nexus 7.

What's really weird about this - if I run the Java version everything works fine, but whenever I run the Android version, nothing is displayed - the logs indicate that the entire UI is built

Anyone have any trouble using Tripleplay platform on Android - Java works great.

Here is the code:

public class MainMenuStateImpl extends AbstractState implements MenuState {

  private Interface ui;
  private GroupLayer groupLayer;

  @Inject
  public MainMenuStateImpl(StateManager stateManager) {
    super(stateManager);
  }

  @Override
  public void initialize() {
    PlayN.log().debug("initializing main menu");
    groupLayer = graphics().createGroupLayer();
    graphics().rootLayer().add(groupLayer);
    ui = new Interface();

    final Root root = ui.createRoot(AxisLayout.vertical().gap(15), SimpleStyles.newSheet());
    PlayN.log().debug("setting root to size " + graphics().width() + ", " + graphics().height());
    root.setSize(graphics().width(), graphics().height());
    stateManager.getImageCache().cache("img/menu_background.png", new Callback.Default<Image>() {

      @Override
      public void onSuccess(Image image) {
        // groupLayer.add(graphics().createImageLayer(image));
        root.addStyles(Style.BACKGROUND.is(Background.image(image)));
        groupLayer.add(root.layer);
        // graphics().rootLayer().add(root.layer);

        final Group buttons = new Group(AxisLayout.vertical().offStretch());
        root.add(new Label("RunRun:"), buttons);

        PlayN.log().debug("adding level groups to menu");
        final LevelGroupMetadataCache cache = (LevelGroupMetadataCache) stateManager.getContext()
        .get(ContextKeys.LEVEL_GROUP_METADATA_CACHE);
        for (final LevelGroupMetadata levelGroup : cache) {
          final Button button = new Button(levelGroup.getName());
          buttons.add(button);
          button.clicked().connect(new UnitSlot() {

            @Override
            public void onEmit() {
              stateManager.getContext().set(ContextKeys.LEVEL_GROUP,
              cache.get(levelGroup.getName()));
              stateManager.goTo(stateManager.getLevelGroupMenuState());
            }
          });
        }
        PlayN.log().debug("finished creating ui for main menu");
        PlayN.log().debug("ui = " + ui);
      }
    });
  }

  @Override
  public void destroy() {
    groupLayer.destroy();
  }

  @Override
  public void update(float delta) {
    ui.update(delta);
  }

  @Override
  public void paint(float alpha) {
    ui.paint(alpha);
  }
}

      

all boolean operators show up in my logcat - but nothing shows up - only in android - everything works fine when i run the java version ...

I have absolutely no idea how to fix this or what to do.

Any help would be greatly appreciated

+3


source to share





All Articles