예제 #1
0
void CzApp::UpdateSystemTouches()
{
	CzXomlVariableArrayInt* arr = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("touches");

	// Update system array
	int count = 1;
	if (CZ_INPUT->isMultiTouch())
		count = 5;
	CzString num;
	num.setAutoHash(false);
	int index = 0;
	for (int t = 0; t < 5; t++)
	{
		CzXomlVariableInt* var = (CzXomlVariableInt*)arr->getElement(index++);
		CzTouch* touch = CZ_INPUT->getTouch(t);
		if (touch->x != var->NativeValue)
		{
			var->NativeValue = touch->x;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
		var = (CzXomlVariableInt*)arr->getElement(index++);
		if (touch->y != var->NativeValue)
		{
			var->NativeValue = touch->y;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
		var = (CzXomlVariableInt*)arr->getElement(index++);
		if ((int)touch->touched != var->NativeValue)
		{
			var->NativeValue = (int)touch->touched;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
	}
}
예제 #2
0
void CzApp::NotifyOrientationChanged()
{
	CzXomlVariableArrayInt* arr = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("system");
	arr->getElement(SYS_SCREEN_ORIENTATION)->setValue(CzString(ScreenOrientation).c_str());

	IzPlatformDisplay* display = PLATFORM_DISPLAY;
	CzUIBase::UpdatePresetAnimations();
	ScreenSize.x = display->getCurrentWidth();
	ScreenSize.y = display->getCurrentHeight();

	for (_Iterator it = begin(); it != end(); it++)
	{
		if (!(*it)->isDestroyed())
		{
			(*it)->NotifyOrientationChanged();
		}
	}
}