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


C++ MoveUp函数代码示例

本文整理汇总了C++中MoveUp函数的典型用法代码示例。如果您正苦于以下问题:C++ MoveUp函数的具体用法?C++ MoveUp怎么用?C++ MoveUp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: MoveUp

EVENT_RESULT CGUISpinControl::OnMouseEvent(const CPoint &point, const CMouseEvent &event)
{
  if (event.m_id == ACTION_MOUSE_LEFT_CLICK)
  {
    if (m_imgspinUpFocus.HitTest(point))
      MoveUp();
    else if (m_imgspinDownFocus.HitTest(point))
      MoveDown();
    return EVENT_RESULT_HANDLED;
  }
  else if (event.m_id == ACTION_MOUSE_WHEEL_UP)
  {
    if (m_imgspinUpFocus.HitTest(point) || m_imgspinDownFocus.HitTest(point))
    {
      MoveUp();
      return EVENT_RESULT_HANDLED;
    }
  }
  else if (event.m_id == ACTION_MOUSE_WHEEL_DOWN)
  {
    if (m_imgspinUpFocus.HitTest(point) || m_imgspinDownFocus.HitTest(point))
    {
      MoveDown();
      return EVENT_RESULT_HANDLED;
    }
  }
  return EVENT_RESULT_UNHANDLED;
}
开发者ID:AndyPeterman,项目名称:mrmc,代码行数:28,代码来源:GUISpinControl.cpp

示例2: vec2

void Camera::Input()
{
	float sensitivity = 0.001f;
	float movAmt = static_cast<float>(10 * Time::GetDelta());
	float rotAmt = static_cast<float>(1.5f * Time::GetDelta());

	if (Input::GetMouseDown(GLFW_MOUSE_BUTTON_1))
	{
		m_cursorStoredPos = Input::GetCursorPosition();
		vec2 centerPos = vec2((float)WIDTH / 2.0f, (float)WIDTH / 2.0f);
		Input::SetCursorPosition(centerPos);
		Input::SetCursorVisibility(false);
		m_mouselocked = true;
	}

	if (Input::GetMouseUp(GLFW_MOUSE_BUTTON_1))
	{
		Input::SetCursorPosition(m_cursorStoredPos);
		Input::SetCursorVisibility(true);
		m_mouselocked = false;
	}

	if (m_mouselocked)
	{
		vec2 centerPos = vec2((float)WIDTH / 2.0f, (float)WIDTH / 2.0f);
		vec2 currentPos = Input::GetCursorPosition();
		vec2 deltaPos = centerPos - currentPos;

		bool rotY = deltaPos.x != 0;
		bool rotX = deltaPos.y != 0;

		if (rotY)
			RotateY(deltaPos.x * sensitivity);
		if (rotX)
			RotateX(deltaPos.y * sensitivity);

		if (rotY || rotX)
			Input::SetCursorPosition(centerPos);
	}

	if (Input::GetKey(GLFW_KEY_W))
	{
		MoveUp(movAmt);
	}
	if (Input::GetKey(GLFW_KEY_S))
	{
		MoveUp(-movAmt);
	}
	if (Input::GetKey(GLFW_KEY_D))
	{
		MoveRight(movAmt);
	}
	if (Input::GetKey(GLFW_KEY_A))
	{
		MoveRight(-movAmt);
	}

}
开发者ID:odygrd,项目名称:GameEngine,代码行数:58,代码来源:camera.cpp

示例3: IsMoving

void Game_Player::Update() {
	bool last_moving = IsMoving();

	if (!IsMoving() && !Game_Map::GetInterpreter().IsRunning() 
		&& !IsMoveRouteOverwritten() && !Game_Message::message_waiting) {
		switch (Input::dir4) {
			case 2:
				MoveDown();
				break;
			case 4:
				MoveLeft();
				break;
			case 6:
				MoveRight();
				break;
			case 8:
				MoveUp();
		}
	}

	int last_real_x = real_x;
	int last_real_y = real_y;

	Game_Character::Update();

	UpdateScroll(last_real_x, last_real_y);

	UpdateNonMoving(last_moving);
}
开发者ID:MarianoGnu,项目名称:Player,代码行数:29,代码来源:game_player.cpp

示例4: EvaluateShortestPathsHelper

void BfsHelper::EvaluateShortestPaths(std::pair<int, int> pos, int steps)
{
    EvaluateShortestPathsHelper(pos, MoveLeft(pos), steps);
    EvaluateShortestPathsHelper(pos, MoveRight(pos), steps);
    EvaluateShortestPathsHelper(pos, MoveUp(pos), steps);
    EvaluateShortestPathsHelper(pos, MoveDown(pos), steps);
}
开发者ID:bjowes,项目名称:cwg,代码行数:7,代码来源:BfsHelper.cpp

示例5: switch

bool
TaskEditPanel::OnKeyDown(unsigned key_code)
{
  switch (key_code){
  case VK_ESCAPE:
    if (IsAltair() && wTaskPoints->HasFocus()){
       wf.FocusFirstControl();
      return true;
    }
    return false;

  case '6': /* F5 */
    if (IsAltair()) {
      MoveUp();
      return true;
    } else
      return false;

  case '7': /* F6 */
    if (IsAltair()) {
      MoveDown();
      return true;
    } else
      return false;

  default:
    return false;
  }
}
开发者ID:osteocool,项目名称:XCSoar-1,代码行数:29,代码来源:TaskEditPanel.cpp

示例6: ScrollToOffset

bool CGUIFixedListContainer::MoveUp(bool wrapAround)
{
  if (m_offset > -m_cursor)
    ScrollToOffset(m_offset - 1);
  else if (wrapAround)
  {
    if (m_items.size() > 0)
    { // move 2 last item in list
      int offset = m_items.size() - m_cursor - 1;
      if (offset < -m_cursor) offset = -m_cursor;
      ScrollToOffset(offset);
      g_infoManager.SetContainerMoving(GetID(), -1);
    }
  }
  else
    return false;

  if (m_items.size() > (size_t) (m_offset +m_cursor) && m_items[m_offset +m_cursor]->GetPropertyBOOL("isseparator"))
  {
    if (m_offset +m_cursor == 0)
    {
      MoveDown(wrapAround);
      if (!wrapAround)
        return false;
    }
    else
    {
      MoveUp(wrapAround);
    }
  }

  return true;
}
开发者ID:DakaiTV,项目名称:DakaiBoxee,代码行数:33,代码来源:GUIFixedListContainer.cpp

示例7: Reset

        void Reset()
        {
            uiCycloneTimer = 3*IN_MILLISECONDS;
            uiBoltTimer = 7*IN_MILLISECONDS;
            uiThunderTimer = 12*IN_MILLISECONDS;
            uiHealthAmountModifier = 1;

            bOpFerok = false;
            bOpFerokFail = false;
            bOnGround = false;
            bCanDown = false;
            bAchiev = true;

            if (pInstance)
            {
                if (!bFirstTime)
                    pInstance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, FAIL);

                pInstance->SetData64(DATA_PL_JEDOGA_TARGET, 0);
                pInstance->SetData64(DATA_ADD_JEDOGA_OPFER, 0);
                pInstance->SetData(DATA_JEDOGA_RESET_INITIANDS, 0);
            }

            MoveUp();

            bFirstTime = false;
        }
开发者ID:Jekls,项目名称:trinity,代码行数:27,代码来源:boss_jedoga_shadowseeker.cpp

示例8: switch

bool
TaskEditPanel::OnKeyDown(unsigned key_code)
{
  switch (key_code){
  case KEY_ESCAPE:
    if (IsAltair() && GetList().HasFocus()){
       dialog.FocusFirstControl();
      return true;
    }
    return false;

  case '6': /* F5 */
    if (IsAltair()) {
      MoveUp();
      return true;
    } else
      return false;

  case '7': /* F6 */
    if (IsAltair()) {
      MoveDown();
      return true;
    } else
      return false;

  default:
    return false;
  }
}
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:29,代码来源:TaskEditPanel.cpp

示例9: switch

void
TaskEditPanel::OnAction(int id)
{
  switch (id) {
  case EDIT:
    OnEditTurnpointClicked();
    break;

  case MUTATE:
    OnMakeFinish();
    break;

  case UP:
    MoveUp();
    break;

  case DOWN:
    MoveDown();
    break;

  case REVERSE:
    ReverseTask();
    break;

  case CLEAR_ALL:
    OnClearAllClicked();
    break;
  }
}
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:29,代码来源:TaskEditPanel.cpp

示例10: EventArise

int CGUIListBox::Keyboard(UINT character, UINT state)
{
	if(character == VK_RETURN)
	{
		if(markListItem)
			EventArise(EList,0,markListItem->GetID(),0,0,0);
	}

	if (character == VK_UP) {
		MoveUp();
	}

	if (character == VK_DOWN) {
		MoveDown();
	}

	if (character == VK_RIGHT) {
		MoveRight();
	}

	if (character == VK_LEFT) {
		MoveLeft();
	}

	return 1;
}
开发者ID:HonzaMD,项目名称:Krkal2,代码行数:26,代码来源:list.cpp

示例11: MoveUp

void CChatWindow::AddInfoDebugMessage(const char * szFormat, ...)
{
	// Ensure we have a valid format string
	if(!szFormat)
		return;
	
#ifdef _DEBUG
	MoveUp();
	va_list vaArgs;
	va_start(vaArgs, szFormat);
	vsnprintf(m_chatMessages[0].szMessage, MAX_MESSAGE_LENGTH, szFormat, vaArgs);
	va_end(vaArgs);
	m_chatMessages[0].szMessage[MAX_MESSAGE_LENGTH] = '\0';
	m_chatMessages[0].messageColor = MESSAGE_INFO_COLOR;
	m_chatMessages[0].fNameExtent = 0;
	m_chatMessages[0].bAllowFormatting = true;
	m_iMessageAmount++;

	// Write info to log
	CLogFile::Open("Chatlog.log",true);
	CLogFile::Printf("DEBUG: %s",m_chatMessages[0].szMessage);
	CLogFile::Close();
	CLogFile::Open("Client.log",true);//Reopen client.log
#endif
}
开发者ID:AgresivD,项目名称:ivmultiplayer,代码行数:25,代码来源:CChatWindow.cpp

示例12: MoveUp

/********************************************************************************
Fly
********************************************************************************/
void Camera3::Fly(const double dt)
{
	if(dt > 0)
		MoveUp(dt);
	else if(dt < 0)
		MoveDown(dt);
}
开发者ID:barryHub20,项目名称:SP3,代码行数:10,代码来源:Camera3.cpp

示例13: QDialog

QueueManager::QueueManager(QWidget* parent)
    : QDialog(parent),
      ui_(new Ui_QueueManager),
      playlists_(nullptr),
      current_playlist_(nullptr) {
  ui_->setupUi(this);
  ui_->list->setItemDelegate(new QueuedItemDelegate(this, 0));

  // Set icons on buttons
  ui_->move_down->setIcon(IconLoader::Load("go-down"));
  ui_->move_up->setIcon(IconLoader::Load("go-up"));
  ui_->remove->setIcon(IconLoader::Load("edit-delete"));
  ui_->clear->setIcon(IconLoader::Load("edit-clear-list"));

  // Set a standard shortcut
  ui_->remove->setShortcut(QKeySequence::Delete);

  // Button connections
  connect(ui_->move_down, SIGNAL(clicked()), SLOT(MoveDown()));
  connect(ui_->move_up, SIGNAL(clicked()), SLOT(MoveUp()));
  connect(ui_->remove, SIGNAL(clicked()), SLOT(Remove()));
  connect(ui_->clear, SIGNAL(clicked()), SLOT(Clear()));

  QShortcut* close = new QShortcut(QKeySequence::Close, this);
  connect(close, SIGNAL(activated()), SLOT(close()));
}
开发者ID:Aceler,项目名称:Clementine,代码行数:26,代码来源:queuemanager.cpp

示例14: IsMoving

// Update
void Game_Player::Update() {
	bool last_moving = IsMoving();

	if (!IsMoving() && !Game_Map::GetInterpreter().IsRunning()
		/*move_route_forcing || Game_Temp::message_window_showing*/) {
		switch (Input::dir4) {
			case 2:
				MoveDown();
				break;
			case 4:
				MoveLeft();
				break;
			case 6:
				MoveRight();
				break;
			case 8:
				MoveUp();
		}
	}

	int last_real_x = real_x;
	int last_real_y = real_y;

	Game_Character::Update();

	UpdateScroll(last_real_x, last_real_y);

	UpdateNonMoving(last_moving);
}
开发者ID:Bonstra,项目名称:EasyRPG-Player,代码行数:30,代码来源:game_player.cpp

示例15: switch

bool Dock::HandleEvent( sf::Event &e )
{
    if( e.Type == sf::Event::KeyPressed ) {
        switch( e.Key.Code ) {
            case sf::Key::Escape:
                Deactivate();
                break;
            case sf::Key::Up:
                MoveUp();
                break;
            case sf::Key::Down:
                MoveDown();
                break;
            case sf::Key::Left:
                MoveLeft();
                break;
            case sf::Key::Right:
                MoveRight();
                break;
            case sf::Key::Return:
            case sf::Key::Space:
                Execute();
                break;
            default:
                break;
        }
    }
    return true;
}
开发者ID:treeman,项目名称:Sat-E,代码行数:29,代码来源:Dock.cpp


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