当前位置: 首页>>代码示例>>Java>>正文


Java VAlign.Top方法代码示例

本文整理汇总了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;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:BitmapText.java

示例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;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:9,代码来源:CssUtil.java

示例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;
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:9,代码来源:CssUtil.java

示例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;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:16,代码来源:TextView.java

示例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);
	}	
}
 
开发者ID:meltzow,项目名称:tonegodgui,代码行数:13,代码来源:SlideTray.java

示例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();
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:Letters.java


注:本文中的com.jme3.font.BitmapFont.VAlign.Top方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。