Beispiel #1
0
void LayoutGamepad(int w, int h)
{
	float controlScale = g_Config.bLargeControls ? 1.6 : 1.15;

	const int button_spacing = 50 * controlScale;
	const int arrow_spacing = 40 * controlScale;

	const int circleX = w - 40 * controlScale;
	const int circleY = h - 120 * controlScale;

	const int leftX = 40 * controlScale;
	int leftY = h - 120 * controlScale;

	if (g_Config.bShowAnalogStick) {
		leftY = h - 250 * controlScale;
	}

	const int stickX = leftX + arrow_spacing;
	const int stickY = h - 80 * controlScale;

	const int halfW = w / 2;

	buttonO.setPos(circleX, circleY, controlScale);
	buttonX.setPos(circleX - button_spacing, circleY + button_spacing, controlScale);
	buttonTri.setPos(circleX - button_spacing, circleY - button_spacing, controlScale);
	buttonSq.setPos(circleX - button_spacing * 2, circleY, controlScale);

	crossPad.setPos(leftX + arrow_spacing, leftY, 40, controlScale);

	buttonSelect.setPos(halfW - button_spacing * 2, h - 20 * controlScale, controlScale);
	buttonStart.setPos(halfW , h - 20 * controlScale, controlScale);
	buttonTurbo.setPos(halfW + button_spacing * 2 , h - 20 * controlScale, controlScale);
	buttonLShoulder.setPos(button_spacing + 10 * controlScale, 30 * controlScale, controlScale);
	buttonRShoulder.setPos(w - button_spacing - 10 * controlScale, 30 * controlScale, controlScale);


#if defined(__SYMBIAN32__) || defined(IOS)
	buttonPause.setPos(halfW, 15 * controlScale, controlScale);
#endif

	leftStick.setPos(stickX, stickY, controlScale);
}
Beispiel #2
0
void LayoutGamepad(int w, int h)
{
	const int button_spacing = 50;
	const int arrow_spacing = 40;

	const int circleX = w - 40;
	const int circleY = h - 120;

	const int leftX = 40;
	int leftY = h - 120;

	if (g_Config.bShowAnalogStick) {
		leftY = h - 220;
	}

	const int stickX = leftX + arrow_spacing;
	const int stickY = h - 80;

	const int halfW = w / 2;

	buttonO.setPos(circleX, circleY);
	buttonX.setPos(circleX - button_spacing, circleY + button_spacing);
	buttonTri.setPos(circleX - button_spacing, circleY - button_spacing);
	buttonSq.setPos(circleX - button_spacing * 2, circleY);

	buttonLeft.setPos(leftX, leftY);
	buttonUp.setPos(leftX + arrow_spacing, leftY - arrow_spacing);
	buttonDown.setPos(leftX + arrow_spacing, leftY + arrow_spacing);
	buttonRight.setPos(leftX + arrow_spacing * 2, leftY);

	buttonSelect.setPos(halfW - button_spacing, h - 20);
	buttonStart.setPos(halfW + button_spacing, h - 20);
	buttonLShoulder.setPos(button_spacing + 10, 15);
	buttonRShoulder.setPos(w - button_spacing - 10, 15);

	leftStick.setPos(stickX, stickY);
}