com.badlogic.gdx.scenes.scene2d.ui.Label.invalidate()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Label.invalidate()方法的一些代码示例,展示了Label.invalidate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.invalidate()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Label
类名称:Label
方法名:invalidate

Label.invalidate介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

/** @param labelAlign Aligns all the text within the label (default left center).
 * @param lineAlign Aligns each line of text horizontally (default left).
 * @see Align */
public void setAlignment (int labelAlign, int lineAlign) {
  this.labelAlign = labelAlign;
  if ((lineAlign & Align.left) != 0)
    this.lineAlign = Align.left;
  else if ((lineAlign & Align.right) != 0)
    this.lineAlign = Align.right;
  else
    this.lineAlign = Align.center;
  invalidate();
}

代码示例来源:origin: libgdx/libgdx

/** @param labelAlign Aligns all the text within the label (default left center).
 * @param lineAlign Aligns each line of text horizontally (default left).
 * @see Align */
public void setAlignment (int labelAlign, int lineAlign) {
  this.labelAlign = labelAlign;
  if ((lineAlign & Align.left) != 0)
    this.lineAlign = Align.left;
  else if ((lineAlign & Align.right) != 0)
    this.lineAlign = Align.right;
  else
    this.lineAlign = Align.center;
  invalidate();
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** @param labelAlign Aligns all the text within the label (default left center).
 * @param lineAlign Aligns each line of text horizontally (default left).
 * @see Align */
public void setAlignment (int labelAlign, int lineAlign) {
  this.labelAlign = labelAlign;
  if ((lineAlign & Align.left) != 0)
    this.lineAlign = Align.left;
  else if ((lineAlign & Align.right) != 0)
    this.lineAlign = Align.right;
  else
    this.lineAlign = Align.center;
  invalidate();
}

代码示例来源:origin: kotcrab/vis-ui

@Override
protected void setStage (Stage stage) {
  super.setStage(stage);
  label.invalidate(); //fixes issue with disappearing menu item after holding right mouse button and dragging down while opening menu
}

代码示例来源:origin: langurmonkey/gaiasky

@Override
protected void setStage(Stage stage) {
  super.setStage(stage);
  label.invalidate(); //fixes issue with disappearing menu item after holding right mouse button and dragging down while opening menu
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

private static void add(Stage stage, String text) {
  msg.clearActions();
  msg.setText(text);
  GlyphLayout textLayout = new GlyphLayout();
  textLayout.setText(msg.getStyle().font, text, Color.BLACK, stage.getWidth() * .8f, Align.center, true);
  msg.setSize(textLayout.width + textLayout.height, textLayout.height + textLayout.height * 2);
  if (!stage.getActors().contains(msg, true))
    stage.addActor(msg);
  msg.setPosition(Math.round((stage.getWidth() - msg.getWidth()) / 2),
      Math.round((stage.getHeight() - msg.getHeight()) / 2));
  msg.invalidate();
}

相关文章