Пример #1
0
void CBfDrawButton::OnPaint()
{
	if (IsMouseDown())
	{
		DrawButton(Color(44, 98, 139),
			Color(229, 244, 252), Color(196, 229, 246),
			Color(152, 209, 239), Color(104, 179, 219),
			Color(100, 52, 87, 114), Color(52, 87, 114), RGB(212, 212, 212));
	}
	else
	{
		if (IsMouseHover())
		{
			DrawButton(Color(60, 127, 177),
				Color(234, 246, 253), Color(217, 240, 252),
				Color(190, 230, 253), Color(167, 217, 245),
				Color(100, 105, 150, 184), Color(105, 150, 184), RGB(255, 255, 255));
		}
		else
		{
			DrawButton(Color(112, 112, 112),
				Color(242, 242, 242), Color(235, 235, 235),
				Color(221, 221, 221), Color(207, 207, 207),
				Color(100, 145, 145, 145), Color(145, 145, 145), RGB(255, 255, 255));
		}
	}
}
Пример #2
0
void StageState::OnUpdate(float dt) {
	bool flag = false;
	for (int i = 0; i < 15; i++) {
		if (NButtons[i]->getOn()) {
			flag = true;
			break;
		}
	}
	if (flag)
		SetCursor(LoadCursor(NULL, IDC_HAND));
	else
		SetCursor(LoadCursor(NULL, IDC_ARROW));
	if (IsMouseDown(0)) {
		if (NButtons[0]->getClick()) {
			StateMgr()->ChangeState(5);
		}
		if (NButtons[1]->getClick()) {
			PostQuitMessage(0);
		}
	}
}
Пример #3
0
 bool IsMouse() const {
   return IsMouseDown() || event.type == SDL_MOUSEBUTTONUP ||
     event.type == SDL_MOUSEMOTION;
 }
Пример #4
0
 bool IsMouse() const {
   return IsMouseDown() || msg.message == WM_LBUTTONUP ||
     msg.message == WM_LBUTTONDBLCLK;
 }
Пример #5
0
 bool IsUserInput() const {
   return IsKey() || IsMouseDown();
 }
Пример #6
0
 bool IsMouse() const {
   return IsMouseDown() || type == MOUSE_UP || type == MOUSE_MOTION ||
     type == MOUSE_WHEEL;
 }