本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Label.getName()
方法的一些代码示例,展示了Label.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getName()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Label
类名称:Label
方法名:getName
暂无
代码示例来源:origin: libgdx/libgdx
public String toString () {
String name = getName();
if (name != null) return name;
String className = getClass().getName();
int dotIndex = className.lastIndexOf('.');
if (dotIndex != -1) className = className.substring(dotIndex + 1);
return (className.indexOf('$') != -1 ? "Label " : "") + className + ": " + text;
}
代码示例来源:origin: libgdx/libgdx
public String toString () {
String name = getName();
if (name != null) return name;
String className = getClass().getName();
int dotIndex = className.lastIndexOf('.');
if (dotIndex != -1) className = className.substring(dotIndex + 1);
return (className.indexOf('$') != -1 ? "Label " : "") + className + ": " + text;
}
代码示例来源:origin: peakgames/libgdx-stagebuilder
@Override
public Actor build(BaseModel model, Group parent) {
LabelModel labelModel = (LabelModel) model;
Color color = labelModel.getFontColor() == null ? DEFAULT_LABEL_COLOR : Color.valueOf(labelModel.getFontColor());
BitmapFont font = assets.getFont(labelModel.getFontName());
font.getData().markupEnabled = true;
Label.LabelStyle style = new Label.LabelStyle(font, color);
String initialText = getLocalizedString(labelModel.getText()).replace("\\n", String.format("%n"));
Label label = new Label(initialText, style);
normalizeModelSize(labelModel, parent, 0, 0);
setBasicProperties(model, label);
setAlignmentAndScaling(labelModel, label);
if (labelModel.isShadow()) {
ShadowLabel shadowLabel = new ShadowLabel(
initialText, style, labelModel.getShadowColor(), resolutionHelper.getPositionMultiplier());
shadowLabel.setShadowOffsets(labelModel.getShadowX(), labelModel.getShadowY());
setBasicProperties(model, shadowLabel);
shadowLabel.setName(label.getName());
setAlignmentAndScaling(labelModel, shadowLabel);
return shadowLabel;
}
return label;
}
内容来源于网络,如有侵权,请联系作者删除!