本文整理汇总了C++中TouchStick::setPos方法的典型用法代码示例。如果您正苦于以下问题:C++ TouchStick::setPos方法的具体用法?C++ TouchStick::setPos怎么用?C++ TouchStick::setPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TouchStick
的用法示例。
在下文中一共展示了TouchStick::setPos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LayoutGamepad
void LayoutGamepad(int w, int h)
{
float controlScale = g_Config.bLargeControls ? g_Config.fButtonScale : 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);
if (g_Config.iFpsLimit)
buttonVPS.setPos(halfW - button_spacing * 2, h - 20 * controlScale, controlScale);
else
buttonTurbo.setPos(halfW - button_spacing * 2, h - 20 * controlScale, controlScale);
buttonSelect.setPos(halfW , h - 20 * controlScale, controlScale);
buttonStart.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) || defined(MEEGO_EDITION_HARMATTAN)
buttonPause.setPos(halfW, 15 * controlScale, controlScale);
#endif
leftStick.setPos(stickX, stickY, controlScale);
}
示例2: LayoutGamepad
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);
buttonLeft.setPos(leftX, leftY, controlScale);
buttonUp.setPos(leftX + arrow_spacing, leftY - arrow_spacing, controlScale);
buttonDown.setPos(leftX + arrow_spacing, leftY + arrow_spacing, controlScale);
buttonRight.setPos(leftX + arrow_spacing * 2, leftY, controlScale);
buttonSelect.setPos(halfW - button_spacing, h - 20 * controlScale, controlScale);
buttonStart.setPos(halfW + button_spacing, h - 20 * controlScale, controlScale);
buttonLShoulder.setPos(button_spacing + 10 * controlScale, 15 * controlScale, controlScale);
buttonRShoulder.setPos(w - button_spacing - 10 * controlScale, 15 * controlScale, controlScale);
#if defined(__SYMBIAN32__) || defined(IOS)
buttonPause.setPos(halfW, 15 * controlScale, controlScale);
#endif
leftStick.setPos(stickX, stickY, controlScale);
}
示例3: LayoutGamepad
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);
}