- Timestamp:
- Feb 6, 2006, 10:12:34 PM (19 years ago)
- Location:
- trunk/src/story_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/simple_game_menu.cc
r7032 r7063 207 207 this->menuSelectedIndex = 0; 208 208 this->menuSelected = this->menuLayers[0].menuList[this->menuSelectedIndex]; 209 this-> menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D());209 this->sliderTo(this->menuSelected, 0.0f); 210 210 211 211 … … 376 376 { 377 377 this->menuSelected = this->menuLayers[this->layerIndex].menuList[++this->menuSelectedIndex]; 378 this->menuSelector->setAbsCoorSoft2D(this->menuSelected->getAbsCoor2D() + Vector(0, this->menuSelected->getSizeY2D() *.5,0), 3.0); 379 this->menuSelector->setSizeSoft2D(this->menuSelected->getSizeX2D(), this->menuSelected->getSizeY2D(), 3.0); 378 this->sliderTo(this->menuSelected, 5.0f); 380 379 381 380 if( this->layerIndex == 1) … … 391 390 { 392 391 this->menuSelected = this->menuLayers[this->layerIndex].menuList[--this->menuSelectedIndex]; 393 this->menuSelector->setAbsCoorSoft2D(this->menuSelected->getAbsCoor2D() + Vector(0, this->menuSelected->getSizeY2D() *.5,0), 3.0); 394 this->menuSelector->setSizeSoft2D(this->menuSelected->getSizeX2D(), this->menuSelected->getSizeY2D(), 3.0); 392 this->sliderTo(this->menuSelected, 5.0f); 395 393 396 394 if( this->layerIndex == 1) … … 450 448 } 451 449 450 void SimpleGameMenu::sliderTo(const Element2D* element, float bias) 451 { 452 if (bias > 0.0) 453 { 454 this->menuSelector->setAbsCoorSoft2D(element->getAbsCoor2D() + Vector(0, element->getSizeY2D() *.5,0), bias); 455 this->menuSelector->setSizeSoft2D(element->getSizeX2D(), element->getSizeY2D(), bias); 456 } 457 else 458 { 459 this->menuSelector->setAbsCoor2D(element->getAbsCoor2D() + Vector(0, element->getSizeY2D() *.5,0)); 460 this->menuSelector->setSize2D(element->getSizeX2D(), element->getSizeY2D()); 461 } 462 } 452 463 453 464 -
trunk/src/story_entities/simple_game_menu.h
r7019 r7063 69 69 void animateScene(float dt); 70 70 void switchMenuLayer(int layer1, int layer2); 71 void sliderTo(const Element2D* element, float bias = 0.0f); 71 72 72 73
Note: See TracChangeset
for help on using the changeset viewer.