本文整理汇总了Java中com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy类的典型用法代码示例。如果您正苦于以下问题:Java FillResolutionStrategy类的具体用法?Java FillResolutionStrategy怎么用?Java FillResolutionStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FillResolutionStrategy类属于com.badlogic.gdx.backends.android.surfaceview包,在下文中一共展示了FillResolutionStrategy类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initializeForView
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
public View initializeForView(ApplicationListener paramApplicationListener, AndroidApplicationConfiguration paramAndroidApplicationConfiguration)
{
if (paramAndroidApplicationConfiguration.resolutionStrategy == null);
for (Object localObject = new FillResolutionStrategy(); ; localObject = paramAndroidApplicationConfiguration.resolutionStrategy)
{
this.graphics = new AndroidGraphics(this, paramAndroidApplicationConfiguration, (ResolutionStrategy)localObject);
this.input = new AndroidInput(this, this.graphics.view, paramAndroidApplicationConfiguration);
this.audio = new AndroidAudio(this, paramAndroidApplicationConfiguration);
this.files = new AndroidFiles(getAssets(), getFilesDir().getAbsolutePath());
this.listener = paramApplicationListener;
this.handler = new Handler();
Gdx.app = this;
Gdx.input = getInput();
Gdx.audio = getAudio();
Gdx.files = getFiles();
Gdx.graphics = getGraphics();
createWakeLock(paramAndroidApplicationConfiguration);
return this.graphics.getView();
}
}
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:21,代码来源:AndroidApplication.java
示例2: initialize
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
graphics = new AndroidGraphicsLiveWallpaper(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
// factory in use, but note: AndroidInputFactory causes exceptions when obfuscated: java.lang.RuntimeException: Couldn't
// construct AndroidInput, this should never happen, proguard deletes constructor used only by reflection
input = AndroidInputFactory.newAndroidInput(this, this.getService(), graphics.view, config);
// input = new AndroidInput(this, this.getService(), null, config);
audio = new AndroidAudio(this.getService(), config);
// added initialization of android local storage: /data/data/<app package>/files/
this.getService().getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getService().getAssets(), this.getService().getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
// Unlike activity, fragment and daydream applications there's no need for a specialized audio listener.
// See description in onPause method.
Gdx.app = this;
Gdx.input = input;
Gdx.audio = audio;
Gdx.files = files;
Gdx.graphics = graphics;
Gdx.net = net;
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:31,代码来源:AndroidLiveWallpaper.java
示例3: init
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
private void init (ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
graphics = new CardBoardGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, this, graphics.view, config);
audio = new AndroidAudio(this, config);
this.getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
this.useImmersiveMode = config.useImmersiveMode;
this.hideStatusBar = config.hideStatusBar;
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume () {
// No need to resume audio here
}
@Override
public void pause () {
audio.pause();
}
@Override
public void dispose () {
audio.dispose();
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
if (!isForView) {
try {
requestWindowFeature(Window.FEATURE_NO_TITLE);
} catch (Exception ex) {
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(graphics.getView(), createLayoutParams());
setCardboardView((CardboardView)graphics.getView());
}
createWakeLock(config.useWakelock);
hideStatusBar(this.hideStatusBar);
useImmersiveMode(this.useImmersiveMode);
if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
}
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:69,代码来源:CardBoardAndroidApplication.java
示例4: init
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
private void init(ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, this.getContext(), graphics.getView(), config);
audio = new AndroidAudio(this.getContext(), config);
this.getContext().getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getContext().getAssets(), this.getContext().getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
this.useImmersiveMode = config.useImmersiveMode;
this.hideStatusBar = config.hideStatusBar;
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume() {
// No need to resume audio here
}
@Override
public void pause() {
audio.pause();
}
@Override
public void dispose() {
audio.dispose();
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
if (!isForView) {
try {
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
} catch (Exception ex) {
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(graphics.getView(), createLayoutParams());
}
createWakeLock(config.useWakelock);
hideStatusBar(this.hideStatusBar);
useImmersiveMode(this.useImmersiveMode);
if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
}
开发者ID:SiliconLabs,项目名称:thunderboard-android,代码行数:69,代码来源:GdxDemoActivity.java
示例5: init
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
private void init (ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, this, graphics.view, config);
audio = new AndroidAudio(this, config);
this.getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
this.useImmersiveMode = config.useImmersiveMode;
this.hideStatusBar = config.hideStatusBar;
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume () {
// No need to resume audio here
}
@Override
public void pause () {
audio.pause();
}
@Override
public void dispose () {
audio.dispose();
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
if (!isForView) {
try {
requestWindowFeature(Window.FEATURE_NO_TITLE);
} catch (Exception ex) {
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(graphics.getView(), createLayoutParams());
}
createWakeLock(config.useWakelock);
hideStatusBar(this.hideStatusBar);
useImmersiveMode(this.useImmersiveMode);
if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:68,代码来源:AndroidApplication.java
示例6: initializeForView
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
/** This method has to be called in the
* {@link Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)} method. It sets up all
* the things necessary to get input, render via OpenGL and so on. You can configure other aspects of the application with the
* rest of the fields in the {@link AndroidApplicationConfiguration} instance.
* <p/>
* Note: you have to return the returned view from
* {@link Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)}
*
* @param listener the {@link ApplicationListener} implementing the program logic
* @param config the {@link AndroidApplicationConfiguration}, defining various settings of the application (use accelerometer,
* etc.).
* @return the GLSurfaceView of the application */
public View initializeForView (ApplicationListener listener, AndroidApplicationConfiguration config) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, getActivity(), graphics.view, config);
audio = new AndroidAudio(getActivity(), config);
files = new AndroidFiles(getResources().getAssets(), getActivity().getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume () {
audio.resume();
}
@Override
public void pause () {
audio.pause();
}
@Override
public void dispose () {
audio.dispose();
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
createWakeLock(config.useWakelock);
useImmersiveMode(config.useImmersiveMode);
if (config.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
return graphics.getView();
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:65,代码来源:AndroidFragmentApplication.java
示例7: init
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
private void init (ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {
graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
: config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, this, graphics.view, config);
audio = new AndroidAudio(this, config);
this.getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume () {
audio.resume();
}
@Override
public void pause () {
audio.pause();
}
@Override
public void dispose () {
audio.dispose();
audio = null;
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
if (!isForView) {
setFullscreen(true);
setContentView(graphics.getView(), createLayoutParams());
}
createWakeLock(config.useWakelock);
hideStatusBar(config);
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:47,代码来源:AndroidDaydream.java
示例8: initialize
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
@Override
/**
* {@inheritDoc}
*/
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
}
//Reordered to make using Gdx.app, Gdx.graphics etc possible (due to AndroidBackend.getGdxInput)
graphics = new AndroidGraphics(this, config,
config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy);
audio = new AndroidAudio(this, config);
this.getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
this.useImmersiveMode = config.useImmersiveMode;
this.hideStatusBar = config.hideStatusBar;
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume () {
// No need to resume audio here
}
@Override
public void pause () {
//audio.pause(); //screw it, world shall explode as I can't change it...
}
@Override
public void dispose () {
audio.dispose();
}
});
Gdx.app = this;
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
input = ((AndroidBackend)BackendHelper.backend).getGdxInput();
if (input == null) {
input = AndroidInputFactory.newAndroidInput(this, this, graphics.getView(), config);
}
Gdx.input = this.getInput();
try {
requestWindowFeature(Window.FEATURE_NO_TITLE);
} catch (Exception ex) {
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(graphics.getView(), createLayoutParams());
createWakeLock(config.useWakelock);
hideStatusBar(this.hideStatusBar);
useImmersiveMode(this.useImmersiveMode);
if (this.useImmersiveMode && getVersion() >= 19) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
}
开发者ID:0x0ade,项目名称:shadow-engine,代码行数:78,代码来源:MainActivity.java
示例9: init
import com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy; //导入依赖的package包/类
private void init(ApplicationListener listener, AndroidMini2DxConfig config, boolean isForView) {
if (this.getVersion() < MINIMUM_SDK) {
throw new GdxRuntimeException("mini2Dx requires Android API Level " + MINIMUM_SDK + " or later.");
}
setApplicationLogger(new AndroidApplicationLogger());
graphics = new AndroidMini2DxGraphics(this, config,
config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy);
input = AndroidInputFactory.newAndroidInput(this, this, graphics.view, config);
audio = new AndroidAudio(this, config);
this.getFilesDir(); // workaround for Android bug #10515463
files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
net = new AndroidNet(this);
this.listener = listener;
this.handler = new Handler();
this.useImmersiveMode = config.useImmersiveMode;
this.hideStatusBar = config.hideStatusBar;
this.clipboard = new AndroidClipboard(this);
// Add a specialized audio lifecycle listener
addLifecycleListener(new LifecycleListener() {
@Override
public void resume() {
// No need to resume audio here
}
@Override
public void pause() {
audio.pause();
}
@Override
public void dispose() {
audio.dispose();
}
});
Gdx.app = this;
Gdx.input = this.getInput();
Gdx.audio = this.getAudio();
Gdx.files = this.getFiles();
Gdx.graphics = this.getGraphics();
Gdx.net = this.getNet();
if (!isForView) {
try {
requestWindowFeature(Window.FEATURE_NO_TITLE);
} catch (Exception ex) {
log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(graphics.getView(), createLayoutParams());
}
createWakeLock(config.useWakelock);
hideStatusBar(this.hideStatusBar);
useImmersiveMode(this.useImmersiveMode);
if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
try {
Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
Object o = vlistener.newInstance();
Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
method.invoke(o, this);
} catch (Exception e) {
log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
}
}
}
开发者ID:mini2Dx,项目名称:mini2Dx,代码行数:71,代码来源:AndroidMini2DxGame.java
注:本文中的com.badlogic.gdx.backends.android.surfaceview.FillResolutionStrategy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论