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


Java Map.getLayers方法代码示例

本文整理汇总了Java中com.badlogic.gdx.maps.Map.getLayers方法的典型用法代码示例。如果您正苦于以下问题:Java Map.getLayers方法的具体用法?Java Map.getLayers怎么用?Java Map.getLayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.maps.Map的用法示例。


在下文中一共展示了Map.getLayers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHierarchy

import com.badlogic.gdx.maps.Map; //导入方法依赖的package包/类
/**
 * @param map the {@link Map} which hierarchy to print
 * @return a human readable {@link String} containing the hierarchy of the {@link com.badlogic.gdx.maps.MapObjects} of the given {@link Map}
 */
public String getHierarchy(Map map) {
    String hierarchy = map.getClass().getName() + "\n", key, layerHierarchy;

    Iterator<String> keys = map.getProperties().getKeys();
    while (keys.hasNext())
        hierarchy += (key = keys.next()) + ": " + map.getProperties().get(key) + "\n";

    for (MapLayer layer : map.getLayers()) {
        hierarchy += "\t" + layer.getName() + " (" + layer.getClass().getName() + "):\n";
        layerHierarchy = getHierarchy(layer).replace("\n", "\n\t\t");
        layerHierarchy = layerHierarchy.endsWith("\n\t\t") ? layerHierarchy.substring(0, layerHierarchy.lastIndexOf("\n\t\t")) : layerHierarchy;
        hierarchy += !layerHierarchy.equals("") ? "\t\t" + layerHierarchy : layerHierarchy;
    }

    return hierarchy;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:21,代码来源:Box2DMapObjectParser.java

示例2: getHierarchy

import com.badlogic.gdx.maps.Map; //导入方法依赖的package包/类
/**
 * @param map the {@link Map} which hierarchy to print
 * @return a human readable {@link String} containing the hierarchy of the {@link MapObjects} of the given {@link Map}
 */
public String getHierarchy(Map map) {
    String hierarchy = map.getClass().getName() + "\n", key, layerHierarchy;

    Iterator<String> keys = map.getProperties().getKeys();
    while (keys.hasNext())
        hierarchy += (key = keys.next()) + ": " + map.getProperties().get(key) + "\n";

    for (MapLayer layer : map.getLayers()) {
        hierarchy += "\t" + layer.getName() + " (" + layer.getClass().getName() + "):\n";
        layerHierarchy = getHierarchy(layer).replace("\n", "\n\t\t");
        layerHierarchy = layerHierarchy.endsWith("\n\t\t") ? layerHierarchy.substring(0, layerHierarchy.lastIndexOf("\n\t\t")) : layerHierarchy;
        hierarchy += !layerHierarchy.equals("") ? "\t\t" + layerHierarchy : layerHierarchy;
    }

    return hierarchy;
}
 
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:21,代码来源:Box2DMapObjectParser.java

示例3: load

import com.badlogic.gdx.maps.Map; //导入方法依赖的package包/类
/**
 * creates the given {@link Map Map's} {@link com.badlogic.gdx.maps.MapObjects} in the given {@link World}
 *
 * @param world the {@link World} to create the {@link com.badlogic.gdx.maps.MapObjects} of the given {@link Map} in
 * @param map   the {@link Map} which {@link com.badlogic.gdx.maps.MapObjects} to create in the given {@link World}
 * @return the given {@link World} with the parsed {@link com.badlogic.gdx.maps.MapObjects} of the given {@link Map} created in it
 */
public World load(World world, Map map) {
    if (!ignoreMapUnitScale)
        unitScale = getProperty(map.getProperties(), aliases.unitScale, unitScale);
    box2dObjectFactory.setUnitScale(unitScale);
    tileWidth = getProperty(map.getProperties(), "tilewidth", (int) tileWidth);
    tileHeight = getProperty(map.getProperties(), "tileheight", (int) tileHeight);

    for (MapLayer mapLayer : map.getLayers())
        load(world, mapLayer);

    return world;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:20,代码来源:Box2DMapObjectParser.java

示例4: load

import com.badlogic.gdx.maps.Map; //导入方法依赖的package包/类
/**
 * creates the given {@link Map Map's} {@link MapObjects} in the given {@link World}
 *
 * @param world the {@link World} to create the {@link MapObjects} of the given {@link Map} in
 * @param map   the {@link Map} which {@link MapObjects} to create in the given {@link World}
 * @return the given {@link World} with the parsed {@link MapObjects} of the given {@link Map} created in it
 */
public World load(World world, Map map) {
    if (!ignoreMapUnitScale)
        unitScale = getProperty(map.getProperties(), aliases.unitScale, unitScale);
    box2dObjectFactory.setUnitScale(unitScale);
    tileWidth = getProperty(map.getProperties(), "tilewidth", (int) tileWidth);
    tileHeight = getProperty(map.getProperties(), "tileheight", (int) tileHeight);

    for (MapLayer mapLayer : map.getLayers())
        load(world, mapLayer);

    return world;
}
 
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:20,代码来源:Box2DMapObjectParser.java


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