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


Java TextField.setBorderColor方法代码示例

本文整理汇总了Java中org.newdawn.slick.gui.TextField.setBorderColor方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.setBorderColor方法的具体用法?Java TextField.setBorderColor怎么用?Java TextField.setBorderColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.newdawn.slick.gui.TextField的用法示例。


在下文中一共展示了TextField.setBorderColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(final GameContainer paramGameContainer, final StateBasedGame paramStateBasedGame) throws SlickException {
    game = paramStateBasedGame;

    font = Resources.INSTANCE.font;

    textField = new TextField(paramGameContainer, font, 100, 540, 1720 , 140);
    textField.setBackgroundColor(Color.white);
    textField.setBorderColor(Color.black);
    textField.setText(Map.INSTANCE.getMapName());

    TITLE_WIDTH = font.getWidth(TITLE);

    SAVE_WIDTH = font.getWidth(SAVE);
    SAVE_HEIGHT = font.getHeight(SAVE);

    BACK_WIDTH = font.getWidth(BACK);
    BACK_HEIGHT = font.getHeight(BACK);

    save = new Rectangle(430 - (SAVE_WIDTH / 2), 800, SAVE_WIDTH, SAVE_HEIGHT);
    back = new Rectangle(1290 - (BACK_WIDTH / 2), 800, BACK_WIDTH, BACK_HEIGHT);
}
 
开发者ID:MichaelJ2,项目名称:big-buum-man,代码行数:23,代码来源:SaveScreen.java

示例2: set

import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
void set(int typeID, GUI gui){
    this.typeID = typeID;
    this.gui = gui;

    gui.clear();

    gc = gui.gc;
    bgWidth = 600;
    bgHeight = 400;
    bgPosX = gc.getWidth()/2-bgWidth/2;
    bgPosY = gc.getHeight()/2-bgHeight/2;
    this.bg = new Rectangle(bgPosX, bgPosY, bgWidth, bgHeight);
    this.border = new Rectangle(gc.getWidth()/2-(bgWidth+5)/2, gc.getHeight()/2-(bgHeight+5)/2, bgWidth, bgHeight);

    si = items.get(typeID);
    cats = si.getCategories();

    int strHeight = fontSmall.getHeight("A"),
        titleHeight = fontTitle.getHeight("A"),
        x = bgPosX+10,
        y = bgPosY+titleHeight+15;
    for (String cat : cats){
        gui.drawText(cat, x, y, fontSmall, Color.white);
        y+=strHeight;
    }
    gui.drawText("X", bgPosX+bgWidth-20, bgPosY+5, fontSmall, Color.white);

    amount = new TextField(gc, fontSmall, 0, 0, 150, 40);
    amount.setBackgroundColor(new Color(0, 0, 0, 50));
    amount.setBorderColor(Color.transparent);
    amount.setTextColor(Color.white);
    amount.setMaxLength(253);
    amount.setFocus(true);
    amount.isAcceptingInput();

    closeChooseAmount();

    isSet = true;
}
 
开发者ID:Piratkopia13,项目名称:Pixel-Planet,代码行数:40,代码来源:Shop.java

示例3: init

import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(GameContainer gc, final StateBasedGame sbg) throws SlickException {
	bg = new Image("res/bg.png");
	logo = new Image("res/logo.png");
     
	try {
		awtFontTitle = Game.awtFontTitle.deriveFont(40f); // set font size
		titleFont = new TrueTypeFont(awtFontTitle, true);
		
		awtFont = Game.awtFont.deriveFont(30f); // set font size
		font = new TrueTypeFont(awtFont, true);
 
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	IPinput = new TextField(gc, font, 0, 0, 350, 50);
	IPinput.setBackgroundColor(new Color(0, 0, 0, 50));
	IPinput.setBorderColor(Color.transparent);
	IPinput.setTextColor(Color.white);
	IPinput.setMaxLength(253);
	IPinput.setText(Game.prefs.get(Game.pref_lastip, ""));
	IPinput.setCursorPos(IPinput.getText().length());
	nameField = new TextField(gc, font, 0, 0, 350, 50);
	nameField.setBackgroundColor(new Color(0, 0, 0, 50));
	nameField.setBorderColor(Color.transparent);
	nameField.setTextColor(Color.white);
	nameField.setMaxLength(20);
	nameField.setText(Game.prefs.get(Game.pref_playername, Game.default_username));
	nameField.setCursorPos(nameField.getText().length());
	
	// Net
	Game.network = new Network(gc, sbg);
	
}
 
开发者ID:Piratkopia13,项目名称:Pixel-Planet,代码行数:36,代码来源:Menu.java

示例4: init

import org.newdawn.slick.gui.TextField; //导入方法依赖的package包/类
@Override
public void init(final GameContainer paramGameContainer, final StateBasedGame paramStateBasedGame) throws SlickException {
    game = paramStateBasedGame;

    font = Resources.INSTANCE.font;
    font2 = paramGameContainer.getDefaultFont();

    xField = new TextField(paramGameContainer, font2, 510, 540, 300 , 140);
    xField.setBackgroundColor(Color.black);
    xField.setBorderColor(Color.white);
    xField.setText("22");
    xField.setMaxLength(2);

    yField = new TextField(paramGameContainer, font, 1060, 540, 300 , 140);
    yField.setBackgroundColor(Color.black);
    yField.setBorderColor(Color.white);
    yField.setText("22");
    yField.setMaxLength(2);

    TITLE_X = font.getWidth(TITLE) / 2;

    OK_X = font.getWidth(OK);
    OK_Y = font.getHeight(OK);

    BACK_X = font.getWidth(BACK);
    BACK_Y = font.getHeight(BACK);

    X_X = font.getWidth(X) / 2;

    REASON_X = font.getWidth(reason) / 2;

    ok = new Rectangle(1260 - (OK_X / 2), 800, OK_X, OK_Y);
    back = new Rectangle(660 - (BACK_X / 2), 800, BACK_X, BACK_Y);
}
 
开发者ID:MichaelJ2,项目名称:big-buum-man,代码行数:35,代码来源:NewMapScreen.java


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