Java 类com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderState 实例源码

项目:vtm    文件:GwtApplication.java   
@Override
public void onModuleLoad() {
    GwtApplication.agentInfo = computeAgentInfo();
    this.listener = getApplicationListener();
    this.config = getConfig();

    final PreloaderCallback callback = getPreloaderCallback();
    preloader = createPreloader();
    preloader.preload("assets.txt", new PreloaderCallback() {
        @Override
        public void error(String file) {
            callback.error(file);
        }

        @Override
        public void update(PreloaderState state) {
            callback.update(state);
            if (state.hasEnded()) {
                //getRootPanel().clear();
                setupLoop();
            }
        }
    });
}
项目:Mindustry    文件:HtmlLauncher.java   
@Override
   public PreloaderCallback getPreloaderCallback () {
    final Panel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
    logo.setStyleName("logo");      
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new PreloaderCallback() {

        @Override
        public void error (String file) {
            System.out.println("error: " + file);
        }

        @Override
        public void update (PreloaderState state) {
            meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
        }           

    };
}
项目:libgdxcn    文件:GwtApplication.java   
public PreloaderCallback getPreloaderCallback () {
    final Panel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
    logo.setStyleName("logo");      
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new PreloaderCallback() {

        @Override
        public void error (String file) {
            System.out.println("error: " + file);
        }

        @Override
        public void update (PreloaderState state) {
            meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
        }           

    };
}
项目:TinyVoxel    文件:GwtApplication.java   
public PreloaderCallback getPreloaderCallback () {
    final Panel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
    logo.setStyleName("logo");
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new PreloaderCallback() {

        @Override
        public void error (String file) {
            System.out.println("error: " + file);
        }

        @Override
        public void update (PreloaderState state) {
            meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
        }

    };
}
项目:vtm    文件:GwtLauncher.java   
@Override
public PreloaderCallback getPreloaderCallback() {
    return new PreloaderCallback() {

        @Override
        public void update(PreloaderState state) {
        }

        @Override
        public void error(String file) {
            //log.debug("error loading " + file);
        }
    };
}
项目:vtm    文件:GwtLauncher.java   
@Override
public PreloaderCallback getPreloaderCallback() {
    return new PreloaderCallback() {

        @Override
        public void update(PreloaderState state) {
        }

        @Override
        public void error(String file) {
            //log.debug("error loading " + file);
        }
    };
}