Changeset 1595 for code/branches/hud/src/orxonox/hud/HUDOverlay.h
- Timestamp:
- Jun 12, 2008, 10:42:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/hud/HUDOverlay.h
r1590 r1595 47 47 virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); 48 48 49 virtual void changedVisibility(); 49 void setAspectCorrection(bool val); 50 bool getAspectCorrection() { return this->bCorrectAspect_; } 50 51 51 52 /** Sets the scrolling factor of this overlay. */ … … 68 69 69 70 /** Sets the scaling factor of this overlay. */ 70 void setS cale(const Vector2& scale) { overlay_->setScale(scale.x, scale.y); }71 void setSize(const Vector2& size) { this->size_ = size; this->sizeChanged(); } 71 72 72 /** Gets the current scale value */ 73 Vector2 getScale() const { return Vector2(overlay_->getScaleX(), overlay_->getScaleY()); } 73 /** Gets the current size (not corrected) */ 74 Vector2 getSize() const { return this->size_; } 75 76 /** Gets the current size (corrected) */ 77 Vector2 getActualSize() const { return this->size_ * this->sizeCorrection_; } 78 79 /** Gets the current size correction */ 80 Vector2 getSizeCorrection() const { return this->sizeCorrection_; } 74 81 75 82 /** Scales the overlay */ 76 void scale(Vector2 scale) { overlay_->setScale(overlay_->getScaleX()*scale.x, overlay_->getScaleY()*scale.y); }83 void scale(Vector2 scale) { this->size_ *= scale; this->sizeChanged(); } 77 84 78 85 protected: 79 virtual void windowResized(int newWidth, int newHeight); 86 virtual void changedVisibility(); 87 virtual void sizeChanged(); 88 float getWindowAspectRatio() { return windowAspectRatio_; } 80 89 81 90 Ogre::Overlay* overlay_; 82 float windowAspectRatio_;83 int windowWidth_;84 int windowHeight_;85 91 86 92 private: 93 void windowResized(int newWidth, int newHeight); 94 95 float windowAspectRatio_; 96 bool bCorrectAspect_; 97 Vector2 size_; 98 Vector2 sizeCorrection_; 99 87 100 static unsigned int hudOverlayCounter_s; 88 89 101 }; 90 102 }
Note: See TracChangeset
for help on using the changeset viewer.