34 #ifndef _OrxonoxOverlay_H__ 35 #define _OrxonoxOverlay_H__ 94 virtual void changedName()
override;
97 void show() { this->setVisible(
true); }
99 void hide() { this->setVisible(
false); }
109 void setPosition(Vector2 pos) { this->position_ = pos; this->positionChanged(); }
115 void scroll(
const Vector2& offset) { this->position_ += offset; this->positionChanged(); }
121 void setPickPoint(
const Vector2& position){ this->pickPoint_ = position; this->positionChanged(); }
127 void setRotation(
const Degree& angle) { this->angle_ = angle; this->angleChanged(); }
133 void rotate(
const Degree& angle) { this->angle_ += angle; this->angleChanged(); }
136 void setSize(
const Vector2& size) { this->size_ = size; this->sizeChanged(); }
139 const Vector2&
getSize()
const {
return this->size_; }
142 Vector2
getActualSize()
const {
return this->size_ * this->sizeCorrection_; }
148 void scale(
const Vector2& scale) { this->size_ *=
scale; this->sizeChanged(); }
151 static void scaleOverlay(
const std::string& name,
float scale);
153 static void scrollOverlay(
const std::string& name,
const Vector2& scroll);
154 static void toggleVisibility(
const std::string& name);
157 static void rotateOverlay(
const std::string& name,
const Degree& angle);
159 void setBackgroundMaterial(
const std::string& material);
162 void setBackgroundTexture(
const std::string& texture);
165 void setBackgroundAlpha(
float alpha);
167 void setBackgroundColour(ColourValue
colour);
169 virtual void changedVisibility()
override;
173 if (this->owner_ != owner)
175 this->owner_ = owner;
176 this->changedOwner();
180 {
return this->owner_; }
185 {
return this->group_; }
187 { this->changedVisibility(); }
188 void setZOrder(
unsigned short order);
191 virtual void angleChanged();
192 virtual void sizeCorrectionChanged();
193 virtual void sizeChanged();
194 virtual void positionChanged();
209 virtual void windowResized(
unsigned int newWidth,
unsigned int newHeight)
override;
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
BaseObject * getOwner() const
Definition: OrxonoxOverlay.h:179
Vector2 size_
Internal size of the overlay.
Definition: OrxonoxOverlay.h:201
void setAspectCorrection(bool val)
Sets whether the aspect of the overlay is corrected.
Definition: OrxonoxOverlay.h:104
Degree angle_
Rotation angle of the overlay.
Definition: OrxonoxOverlay.h:205
Ogre::Pass * backgroundAlphaPass_
Definition: OrxonoxOverlay.h:217
void hide()
Hides the overlay with an detour to BaseObject::visibility_.
Definition: OrxonoxOverlay.h:99
::std::string string
Definition: gtest-port.h:756
const Vector2 & getSizeCorrection() const
Gets the current size correction (default: 1.0, 1.0)
Definition: OrxonoxOverlay.h:145
Interface for receiving window events like resize, moved and focusChanged.
Definition: WindowEventListener.h:43
Ogre::Overlay * overlay_
The overlay the entire class is about.
Definition: OrxonoxOverlay.h:196
void setSize(const Vector2 &size)
Sets the size of this overlay.
Definition: OrxonoxOverlay.h:136
virtual void changedOverlayGroup()
Definition: OrxonoxOverlay.h:186
Vector2 position_
Position of the pickPoint on the screen.
Definition: OrxonoxOverlay.h:203
Ogre::ColourValue colour(const btVector3 &color, btScalar alpha)
Definition: OgreBulletUtils.h:41
const Vector2 & getSize() const
Gets the current size that was set (uncorrected)
Definition: OrxonoxOverlay.h:139
bool getAspectCorrection() const
Returns whether the window aspect is corrected.
Definition: OrxonoxOverlay.h:106
SUPER_FUNCTION(0, BaseObject, XMLPort, false)
const Vector2 & getPickPoint() const
Gets the pick point of this overlay.
Definition: OrxonoxOverlay.h:124
static unsigned int hudOverlayCounter_s
Static counter for hud elements.
Definition: OrxonoxOverlay.h:211
xmlelement
Definition: Super.h:519
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
Ogre::PanelOverlayElement * background_
Background image (blank per default).
Definition: OrxonoxOverlay.h:197
const Vector2 & getPosition() const
Returns the current position on the screen.
Definition: OrxonoxOverlay.h:112
static std::map< std::string, OrxonoxOverlay * > overlays_s
Contains all the overlays in a map for quick access via console commands.
Definition: OrxonoxOverlay.h:214
RotationState
Describes the rotational state of a an overlay.
Definition: OrxonoxOverlay.h:81
void rotate(const Degree &angle)
Rotates the overlay by angle degrees.
Definition: OrxonoxOverlay.h:133
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
bool bCorrectAspect_
Whether or not to correct the size.
Definition: OrxonoxOverlay.h:200
float windowAspectRatio_
Screen.width / screen.height.
Definition: OrxonoxOverlay.h:199
Vector2 pickPoint_
Point on the overlay to pick when translating.
Definition: OrxonoxOverlay.h:204
Mode
Definition: CorePrereqs.h:102
Shared library macros, enums, constants and forward declarations for the orxonox library ...
OverlayGroup * getOverlayGroup() const
Definition: OrxonoxOverlay.h:184
Declaration of BaseObject, the base class of all objects in Orxonox.
void show()
Shows the overlay with an detour to BaseObject::visibility_.
Definition: OrxonoxOverlay.h:97
Base class to display content directly onto the screen.
Definition: OrxonoxOverlay.h:72
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together.
Definition: OverlayGroup.h:53
void scroll(const Vector2 &offset)
Scrolls the overlay.
Definition: OrxonoxOverlay.h:115
RotationState rotState_
horizontal, vertical or inbetween
Definition: OrxonoxOverlay.h:206
void setPickPoint(const Vector2 &position)
Sets the point in the overlay where to pick it when translating.
Definition: OrxonoxOverlay.h:121
const Degree & getRotation() const
Gets the rotation angle applied to this overlay in degrees.
Definition: OrxonoxOverlay.h:130
virtual void changedOwner()
Definition: OrxonoxOverlay.h:181
void setPosition(Vector2 pos)
Sets the position of this overlay on the screen.
Definition: OrxonoxOverlay.h:109
void setRotation(const Degree &angle)
Sets the rotation angle applied to this overlay in degrees.
Definition: OrxonoxOverlay.h:127
BaseObject * owner_
Definition: OrxonoxOverlay.h:215
Vector2 getActualSize() const
Gets the actual size of the overlay on the screen (corrected)
Definition: OrxonoxOverlay.h:142
Definition of all super-function related macros, used to call functions of the base class...
OverlayGroup * group_
Definition: OrxonoxOverlay.h:216
void scale(const Vector2 &scale)
Scales the overlay by scale.
Definition: OrxonoxOverlay.h:148
Vector2 sizeCorrection_
Value to correct the size because of the window aspect.
Definition: OrxonoxOverlay.h:202
void setOwner(BaseObject *owner)
Definition: OrxonoxOverlay.h:171