本文整理汇总了Java中com.badlogic.gdx.utils.JsonValue.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java JsonValue.getBoolean方法的具体用法?Java JsonValue.getBoolean怎么用?Java JsonValue.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.utils.JsonValue
的用法示例。
在下文中一共展示了JsonValue.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stickConfigurationFromJson
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
private StickConfiguration stickConfigurationFromJson(JsonValue stickConfigurationJson) {
boolean invertHorizontalAxis = stickConfigurationJson.getBoolean("invertHorizontalAxis");
boolean invertVerticalAxis = stickConfigurationJson.getBoolean("invertVerticalAxis");
float deadZoneRadius = stickConfigurationJson.getFloat("deadZoneRadius");
float horizontalSensitivity = stickConfigurationJson.getFloat("horizontalSensitivity");
float verticalSensitivity = stickConfigurationJson.getFloat("verticalSensitivity");
StickConfiguration stickConfiguration = new StickConfiguration();
stickConfiguration.setInvertHorizontalAxis(invertHorizontalAxis);
stickConfiguration.setInvertVerticalAxis(invertVerticalAxis);
stickConfiguration.setDeadZoneRadius(deadZoneRadius);
stickConfiguration.setHorizontalSensitivity(horizontalSensitivity);
stickConfiguration.setVerticalSensitivity(verticalSensitivity);
return stickConfiguration;
}
示例2: parse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void parse(JsonValue jsonValue) {
ModelComponent modelComponent =
nhg.entities.createComponent(entity, ModelComponent.class);
String type = jsonValue.getString("graphicsType");
String asset = jsonValue.getString("asset", "");
boolean enabled = jsonValue.getBoolean("enabled", true);
JsonValue materialsJson = jsonValue.get("materials");
if (materialsJson != null) {
for (JsonValue mat : materialsJson) {
PbrMaterialJson pbrMaterialJson = new PbrMaterialJson();
pbrMaterialJson.parse(mat);
modelComponent.pbrMaterials.add(pbrMaterialJson.get());
}
}
modelComponent.type = ModelComponent.Type.fromString(type);
modelComponent.asset = asset;
modelComponent.enabled = enabled;
output = modelComponent;
}
示例3: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonValue) {
try {
name = jsonValue.getString("name");
optional = jsonValue.getBoolean("optional");
if (jsonValue.get("value").isNumber()) {
type = Float.TYPE;
value = Double.parseDouble(jsonValue.getString("value"));
} else {
type = ClassReflection.forName(jsonValue.getString("type"));
if (jsonValue.get("value").isNull()) {
value = null;
} else {
value = jsonValue.getString("value");
}
}
} catch (ReflectionException ex) {
Gdx.app.error(getClass().toString(), "Error reading from serialized object" , ex);
DialogFactory.showDialogErrorStatic("Read Error...","Error reading from serialized object.\n\nOpen log?");
}
}
示例4: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read (Json json, JsonValue jsonData) {
if (jsonData.has("sortingLayerName"))
sortingLayerName = jsonData.getString("sortingLayerName");
if (jsonData.has("sortingOrder"))
sortingOrder = jsonData.getInt("sortingOrder");
if (jsonData.has("enabled"))
enabled = jsonData.getBoolean("enabled");
if (jsonData.has("shader")) {
Shader shader = new Shader("");
shader.read(json, jsonData.get("shader"));
this.shader = shader;
}
if(jsonData.has("srcBlendFunction"))
srcBlendFunction = jsonData.getInt("srcBlendFunction");
if(jsonData.has("dstBlendFunction"))
srcBlendFunction = jsonData.getInt("dstBlendFunction");
}
示例5: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read (Json json, JsonValue jsonData) {
super.read(json, jsonData);
if (jsonData.has("path"))
path = jsonData.getString("path");
if (jsonData.has("text"))
text = jsonData.getString("text");
if (jsonData.has("centerText"))
centered = jsonData.getBoolean("centerText");
if (jsonData.has("flipped"))
flipped = jsonData.getBoolean("flipped");
if (jsonData.has("xScale"))
xScale = jsonData.getFloat("xScale");
if (jsonData.has("yScale"))
yScale = jsonData.getFloat("yScale");
if (jsonData.has("tint"))
tint = JsonUtil.readColorFromJson(jsonData, "tint");
}
示例6: parseSuccessFromResponse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
/**
* Helper method when just interested if GameJolt request was successful
*/
protected boolean parseSuccessFromResponse(String json) {
JsonValue response = null;
boolean success;
try {
response = new JsonReader().parse(json).get("response");
success = response != null && response.getBoolean("success");
} catch (Throwable t) {
Gdx.app.error(GAMESERVICE_ID, "Cannot parse GameJolt response: " + json, t);
success = false;
}
return success;
}
示例7: load
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
public static SerialArray<Tile> load(String map, HashMap<Integer, Player> players) {
JsonValue value = reader.parse(map);
float scale = value.getFloat("scale");
JsonValue regions = value.get("regions");
SerialArray<Tile> tiles = new SerialArray<>();
for (JsonValue region : regions) {
Color color = Color.valueOf(region.getString("color"));
for (JsonValue tile : region.get("tiles")) {
int x = tile.getInt("x"), y = tile.getInt("y");
int width = tile.getInt("w"), height = tile.getInt("h");
Tile t = new Tile(x * scale, y * scale, (int) (width * scale), (int) (height * scale), color);
t.setRegion(region.name);
t.setTroops(tile.getInt("troops"));
if (tile.get("city") != null) {
JsonValue city = tile.get("city");
float cx = city.getInt("x") * scale, cy = city.getInt("y") * scale;
City c = new City(cx + t.getX(), cy + t.getY(), city.getBoolean("major"));
t.setCity(c);
}
if (players.get(tile.getInt("owner")) != null) {
t.setOwner(players.get(tile.getInt("owner")));
}
t.setIndex(tile.getInt("index"));
tiles.add(t);
}
}
for (int i = 0; i < tiles.size; i++) {
tiles.get(i).setContacts(tiles);
}
return tiles;
}
示例8: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
public void read(Json json, JsonValue jsonData)
{
punchesLandedPrisoner = jsonData.getInt("punchesLandedPrisoner");
punchesLandedCop = jsonData.getInt("punchesLandedCop");
trainKillsPrisoner = jsonData.getInt("trainKillsPrisoner");
trainKillsCop = jsonData.getInt("trainKillsCop");
beaten = jsonData.getBoolean("beaten");
captures = jsonData.getInt("captures");
mapID = jsonData.getInt("mapId");
mapCompletionTime = jsonData.getLong("mapTime");
trainsDerailed = jsonData.getInt("trainsDerailed");
startingPrisoners = jsonData.getInt("startingPrisoners");
survivingPrisoners = jsonData.getInt("survivingPrisoners");
}
示例9: parse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void parse(JsonValue jsonValue) {
boolean quantization = jsonValue.getBoolean("useQuantizedAabbCompression", true);
boolean buildBvh = jsonValue.getBoolean("buildBvh", true);
String asset = jsonValue.getString("asset", "");
shape = new BvhTriangleMeshRigidBodyShape(asset, quantization, buildBvh);
}
示例10: parse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void parse(JsonValue jsonValue) {
boolean optimize = jsonValue.getBoolean("optimize", false);
String asset = jsonValue.getString("asset", "");
shape = new ConvexHullRigidBodyShape(asset, optimize);
}
示例11: parse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void parse(JsonValue jsonValue) {
boolean calcAabb = jsonValue.getBoolean("calcAabb", true);
String asset = jsonValue.getString("asset", "");
shape = new ConvexTriangleMeshRigidBodyShape(asset, calcAabb);
}
示例12: parse
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void parse(JsonValue wheelJson) {
WheelComponent wheelComponent = null;
VehicleComponent vehicleComponent = nhg.entities.getComponent(parentEntity, VehicleComponent.class);
if (vehicleComponent != null) {
Vector3Json attachmentPointJson = new Vector3Json();
attachmentPointJson.parse(wheelJson.get("attachmentPoint"));
Vector3Json directionJson = new Vector3Json();
directionJson.parse(wheelJson.get("direction"));
Vector3Json axisJson = new Vector3Json();
axisJson.parse(wheelJson.get("axis"));
int wheelIndex = wheelJson.getInt("wheelIndex");
float radius = wheelJson.getFloat("radius", 0.1f);
float suspensionRestLength = wheelJson.getFloat("suspensionRestLength", radius * 0.3f);
float wheelFriction = wheelJson.getFloat("friction", 5f);
boolean frontWheel = wheelJson.getBoolean("frontWheel", false);
wheelComponent = nhg.entities.createComponent(entity, WheelComponent.class);
wheelComponent.wheelIndex = wheelIndex;
wheelComponent.suspensionRestLength = suspensionRestLength;
wheelComponent.wheelFriction = wheelFriction;
wheelComponent.frontWheel = frontWheel;
wheelComponent.attachmentPoint = attachmentPointJson.get();
wheelComponent.direction = directionJson.get();
wheelComponent.axis = axisJson.get();
wheelComponent.vehicleComponent = vehicleComponent;
}
output = wheelComponent;
}
示例13: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
name = jsonData.getString("name");
properties = json.readValue("properties", Array.class, CustomProperty.class, jsonData);
for (CustomProperty property : properties) {
property.setParentStyle(this);
}
deletable = jsonData.getBoolean("deletable");
}
示例14: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read(Json json, JsonValue jsonData) {
name = jsonData.getString("name");
properties = json.readValue("properties", OrderedMap.class, jsonData);
deletable = jsonData.getBoolean("deletable");
try {
clazz = ClassReflection.forName(jsonData.getString("clazz"));
} catch (ReflectionException ex) {
Gdx.app.error(getClass().toString(), "Error reading from serialized object" , ex);
main.getDialogFactory().showDialogError("Read Error...","Error reading from serialized object.\n\nOpen log?");
}
}
示例15: read
import com.badlogic.gdx.utils.JsonValue; //导入方法依赖的package包/类
@Override
public void read (Json json, JsonValue jsonData) {
filePath = jsonData.getString("path");
isMusic = false;
loop = jsonData.getBoolean("loop");
playOnCreate = jsonData.getBoolean("playOnCreate");
}