Example #1
0
void  GUIPanel::render(float tick)
{
  if(!isAttached() || !parent)
    return;

  Widgets comboBoxes;
  GUIComboBox *cbPTR;

  if(visible)
  {
    renderClippedBounds();
    for(size_t t = 0; t < elements.size(); t++)
      if(elements[t]->getWidgetType() != WT_COMBO_BOX)
        elements[t]->render(tick);
      else
      {
        cbPTR = (GUIComboBox*)elements[t];
        if(!cbPTR->isDeployed())
          cbPTR->render(tick);
        else
          comboBoxes.push_back(elements[t]);
      }

    for(size_t t = 0; t < comboBoxes.size(); t++)
      comboBoxes[t]->render(tick);
  }
}
Example #2
0
void GUIButton::render(float clockTick)
{
  if(!parent || !visible)
    return;

  modifyCurrentAlpha(clockTick);
  bgColor = color;

  Tuple3f tempColor    = label.getColor();
  float   displacement = 2.0f*(pressed || clicked)*bounce;
  int     xCenter      = (windowBounds.x + windowBounds.z)/2,
          yCenter      = (windowBounds.y + windowBounds.w)/2;

  glTranslatef(displacement, displacement, 0.0);
  renderClippedBounds();
  label.printCenteredXY(xCenter, yCenter);
  glTranslatef(-displacement, -displacement, 0.0f);
}
Example #3
0
void GUIButton::render(float clockTick)
{
  if(!parent || !visible)
    return;

  modifyCurrentAlpha(clockTick);
  bgColor = color;

  D3DXFROMWINEVECTOR3 tempColor    = label.getColor();
  float   displacement = 2.0f*(STX_Service::GetInputInstance()->IsMouseButtonPressed())*bounce;
  int     xCenter      = (windowBounds.x + windowBounds.z)/2,
          yCenter      = (windowBounds.y + windowBounds.w)/2;

  m_Translation=D3DXFROMWINEVECTOR3(displacement, displacement, 0.0);
  renderClippedBounds(&m_Translation);
  label.printCenteredXY(xCenter+m_Translation.x, yCenter+m_Translation.y);
  m_Translation=D3DXFROMWINEVECTOR3(-displacement, -displacement, 0.0f);
}