Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 12, 2008, 10:42:15 PM (16 years ago)
Author:
rgrieder
Message:
  • removed conversion functions in String.h
  • you can use convertToString and convertFromString from Convert.h as shortcuts
  • added "true", "false", "on", "off", "yes" and "no" as boolean values to the Converter
  • Conversion bool —> string newly gives "true" or "false"
  • HUDOverlay can deal with the aspect ratio, e.g. circles stay circles when resizing
  • the rest isn't yet finished: svn save ;)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/hud/HUDOverlay.h

    r1590 r1595  
    4747      virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    4848
    49       virtual void changedVisibility();
     49      void setAspectCorrection(bool val);
     50      bool getAspectCorrection() { return this->bCorrectAspect_; }
    5051
    5152      /** Sets the scrolling factor of this overlay. */
     
    6869
    6970      /** Sets the scaling factor of this overlay. */
    70       void setScale(const Vector2& scale) { overlay_->setScale(scale.x, scale.y); }
     71      void setSize(const Vector2& size) { this->size_ = size; this->sizeChanged(); }
    7172
    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_; }
    7481
    7582      /** 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(); }
    7784
    7885    protected:
    79       virtual void windowResized(int newWidth, int newHeight);
     86      virtual void changedVisibility();
     87      virtual void sizeChanged();
     88      float getWindowAspectRatio() { return windowAspectRatio_; }
    8089
    8190      Ogre::Overlay* overlay_;
    82       float windowAspectRatio_;
    83       int windowWidth_;
    84       int windowHeight_;
    8591
    8692    private:
     93      void windowResized(int newWidth, int newHeight);
     94
     95      float windowAspectRatio_;
     96      bool bCorrectAspect_;
     97      Vector2 size_;
     98      Vector2 sizeCorrection_;
     99
    87100      static unsigned int hudOverlayCounter_s;
    88 
    89101  };
    90102}
Note: See TracChangeset for help on using the changeset viewer.