@Override public Preloader.PreloaderCallback getPreloaderCallback() { final VerticalPanel preloaderPanel = new VerticalPanel(); preloaderPanel.setStyleName("gdx-preloader"); preloaderPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); final Image logo = new Image(GWT.getModuleBaseURL() + "logo.gif"); 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, Style.Unit.PCT); meterPanel.add(meter); preloaderPanel.add(meterPanel); getRootPanel().add(preloaderPanel); return new Preloader.PreloaderCallback() { @Override public void error(String file) { System.out.println("error: " + file); } @Override public void update(Preloader.PreloaderState state) { meterStyle.setWidth(100f * state.getProgress(), Style.Unit.PCT); } }; }
public GwtFileHandle (Preloader preloader, String fileName, FileType type) { if (type != FileType.Internal && type != FileType.Classpath) throw new GdxRuntimeException("FileType '" + type + "' Not supported in GWT backend"); this.preloader = preloader; this.file = fixSlashes(fileName); this.type = type; }
public Preloader createPreloader() { return new Preloader(getPreloaderBaseURL()); }
public Preloader getPreloader () { return preloader; }
public GwtFiles (Preloader preloader) { this.preloader = preloader; }
public Preloader getPreloader() { return preloader; }