當前位置: 首頁>>代碼示例>>Java>>正文


Java GwtApplication類代碼示例

本文整理匯總了Java中com.badlogic.gdx.backends.gwt.GwtApplication的典型用法代碼示例。如果您正苦於以下問題:Java GwtApplication類的具體用法?Java GwtApplication怎麽用?Java GwtApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GwtApplication類屬於com.badlogic.gdx.backends.gwt包,在下文中一共展示了GwtApplication類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: screenshot

import com.badlogic.gdx.backends.gwt.GwtApplication; //導入依賴的package包/類
public void screenshot(String filename) {
	CanvasElement canvas = ((GwtApplication) Gdx.app).getCanvasElement();
	// base64 encoded PNG file using data URL encoding! send this to your server
	String dataUrl = canvas.toDataUrl("image/png");
	// just opening it in a new window, replace this with whatever you want to do with the data
	Window.open(dataUrl, "_blank", "");
}
 
開發者ID:DaanVanYperen,項目名稱:ns2-scc-profiler,代碼行數:8,代碼來源:ScreenshotHelper.java

示例2: FileHandleStream

import com.badlogic.gdx.backends.gwt.GwtApplication; //導入依賴的package包/類
public FileHandleStream (String path) {
	super(((GwtApplication)Gdx.app).getPreloader(), path, FileType.Internal);
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:4,代碼來源:FileHandleStream.java

示例3: uploadPalette

import com.badlogic.gdx.backends.gwt.GwtApplication; //導入依賴的package包/類
@Override
public void uploadPalette(int width, int height) {
    Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
    WebGLRenderingContext.getContext(((GwtApplication) Gdx.app).getCanvasElement()).texImage2D(GL20.GL_TEXTURE_2D, 0, GL20.GL_RGBA, width, height, 0,
            GL20.GL_RGBA,
            GL20.GL_UNSIGNED_BYTE, paletteBuffer);
}
 
開發者ID:neuroradiology,項目名稱:TinyVoxel,代碼行數:8,代碼來源:GwtConfig.java

示例4: uploadSinglePalette

import com.badlogic.gdx.backends.gwt.GwtApplication; //導入依賴的package包/類
@Override
public void uploadSinglePalette(int paletteId) {
    Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
    WebGLRenderingContext.getContext(((GwtApplication) Gdx.app).getCanvasElement()).texSubImage2D(GL20.GL_TEXTURE_2D, 0, 0, paletteId, Config.TINY_GRID_TOTAL, 1,
            GL20.GL_RGBA,
            GL20.GL_UNSIGNED_BYTE, tinyPaletteBuffer);
}
 
開發者ID:neuroradiology,項目名稱:TinyVoxel,代碼行數:8,代碼來源:GwtConfig.java

示例5: create

import com.badlogic.gdx.backends.gwt.GwtApplication; //導入依賴的package包/類
@Override
public void create() {

	GwtGdxGraphics.init();
	GdxAssets.init("");
	CanvasAdapter.textScale = 0.7f;
	GLAdapter.init((GL) Gdx.graphics.getGL20());
	GLAdapter.GDX_WEBGL_QUIRKS = true;
	MapRenderer.setBackgroundColor(0xffffff);

	JsMap.init(mMap);

	if (GwtApplication.agentInfo().isLinux() &&
	        GwtApplication.agentInfo().isFirefox())
		GwtGdxGraphics.NO_STROKE_TEXT = true;

	MapConfig c = MapConfig.get();
	super.create();

	MapPosition p = new MapPosition();
	p.setZoomLevel(c.getZoom());
	p.setPosition(c.getLatitude(), c.getLongitude());

	MapUrl mapUrl = new MapUrl(mMap);
	mapUrl.parseUrl(p);
	mapUrl.scheduleRepeating(5000);
}
 
開發者ID:opensciencemap,項目名稱:vtm,代碼行數:28,代碼來源:GwtMap.java


注:本文中的com.badlogic.gdx.backends.gwt.GwtApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。