本文整理汇总了Java中com.jme3.font.BitmapFont.VAlign.Top方法的典型用法代码示例。如果您正苦于以下问题:Java VAlign.Top方法的具体用法?Java VAlign.Top怎么用?Java VAlign.Top使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.font.BitmapFont.VAlign
的用法示例。
在下文中一共展示了VAlign.Top方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setVerticalAlignment
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
/**
* Set vertical alignment. Applicable only when text bound is set.
* @param align
*/
public void setVerticalAlignment(BitmapFont.VAlign align) {
if (block.getTextBox() == null && align != VAlign.Top) {
throw new RuntimeException("Bound is not set");
}
block.setVerticalAlignment(align);
letters.invalidate();
needRefresh = true;
}
示例2: toVAlign
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
public static VAlign toVAlign(String align) {
if (align.equalsIgnoreCase("middle")) {
return VAlign.Center;
} else if (align.equalsIgnoreCase("bottom")) {
return VAlign.Bottom;
}
return VAlign.Top;
}
示例3: identToVAlign
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
public static VAlign identToVAlign(IdentValue ident) {
if (ident == IdentValue.TOP) {
return VAlign.Top;
} else if (ident == IdentValue.BOTTOM) {
return VAlign.Bottom;
}
return VAlign.Center;
}
示例4: identifyVAlign
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
private VAlign identifyVAlign(String valign) {
if (valign == null)
return null;
if (valign.equals(VAlign.Bottom.name())) {
return VAlign.Bottom;
}
if (valign.equals(VAlign.Center.name())) {
return VAlign.Center;
}
if (valign.equals(VAlign.Top.name())) {
return VAlign.Top;
}
return null;
}
示例5: alignButtonsV
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
public void alignButtonsV(VAlign vAlign) {
if (vAlign == VAlign.Top) {
btnPrevElement.setY(getHeight()-btnPrevElement.getHeight());
btnNextElement.setY(getHeight()-btnNextElement.getHeight());
} else if (vAlign == VAlign.Center) {
btnPrevElement.centerToParentV();
btnNextElement.centerToParentV();
} else if (vAlign == VAlign.Center) {
btnPrevElement.setY(0);
btnNextElement.setY(0);
}
}
示例6: align
import com.jme3.font.BitmapFont.VAlign; //导入方法依赖的package包/类
private void align() {
final Align alignment = block.getAlignment();
final VAlign valignment = block.getVerticalAlignment();
if (block.getTextBox() == null || (alignment == Align.Left && valignment == VAlign.Top))
return;
LetterQuad cursor = tail.getPrevious();
cursor.setEndOfLine();
final float width = block.getTextBox().width;
final float height = block.getTextBox().height;
float lineWidth = 0;
float gapX = 0;
float gapY = 0;
validateSize();
if (totalHeight < height) { // align vertically only for no overflow
switch (valignment) {
case Top:
gapY = 0;
break;
case Center:
gapY = (height-totalHeight)*0.5f;
break;
case Bottom:
gapY = height-totalHeight;
break;
}
}
while (!cursor.isHead()) {
if (cursor.isEndOfLine()) {
lineWidth = cursor.getX1()-block.getTextBox().x;
if (alignment == Align.Center) {
gapX = (width-lineWidth)/2;
} else if (alignment == Align.Right) {
gapX = width-lineWidth;
} else {
gapX = 0;
}
}
cursor.setAlignment(gapX, gapY);
cursor = cursor.getPrevious();
}
}