本文整理汇总了Java中com.badlogic.gdx.controllers.PovDirection.south方法的典型用法代码示例。如果您正苦于以下问题:Java PovDirection.south方法的具体用法?Java PovDirection.south怎么用?Java PovDirection.south使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.controllers.PovDirection
的用法示例。
在下文中一共展示了PovDirection.south方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPov
import com.badlogic.gdx.controllers.PovDirection; //导入方法依赖的package包/类
public PovDirection getPov (int povIndex) {
OisPov pov = joystick.getPov(povIndex);
switch (pov) {
case Centered:
return PovDirection.center;
case East:
return PovDirection.east;
case North:
return PovDirection.north;
case NorthEast:
return PovDirection.northEast;
case NorthWest:
return PovDirection.northWest;
case South:
return PovDirection.south;
case SouthEast:
return PovDirection.southEast;
case SouthWest:
return PovDirection.southWest;
case West:
return PovDirection.west;
}
return null; // Impossible.
}
示例2: getPov
import com.badlogic.gdx.controllers.PovDirection; //导入方法依赖的package包/类
public PovDirection getPov (int povIndex) {
OisJoystick.OisPov pov = joystick.getPov(povIndex);
switch (pov) {
case Centered:
return PovDirection.center;
case East:
return PovDirection.east;
case North:
return PovDirection.north;
case NorthEast:
return PovDirection.northEast;
case NorthWest:
return PovDirection.northWest;
case South:
return PovDirection.south;
case SouthEast:
return PovDirection.southEast;
case SouthWest:
return PovDirection.southWest;
case West:
return PovDirection.west;
}
return null; // Impossible.
}
示例3: getAbsoluteY
import com.badlogic.gdx.controllers.PovDirection; //导入方法依赖的package包/类
protected float getAbsoluteY(final PovDirection direction) {
if (direction == PovDirection.north) {
return 1f;
} else if (direction == PovDirection.northEast || direction == PovDirection.northWest) {
return SIN;
} else if (direction == PovDirection.south) {
return -1f;
} else if (direction == PovDirection.southWest || direction == PovDirection.southEast) {
return -SIN;
} else {
return 0f;
}
}
示例4: unmappedButtonPressed
import com.badlogic.gdx.controllers.PovDirection; //导入方法依赖的package包/类
@Override
protected boolean unmappedButtonPressed(int unmappedButtonNr) {
boolean pressed = false;
Array<com.badlogic.gdx.controllers.Controller> controllers = Controllers.getControllers();
for(int i=controllers.size-1; i>=0; i--) {
com.badlogic.gdx.controllers.Controller c = controllers.get(i);
int povCode = 0;
switch(unmappedButtonNr) {
case POV_CENTER:
// this needs to disable all pov-buttons
pressed = false; // center can't be pressed
break;
case POV_NORTH:
pressed |= c.getPov(povCode) == PovDirection.north;
break;
case POV_NORTHEAST:
pressed |= c.getPov(povCode) == PovDirection.northEast;
break;
case POV_EAST:
pressed |= c.getPov(povCode) == PovDirection.east;
break;
case POV_SOUTHEAST:
pressed |= c.getPov(povCode) == PovDirection.southEast;
break;
case POV_SOUTH:
pressed |= c.getPov(povCode) == PovDirection.south;
break;
case POV_SOUTHWEST:
pressed |= c.getPov(povCode) == PovDirection.southWest;
break;
case POV_WEST:
pressed |= c.getPov(povCode) == PovDirection.west;
break;
case POV_NORTHWEST:
pressed |= c.getPov(povCode) == PovDirection.northWest;
break;
case BUTTON1:
pressed |= c.getButton(0);
break;
case BUTTON2:
pressed |= c.getButton(1);
break;
case BUTTON3:
pressed |= c.getButton(2);
break;
case BUTTON4:
pressed |= c.getButton(3);
break;
case BUTTON5:
pressed |= c.getButton(4);
break;
case BUTTON6:
pressed |= c.getButton(5);
break;
case BUTTON7:
pressed |= c.getButton(6);
break;
case BUTTON8:
pressed |= c.getButton(7);
break;
}
}
return pressed;
}