Exemplo n.º 1
0
bool 
IntroState::apply(const CEGUI::EventArgs &e){
  
  CEGUI::Slider* slider = static_cast<CEGUI::Slider*>(static_cast<const CEGUI::WindowEventArgs&>(e).window->getRootWindow()->getChild("background_options")->getChild("SliderSpeed"));
  float aux=slider->getCurrentValue();
  
  CEGUI::ToggleButton* cb = static_cast<CEGUI::ToggleButton*>(static_cast<const CEGUI::WindowEventArgs&>(e).window->getRootWindow()->getChild("background_options")->getChild("CBAutoReload"));

  ofstream archivo;  // objeto de la clase ofstream
  archivo.open("data/Config.txt");
  archivo<<"MouseSpeed = "+Ogre::StringConverter::toString((int)aux)<< endl;
  archivo<<"AutoReaload = "+Ogre::StringConverter::toString(cb->isSelected())<< endl;
  archivo.close();

  //Cambio de resolucion-----------
  if(_fullscreen){
    _root->getAutoCreatedWindow()->resize(1920,1200);
    renderer->setDisplaySize(CEGUI::Sizef(1920,1200));
    _root->getAutoCreatedWindow()->setFullscreen(true,1920,1200);
  }else{
    _root->getAutoCreatedWindow()->resize(_resWidth,_resHeigt);
    renderer->setDisplaySize(CEGUI::Sizef(_resWidth,_resHeigt));
    _root->getAutoCreatedWindow()->setFullscreen(false,_resWidth,_resHeigt);
  }
  
  //-------------------------------
  return true;
}
Exemplo n.º 2
0
/*************************************************************************
    Event handler for the FPS value checkbox selection change
*************************************************************************/
bool CustomShapesDrawingSample::handleToggleButtonShowRandomisedFpsSelectionChanged(const CEGUI::EventArgs& args)
{
    const CEGUI::WindowEventArgs& winArgs = static_cast<const CEGUI::WindowEventArgs&>(args);
    CEGUI::ToggleButton* checkbox = static_cast<CEGUI::ToggleButton*>(winArgs.window);

    d_useRealFPS = !checkbox->isSelected();

    return true;
}
Exemplo n.º 3
0
bool 
IntroState::tbFullscreenChanged(const CEGUI::EventArgs &e){
  CEGUI::ToggleButton* cb = static_cast<CEGUI::ToggleButton*>(static_cast<const CEGUI::WindowEventArgs&>(e).window->getRootWindow()->getChild("background_options")->getChild("CBFullscreen"));
  if(cb->isSelected()){
    //_root->getAutoCreatedWindow()->resize(_resWidth,_resHeigt);
    //renderer->setDisplaySize(CEGUI::Sizef(_resWidth,_resHeigt));//CESAR
    //_root->getAutoCreatedWindow()->setFullscreen(true,_resWidth,_resHeigt);//CESAR
    _fullscreen=true;
  }else{
    //_root->getAutoCreatedWindow()->resize(_resWidth,_resHeigt);
    //renderer->setDisplaySize(CEGUI::Sizef(_resWidth,_resHeigt));//CESAR
    //_root->getAutoCreatedWindow()->setFullscreen(false,_resWidth,_resHeigt);//CESAR
    _fullscreen=true;
  }

  return true;
}