当前位置: 首页>>代码示例>>Java>>正文


Java Resolution类代码示例

本文整理汇总了Java中com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution的典型用法代码示例。如果您正苦于以下问题:Java Resolution类的具体用法?Java Resolution怎么用?Java Resolution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Resolution类属于com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver包,在下文中一共展示了Resolution类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectBestResolution

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
private void selectBestResolution() {
	bestDesc = descriptors[0];
	
	int width = Gdx.graphics.getWidth() > Gdx.graphics.getHeight() ?Gdx.graphics.getWidth():Gdx.graphics.getHeight();
	
	int bestDist = Math.abs(width - bestDesc.portraitWidth);

	for (int i = 1; i < descriptors.length; i++) {
		Resolution other = descriptors[i];
		int dist =  Math.abs(width - other.portraitWidth);
		
		if (dist < bestDist) {
			bestDesc = descriptors[i];
			bestDist = dist;
		}
	}
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:18,代码来源:EngineResolutionFileResolver.java

示例2: initializeValues

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public static void initializeValues(Resolution[] resolutions){
	Resolution r = ResolutionFileResolver.choose(resolutions);
	
	float multiplier = 1;
	
	if(r.folder.equals("1")){
		multiplier = 0.80f;
		RES_MULTIPLIER = 6f;
	}else if(r.folder.equals("0.66")){
		multiplier = 0.60f;
		RES_MULTIPLIER = 4f;
	}else if(r.folder.equals("0.416")){
		multiplier = 0.400f;
		RES_MULTIPLIER = 2.5f;
	}else{
		multiplier = 0.16f;
		RES_MULTIPLIER = 1f;
	}

	MINPADDING = (int)(MINPADDING*multiplier);
	WINDOW_PADDING_Y = (int)(WINDOW_PADDING_Y*multiplier);
	WINDOW_PADDING_X = (int)(WINDOW_PADDING_X*multiplier);
	
	MIN_BUTTON_HEIGHT = (int)(MIN_BUTTON_HEIGHT * multiplier);
	MIN_BTN_WIDTH = (int)(MIN_BTN_WIDTH * multiplier);
	SLIDER_WIDTH = (int)(SLIDER_WIDTH * multiplier);
	
	PIXELS_PER_METER_X = (int)(PIXELS_PER_METER_X*multiplier);
	
	MIN_BTN_SELECT_WIDTH = (int)(MIN_BTN_SELECT_WIDTH*multiplier);
}
 
开发者ID:unlimitedggames,项目名称:gdxjam-ugg,代码行数:32,代码来源:GUIConfig.java

示例3: create

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public void create () {
	Gdx.app.setLogLevel(Application.LOG_ERROR);

	Resolution[] resolutions = {new Resolution(320, 480, ".320480"), new Resolution(480, 800, ".480800"),
		new Resolution(480, 856, ".480854")};
	ResolutionFileResolver resolver = new ResolutionFileResolver(new InternalFileHandleResolver(), resolutions);
	manager = new AssetManager();
	manager.setLoader(Texture.class, new TextureLoader(resolver));
	manager.setErrorListener(this);
	load();
	Texture.setAssetManager(manager);
	batch = new SpriteBatch();
	font = new BitmapFont(Gdx.files.internal("data/font.fnt"), false);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:15,代码来源:AssetManagerTest.java

示例4: setScale

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public void setScale(int worldWidth, int worldHeight) {
	Resolution r[] = getResolutions(resResolver.getBaseResolver(), worldWidth, worldHeight);

	if (r == null || r.length == 0) {
		EngineLogger.error("No resolutions defined. Maybe your 'assets' folder doesn't exists or it's empty");
		return;
	}

	resResolver.setResolutions(r);
	resResolver.selectResolution();
	scale = resResolver.getResolution().portraitWidth / (float) worldWidth;

	EngineLogger.debug("Setting ASSETS SCALE: " + scale);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:15,代码来源:EngineAssetManager.java

示例5: getResolutions

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
private Resolution[] getResolutions(FileHandleResolver resolver, int worldWidth, int worldHeight) {
	ArrayList<Resolution> rl = new ArrayList<Resolution>();

	String list[] = null;
	
	String configRes = Config.getProperty(Config.RESOLUTIONS, null);
	
	if(configRes != null) {
		list = configRes.split(",");
	} else {
		list = listAssetFiles("ui");
	}
	
	for (String name : list) {
		
		try {
			float scale = Float.parseFloat(name);

			EngineLogger.debug("RES FOUND: " + scale);

			Resolution r = new Resolution((int) (worldWidth * scale), (int) (worldHeight * scale), name);

			rl.add(r);
		} catch (NumberFormatException e) {

		}
	}

	Collections.sort(rl, new Comparator<Resolution>() {
		public int compare(Resolution a, Resolution b) {
			return a.portraitWidth - b.portraitWidth;
		}
	});

	return rl.toArray(new Resolution[rl.size()]);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:37,代码来源:EngineAssetManager.java

示例6: getResolutions

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public Resolution[] getResolutions() {
	return descriptors;
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:4,代码来源:EngineResolutionFileResolver.java

示例7: getResolution

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public Resolution getResolution() {
	return bestDesc;
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:4,代码来源:EngineResolutionFileResolver.java

示例8: setResolutions

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public void setResolutions(Resolution[] resolutions) {
	this.descriptors = resolutions;
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:4,代码来源:EngineResolutionFileResolver.java

示例9: getResolution

import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution; //导入依赖的package包/类
public Resolution getResolution() {
	return resResolver.getResolution();
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:4,代码来源:EngineAssetManager.java


注:本文中的com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。