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


C++ TouchButton::setPos方法代码示例

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


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

示例1: 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);

	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);
}
开发者ID:rodeoliba0007,项目名称:ppsspp,代码行数:42,代码来源:GamepadEmu.cpp

示例2: 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);
}
开发者ID:ChrisAldama,项目名称:ppsspp,代码行数:37,代码来源:GamepadEmu.cpp


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