本文整理汇总了Java中org.spout.renderer.api.model.StringModel类的典型用法代码示例。如果您正苦于以下问题:Java StringModel类的具体用法?Java StringModel怎么用?Java StringModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringModel类属于org.spout.renderer.api.model包,在下文中一共展示了StringModel类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Button
import org.spout.renderer.api.model.StringModel; //导入依赖的package包/类
public Button(Form form, String name, int x, int y, String text, Font font, int width, int height) {
super(form, name, x, y, text, font);
final Model backgroundModel;
final StringModel stringModel;
try {
backgroundModel = form.getAddon().getGame().getGuiRenderer().createColoredPlane(form.getAddon(), "basic", backgroundUniforms, Colors.BLUE.getValue(), new Vector2f(width, height));
stringModel = form.getAddon().getGame().getGuiRenderer().createString(form.getAddon(), "font", text, font, StringModel.AntiAliasing.ON, Font.PLAIN, 12);
} catch (Exception e) {
// Should NEVER get here as font is provided by the mod
throw new RuntimeException(e);
}
models.add(backgroundModel);
models.add(stringModel);
}
示例2: Label
import org.spout.renderer.api.model.StringModel; //导入依赖的package包/类
public Label(Form form, String name, int x, int y, String text, Font font, int size) {
super(form, name, x, y, text, font);
final StringModel model;
try {
model = form.getAddon().getGame().getGuiRenderer().createString(form.getAddon(), "font", text, font, StringModel.AntiAliasing.ON, Font.PLAIN, size);
} catch (Exception e) {
// Should NEVER get here as font is provided by the mod
throw new RuntimeException(e);
}
models.add(model);
}
示例3: createString
import org.spout.renderer.api.model.StringModel; //导入依赖的package包/类
public StringModel createString(Addon addon, String programName, String initialText, String fontName, AntiAliasing aliasing, int style, int fontSize) throws IOException, FontFormatException {
final StringModel model = new StringModel(context, loadProgram(addon, programName), initialText, loadFont(addon, fontName).deriveFont(style, fontSize), aliasing, (int) displaySize.getX());
model.setString(initialText);
return model;
}
示例4: setText
import org.spout.renderer.api.model.StringModel; //导入依赖的package包/类
@Override
public Label setText(String text) {
super.setText(text);
((StringModel) models.get(0)).setString(text);
return this;
}