本文整理汇总了Java中org.lwjgl.util.Rectangle类的典型用法代码示例。如果您正苦于以下问题:Java Rectangle类的具体用法?Java Rectangle怎么用?Java Rectangle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Rectangle类属于org.lwjgl.util包,在下文中一共展示了Rectangle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mouseClicked
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
protected void mouseClicked(int xPos, int yPos, int buttonClicked)
{
super.mouseClicked(xPos, yPos, buttonClicked);
if(upButton.intersects(new Rectangle(xPos, yPos, 1, 1)))
{
if(currentLayer + 1 <= blockList.size() - 1)
{
currentLayer++;
}
}
if(downButton.intersects(new Rectangle(xPos, yPos, 1, 1)))
{
if(currentLayer - 1 >= 1)
{
currentLayer--;
}
}
}
示例2: buildGui
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public static GuiScreen buildGui(InventoryPlayer invPlayer, TileEntityIronFurnace invFurnace)
{
GUI type = values()[invFurnace.getType().ordinal()];
Container container = type.makeContainer(invPlayer, invFurnace);
GuiContainerCX gui = new GuiContainerCX(new GuiMoreFurnace(type, invFurnace), container);
Rectangle bg = type.texture.getPart("bg");
gui.setSize(bg.getWidth(), bg.getHeight());
return gui;
}
示例3: mouseClicked
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
public void mouseClicked(int x, int y, int par3) {
try {
super.mouseClicked(x, y, par3);
} catch (IOException e) {
e.printStackTrace();
}
x-=guiLeft;
y-=guiTop;
if(!isFilterVisible()) {
return;
}
int filterX = 59;
int filterY = 63;
Rectangle filterBounds = new Rectangle(filterX, filterY, 90, 18);
if(!filterBounds.contains(x, y)) {
return;
}
ItemStack st = CrystalMod.proxy.getClientPlayer().inventory.getItemStack();
FluidFilter filter = getFilter();
if(filter == null && ItemStackTools.isNullStack(st)) {
return;
}
if(filter == null) {
filter = new FluidFilter();
}
int slot = (x - filterX) / 18;
if(slot < 5 && slot >= 0){
ModLogger.info(slot+" "+(FluidUtil.getFluidTypeFromItem(st) !=null ? FluidUtil.getFluidTypeFromItem(st).getLocalizedName() : ""));
filter.setFluid(slot, st);
updateFilter(filter);
}
}
示例4: initGui
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
public void initGui()
{
super.initGui();
upButton = new Rectangle((width - xSize) / 2 + 70, (height - ySize) / 2 + 75, 13, 13);
downButton = new Rectangle((width - xSize) / 2 + 70, (height - ySize) / 2 + 92, 13, 13);
tooltip = new Rectangle((width - xSize) / 2 + 30, (height - ySize) / 2 + 82, 16, 16);
}
示例5: UIButton
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public UIButton(UIElement linkedElement, int posX, int posY, int width, int height, int textureID) {
this.linkedElement = linkedElement;
this.posX = posX;
this.posY = posY;
this.width = width;
this.height = height;
this.textureID = textureID;
this.collisionBox = new Rectangle(posX,posY,width,height);
}
示例6: GuiWindow
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public GuiWindow(Vector2f position, Vector2f dimension, String name, Gui gui) {
this.position = position;
this.dimension = dimension;
this.closeRectangle = new Rectangle((int)position.x + (int)dimension.x - 28, (int)position.y, 28, 19);
this.windowRectangle = new Rectangle((int)position.x , (int)position.y, (int)dimension.x, (int)dimension.y);
this.name = name;
this.guiWindowElements = new ArrayList<GuiWindowElement>();
this.gui = gui;
}
示例7: GuiWindowElement
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public GuiWindowElement(int textureID, Vector2f position, Vector2f dimension, boolean clickable) {
this.textureID = textureID;
this.position = position;
this.dimension = dimension;
this.rectangle = new Rectangle((int)position.x, (int)position.y, (int)dimension.x / 2, (int)dimension.y / 2);
this.clickable = clickable;
}
示例8: setValues
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public void setValues(int size, Vector2f tileWidthHeight, Vector2f screenWidthHeight) {
this.size = size;
this.tilewidth = (int)tileWidthHeight.x;
this.tileheight = (int)tileWidthHeight.y;
this.width = (int)screenWidthHeight.x;
this.height = (int)screenWidthHeight.y;
rectangle = new Rectangle((int)position.x, (int)position.y, width, height);
}
示例9: needsSlot
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
public Rectangle needsSlot() {
return null;
}
示例10: needsSlot
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
public Rectangle needsSlot() {
return coordinateSensor.needsSlot();
}
示例11: updateCollisionBox
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
private void updateCollisionBox(){
this.collisionBox = new Rectangle(posX,posY,width,height);
}
示例12: getCollisionBox
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public Rectangle getCollisionBox() {
return collisionBox;
}
示例13: getRectangle
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public Rectangle getRectangle() {
return rectangle;
}
示例14: setRectangle
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
public void setRectangle(Rectangle rectangle) {
this.rectangle = rectangle;
}
示例15: needsSlot
import org.lwjgl.util.Rectangle; //导入依赖的package包/类
@Override
public Rectangle needsSlot(){
return null;
}