Changeset 1632
- Timestamp:
- Jun 29, 2008, 5:37:26 PM (16 years ago)
- Location:
- code/trunk/src/orxonox/overlays
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r1628 r1632 207 207 float tempAspect; 208 208 if (angle > 89.0 && angle < 91.0) 209 { 209 210 tempAspect = 1.0 / this->windowAspectRatio_; 211 rotState_ = Vertical; 212 } 210 213 else if (angle > 179 || angle < 1) 214 { 211 215 tempAspect = this->windowAspectRatio_; 216 rotState_ = Horizontal; 217 } 212 218 else 219 { 213 220 tempAspect = 1.0; 221 rotState_ = Inbetween; 222 } 214 223 215 224 // note: this is only an approximation that is mostly valid when the -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r1625 r1632 69 69 class _OrxonoxExport OrxonoxOverlay : public BaseObject, public WindowEventListener 70 70 { 71 public: 72 /** 73 @brief 74 Describes the rotational state of a an overlay. 75 Horizontal means 0/180 degrees, Vertical is 90/270 degrees 76 and Inbetween is everything else. 77 */ 78 enum RotationState 79 { 80 Horizontal, 81 Vertical, 82 Inbetween 83 }; 84 71 85 public: 72 86 OrxonoxOverlay(); … … 156 170 Vector2 pickPoint_; //!< Point on the overlay to pick when translating 157 171 Radian angle_; //!< Rotation angle of the overlay 172 RotationState rotState_; //!< horizontal, vertical or inbetween 158 173 159 174 private: -
code/trunk/src/orxonox/overlays/OverlayText.cc
r1628 r1632 63 63 this->text_ = static_cast<Ogre::TextAreaOverlayElement*>(Ogre::OverlayManager::getSingleton() 64 64 .createOverlayElement("TextArea", "OverlayText_text_" + getUniqueNumberStr())); 65 this->text_->setCharHeight(1.0); 65 66 66 67 this->background_->addChild(this->text_); … … 91 92 return; 92 93 93 this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y); 94 if (this->rotState_ == Horizontal) 95 this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y); 96 else if (this->rotState_ == Vertical) 97 this->overlay_->setScale(size_.y / (sizeCorrection_.y * sizeCorrection_.y), size_.y * sizeCorrection_.y); 98 else 99 this->overlay_->setScale(size_.y, size_.y); 100 94 101 positionChanged(); 95 102 }
Note: See TracChangeset
for help on using the changeset viewer.