Changeset 1598 for code/branches/hud/src/orxonox/hud/HUDOverlay.cc
- Timestamp:
- Jun 14, 2008, 4:19:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/hud/HUDOverlay.cc
r1595 r1598 43 43 , windowAspectRatio_(1.0f) 44 44 , bCorrectAspect_(false) 45 , size_(1.0f) 46 , sizeCorrection_(1.0f) 45 , size_(1.0f, 1.0f) 46 , sizeCorrection_(1.0f, 1.0f) 47 , angle_(0.0f) 48 , position_(0.0f, 0.0f) 49 , origin_(0.5f, 0.5f) 47 50 { 48 51 RegisterObject(HUDOverlay); … … 62 65 } 63 66 67 XMLPortParam(HUDOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode); 64 68 XMLPortParam(HUDOverlay, "size", setSize, getSize, xmlElement, mode); 65 XMLPortParam(HUDOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode);66 XMLPortParam(HUDOverlay, "scroll", setScroll, getScroll, xmlElement, mode);67 69 XMLPortParam(HUDOverlay, "rotation", setRotation, getRotation, xmlElement, mode); 70 XMLPortParam(HUDOverlay, "origin", setOrigin, getOrigin, xmlElement, mode); 71 XMLPortParam(HUDOverlay, "position", setPosition, getPosition, xmlElement, mode); 68 72 69 73 if (mode == XMLPort::LoadObject) … … 124 128 void HUDOverlay::sizeChanged() 125 129 { 126 this->overlay_->setScale(size_.x * sizeCorrection_.x, size_. x* sizeCorrection_.y);130 this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y); 127 131 } 128 132 133 /** 134 @remarks 135 This function can be overriden by any derivative. 136 */ 137 void HUDOverlay::angleChanged() 138 { 139 this->overlay_->setRotate(this->angle_); 140 } 141 142 /** 143 @remarks 144 This function can be overriden by any derivative. 145 */ 146 void HUDOverlay::positionChanged() 147 { 148 Vector2 scroll = (position_ - 0.5 - size_ * (origin_ - 0.5)) * 2.0; 149 this->overlay_->setScroll(scroll.x, -scroll.y); 150 } 129 151 }
Note: See TracChangeset
for help on using the changeset viewer.