- Timestamp:
- Feb 4, 2006, 4:42:28 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r7029 r7031 55 55 this->toCoordinate = NULL; 56 56 this->toDirection = NULL; 57 this->toSize = NULL; 57 58 this->setSize2D(1, 1); 58 59 … … 221 222 } 222 223 224 void Element2D::setSizeSoft2D(float x, float y, float bias) 225 { 226 if (likely(this->toSize == NULL)) 227 this->toSize = new Vector2D(); 228 229 *this->toSize = Vector2D(x,y);; 230 this->bias = bias; 231 } 232 233 223 234 224 235 /** … … 247 258 this->bRelCoorChanged = true; 248 259 } 249 250 260 251 261 /** … … 798 808 } 799 809 } 810 if (unlikely(this->toSize != NULL)) 811 { 812 Vector2D shiftSize = (*this->toSize - Vector2D(this->sizeX, this->sizeY)) *fabsf(dt)*bias; 813 if (likely((shiftSize).len() >= .001))//PNODE_ITERATION_DELTA)) 814 { 815 this->sizeX += shiftSize.x; 816 this->sizeY += shiftSize.y; 817 } 818 else 819 { 820 delete this->toSize; 821 this->toSize = NULL; 822 PRINTF(5)("SmoothRotate of %s finished\n", this->getName()); 823 } 824 } 800 825 801 826 // MAIN UPDATE ///////////////////////////////////// -
trunk/src/lib/graphics/render2D/element_2d.h
r6848 r7031 10 10 11 11 #include "vector.h" 12 #include "vector2D.h" 12 13 #include <list> 13 14 … … 124 125 125 126 inline void setSize2D(float x, float y) { this->sizeX = x, this->sizeY = y; }; 127 void setSizeSoft2D(float x, float y, float bias = 1.0); 126 128 inline void setSizeX2D(float x) { this->sizeX = x; }; 127 129 inline void setSizeY2D(float y) { this->sizeY = y; }; … … 234 236 float sizeX; //!< The size of the rendered item in x-direction 235 237 float sizeY; //!< The size of the rendered Item in y-direction 238 Vector2D* toSize; //!< The Size to iterate to. 236 239 237 240 E2D_ALIGNMENT alignment; //!< How the Element is aligned around its Position -
trunk/src/story_entities/simple_game_menu.cc
r7030 r7031 376 376 { 377 377 this->menuSelected = this->menuLayers[this->layerIndex].menuList[++this->menuSelectedIndex]; 378 this->menuSelector->setAbsCoor 2D(this->menuSelected->getAbsCoor2D() + Vector(0, this->menuSelected->getSizeY2D() *.5,0));379 this->menuSelector->setSize (this->menuSelected->getSizeX2D(), this->menuSelected->getSizeY2D());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); 380 380 381 381 if( this->layerIndex == 1) … … 391 391 { 392 392 this->menuSelected = this->menuLayers[this->layerIndex].menuList[--this->menuSelectedIndex]; 393 this->menuSelector->setAbsCoor 2D(this->menuSelected->getAbsCoor2D() + Vector(0, this->menuSelected->getSizeY2D() *.5,0));394 this->menuSelector->setSize (this->menuSelected->getSizeX2D(), this->menuSelected->getSizeY2D());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); 395 395 396 396 if( this->layerIndex == 1)
Note: See TracChangeset
for help on using the changeset viewer.