Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 22, 2008, 12:06:55 AM (16 years ago)
Author:
rgrieder
Message:
  • added blankString to String so you can return ""; even if it's a const std::string&
  • fixed several bugs with aspect correct and margin alignment
  • added console commands for OrxonoxOverlays and OverlayGroups for rotate, scale and scroll (you can access the by name (from name=.. in xml file), e.g. "OrxonoxOverlay rotateOverlay SpeedBar 90)
  • converted everything in overlays/ to 4 spaces/tab ;)
  • removed all using namespace Ogre;
  • added background_ Panel to OrxonoxOverlay, since most of the derived classes can use that
  • should work now, but I'll have to test on a tardis box first
File:
1 edited

Legend:

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

    r1614 r1615  
    4242    {
    4343    public:
    44         Ogre::Overlay* getOverlay() { return this->overlay_; }
    4544        OrxonoxOverlay();
    4645        virtual ~OrxonoxOverlay();
     
    7069
    7170        /** Sets the rotation applied to this overlay.*/
    72         void setRotation(const Ogre::Radian& angle) { this->angle_ = angle; this->angleChanged(); }
     71        void setRotation(const Degree& angle) { this->angle_ = angle; this->angleChanged(); }
    7372
    7473        /** Gets the rotation applied to this overlay, in degrees.*/
     
    7675
    7776        /** Adds the passed in angle to the rotation applied to this overlay. */
    78         void rotate(const Radian& angle) { this->angle_ += angle; this->angleChanged(); }
     77        void rotate(const Degree& angle) { this->angle_ += angle; this->angleChanged(); }
    7978
    8079        /** Sets the size of this overlay. */
     
    9392        void scale(Vector2 scale) { this->size_ *= scale; this->sizeChanged(); }
    9493
     94        static void scaleOverlay(const std::string& name, float scale);
     95        static void scrollOverlay(const std::string& name, const Vector2& scroll);
     96        static void rotateOverlay(const std::string& name, const Degree& angle);
     97
    9598    protected:
    9699        virtual void changedVisibility();
     
    98101        virtual void angleChanged();
    99102        virtual void positionChanged();
    100         float getWindowAspectRatio() { return windowAspectRatio_; }
     103        virtual void sizeCorrectionChanged();
    101104
    102105        void setBackgroundMaterial(const std::string& material);
    103         std::string getBackgroundMaterial() const;
     106        const std::string& getBackgroundMaterial() const;
    104107
    105108        Ogre::Overlay* overlay_;
    106109        Ogre::PanelOverlayElement* background_;
    107 
    108     private:
    109         void windowResized(int newWidth, int newHeight);
    110 
    111110        float windowAspectRatio_;
    112111        bool bCorrectAspect_;
     
    117116        Vector2 origin_;
    118117
     118    private:
     119        void windowResized(int newWidth, int newHeight);
     120
    119121        static unsigned int hudOverlayCounter_s;
     122        static std::map<std::string, OrxonoxOverlay*> overlays_s;
    120123  };
    121124}
Note: See TracChangeset for help on using the changeset viewer.