use of com.badlogic.gdx.utils.XmlReader in project pixelwheels by agateau.
the class FileUtils method parseXml.
public static XmlReader.Element parseXml(FileHandle handle) {
XmlReader reader = new XmlReader();
XmlReader.Element root = reader.parse(handle);
if (root == null) {
NLog.e("Failed to parse xml file from %s. No root element.", handle.path());
return null;
}
return root;
}
use of com.badlogic.gdx.utils.XmlReader in project gaiasky by langurmonkey.
the class AttitudeXmlParser method parseActivationTime.
private static Instant parseActivationTime(FileHandle fh) {
XmlReader reader = new XmlReader();
XmlReader.Element element = reader.parse(fh);
XmlReader.Element model = element.getChildByName("model");
/**
* MODEL ELEMENT *
*/
String activTime = model.get("starttime");
return getDate(activTime);
}
use of com.badlogic.gdx.utils.XmlReader in project talos by rockbite.
the class UIStage method init.
public void init() {
fullScreenTable = new Table();
fullScreenTable.setFillParent(true);
stage.addActor(fullScreenTable);
defaults();
constructMenu();
constructTabPane();
constructSplitPanes();
initFileChoosers();
batchConvertDialog = new BatchConvertDialog();
settingsDialog = new SettingsDialog();
newProjectDialog = new NewProjectDialog();
FileHandle list = Gdx.files.internal("modules.xml");
XmlReader xmlReader = new XmlReader();
XmlReader.Element root = xmlReader.parse(list);
WrapperRegistry.map.clear();
moduleListPopup = new ModuleListPopup(root);
colorPicker = new ColorPicker();
colorPicker.padTop(32);
colorPicker.padLeft(16);
colorPicker.setHeight(330);
colorPicker.setWidth(430);
colorPicker.padRight(26);
}
use of com.badlogic.gdx.utils.XmlReader in project talos by rockbite.
the class UIStage method initExampleList.
public void initExampleList(PopupMenu examples) {
FileHandle list = Gdx.files.internal("samples/list.xml");
XmlReader xmlReader = new XmlReader();
XmlReader.Element root = xmlReader.parse(list);
Array<XmlReader.Element> samples = root.getChildrenByName("sample");
for (XmlReader.Element sample : samples) {
String name = sample.getAttribute("name");
final String fileName = sample.getAttribute("file");
MenuItem item = new MenuItem(name);
examples.addItem(item);
item.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
// openProject(fileName);
TalosMain.Instance().ProjectController().lastDirTrackingDisable();
TalosMain.Instance().ProjectController().setProject(ProjectController.TLS);
TalosMain.Instance().ProjectController().loadProject(Gdx.files.internal("samples/" + fileName));
TalosMain.Instance().ProjectController().lastDirTrackingEnable();
TalosMain.Instance().ProjectController().unbindFromFile();
}
});
}
}
use of com.badlogic.gdx.utils.XmlReader in project talos by rockbite.
the class ShaderDescriptor method setData.
public void setData(String xmlString) {
uniformMap.clear();
XmlReader xmlReader = new XmlReader();
XmlReader.Element shader = xmlReader.parse(xmlString);
XmlReader.Element uniforms = shader.getChildByName("uniforms");
XmlReader.Element main = shader.getChildByName("main");
XmlReader.Element methods = shader.getChildByName("methods");
fragResolve = main.getText();
customMethods = methods.getText();
for (XmlReader.Element uniformElement : uniforms.getChildrenByName("uniform")) {
String name = uniformElement.getAttribute("name");
String type = uniformElement.getAttribute("type");
UniformData uniformData = new UniformData();
uniformData.name = name;
if (type.equals("sampler2D")) {
String body = uniformElement.getText();
uniformData.type = Type.TEXTURE;
uniformData.payload = body;
} else {
uniformData.type = Type.getFor(type);
}
uniformMap.put(name, uniformData);
}
}
Aggregations