Changeset 1627 for code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
- Timestamp:
- Jun 26, 2008, 7:00:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r1625 r1627 96 96 if (mode == XMLPort::LoadObject) 97 97 { 98 // set some default values99 this->windowAspectRatio_ = 1.0f;100 this->bCorrectAspect_ = false;101 this->size_ = Vector2(1.0f, 1.0f);102 this->sizeCorrection_ = Vector2(1.0f, 1.0f);103 this->position_ = Vector2(0.0f, 0.0f);104 this->pickPoint_ = Vector2(0.0f, 0.0f);105 this->angle_ = Radian(0.0f);106 107 98 // add this overlay to the static map of OrxonoxOverlays 108 99 if (overlays_s.find(this->getName()) != overlays_s.end()) … … 122 113 this->overlay_->add2D(this->background_); 123 114 124 // We'll have to get the aspect ratio for the first. Afterwards windowResized() gets115 // We'll have to get the aspect ratio manually for the first time. Afterwards windowResized() gets 125 116 // called automatically by the GraphicsEngine. 126 117 this->windowResized(GraphicsEngine::getSingleton().getWindowWidth(), 127 118 GraphicsEngine::getSingleton().getWindowHeight()); 119 120 this->changedVisibility(); 121 122 this->setSize(Vector2(0.5f, 0.5f)); 123 this->setPickPoint(Vector2(0.5f, 0.5f)); 124 this->setPosition(Vector2(0.5f, 0.5f)); 125 this->setRotation(Degree(0.0f)); 126 this->setAspectCorrection(true); 127 this->setBackgroundMaterial(""); 128 128 } 129 129 130 XMLPortParam(OrxonoxOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode); 131 XMLPortParam(OrxonoxOverlay, "size", setSize, getSize, xmlElement, mode); 132 XMLPortParam(OrxonoxOverlay, "rotation", setRotation, getRotation, xmlElement, mode); 133 // see setPickPoint() 134 XMLPortParam(OrxonoxOverlay, "pickPoint", setPickPoint, getPickPoint, xmlElement, mode); 135 XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode); 136 XMLPortParam(OrxonoxOverlay, "background", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode); 137 138 if (mode == XMLPort::LoadObject) 139 { 140 // call all the virtual 'setters' 141 this->changedVisibility(); 142 this->angleChanged(); 143 this->sizeCorrectionChanged(); 144 this->sizeChanged(); 145 // probably gets called 4 times (by all the methods), but sizeChanged() could be overwritten. 146 this->positionChanged(); 147 } 130 XMLPortParam(OrxonoxOverlay, "size", setSize, getSize, xmlElement, mode) 131 .defaultValues(Vector2(0.5f, 0.5f)); 132 XMLPortParam(OrxonoxOverlay, "pickPoint", setPickPoint, getPickPoint, xmlElement, mode) 133 .defaultValues(Vector2(0.0f, 0.0f)); 134 XMLPortParam(OrxonoxOverlay, "position", setPosition, getPosition, xmlElement, mode) 135 .defaultValues(Vector2(0.0f, 0.0f)); 136 XMLPortParam(OrxonoxOverlay, "rotation", setRotation, getRotation, xmlElement, mode) 137 .defaultValues(0.0f); 138 XMLPortParam(OrxonoxOverlay, "correctAspect", setAspectCorrection, getAspectCorrection, xmlElement, mode) 139 .defaultValues(true); 140 XMLPortParam(OrxonoxOverlay, "background", setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode) 141 .defaultValues(""); 148 142 } 149 143
Note: See TracChangeset
for help on using the changeset viewer.