17 #ifndef IMAGERENDERER_H
18 #define IMAGERENDERER_H
22 #include "renderer/RenderNode.h"
23 #include "renderer/Texture.h"
210 void reloadTexture();
211 void updateLocalBoundingBox();
212 void setCulled(
bool value);
213 void updateVisibility();
216 bool mVisible =
true;
217 bool mWasVisible =
true;
218 bool mCacheRenderParams =
false;
219 bool mCullingControlsBodyActive =
false;
220 Actor* mActor =
nullptr;
221 Body* mBody =
nullptr;
222 float mSizeScale = 1.0f;
223 float mAspectRatio = 1.0f;
225 float mTextureAspectRatio = 1.0f;
227 bool mCulled =
false;
228 bool mSourceDirty =
false;
229 bool mTransformDirty =
true;
231 bool mHasCachedRenderParams =
false;
232 RenderParameters mCachedRenderParams;
237 QRectF mRenderTextureSubRect;
239 float mRenderRotation = 0.0f;
240 float mRenderOpacity = 1.0f;
244 #endif // IMAGERENDERER_H
float aspectRatio
Height of this image, as a ratio of the width.
Definition: ImageRenderer.h:55
virtual void computeSourceTextureRect(QRectF *textureSubRect) const
Computes the subrectangle within the source Texture to render.
void aspectRatioChanged()
Emitted when aspectRatio changes.
void sizeScaleChanged()
Emitted when sizeScale changes.
A QObject container for a Box2D b2Body.
Definition: Body.h:57
Callback set in a RenderNode which can be used to issues draw calls.
Definition: RenderableInterface.h:26
virtual void synchronizeForRendering(RenderList *renderList) override
Synchronize this Graphic for rendering, adding any RenderNodes to renderList, and buffering any data ...
float sizeScale
Width of this image, in world coordinates.
Definition: ImageRenderer.h:51
Base class for visual elements which are part of the game scene, and are rendered through Renderer...
Definition: Graphic.h:34
bool getCullingControlsBodyActive() const
Returns cullingControlsBodyActive.
Definition: ImageRenderer.h:134
bool isCulled() const
Returns whether or not this image has been culled because it is off screen.
Definition: ImageRenderer.h:144
void setCullingControlsBodyActive(bool value)
Sets cullingControlsBodyActive.
void visibleChanged()
Emitted when visible changes.
bool visible
Override of QQuickItem's visible property to set visibility.
Definition: ImageRenderer.h:47
void setSizeScale(float value)
Sets sizeScale.
float getSizeScale() const
Returns sizeScale.
Definition: ImageRenderer.h:98
virtual void render(RenderNode *node) override
Renders the associated node.
void cullingControlsBodyActiveChanged()
Emitted when cullingControlsBodyActive changes.
virtual void componentComplete() override
Post-initialization that checks for the existence of a parent Actor and the parent Actor's Body...
void markSourceTextureRectDirty()
Marks the texture rectangle as dirty, making ImageRenderer update.
virtual void computeDestTextureSize(QSizeF *textureSize) const
Computes the size to treat the source Texture, for purposes of computing destination rectangle size...
void setCacheRenderParams(bool value)
Sets cacheRenderParams.
std::shared_ptr< Texture > TexturePtr
Shared pointer typedef for Texture.
Definition: PointerDeclarations.h:173
const QString & getSource() const
Returns source.
Definition: ImageRenderer.h:116
void setAspectRatio(float value)
Sets aspectRatio.
Node which queues a callback (RenderableInterface) or MeshInstance for rendering. ...
Definition: RenderNode.h:33
bool cacheRenderParams
Controls whether or not the position, rotation, opacity, and z-depth are cached on first render...
Definition: ImageRenderer.h:68
bool isVisible() const
Returns visible.
Definition: ImageRenderer.h:89
bool getCacheRenderParams() const
Returns cacheRenderParams.
Definition: ImageRenderer.h:125
float getAspectRatio() const
Returns aspectRatio.
Definition: ImageRenderer.h:107
Representation of an entity within the Game scene.
Definition: Actor.h:40
void setSource(const QString &value)
Sets source.
List of RenderNodes, sorted by z-depth for rendering.
Definition: RenderList.h:36
void setVisible(bool value)
Sets visible.
Graphic which displays a texture as an image.
Definition: ImageRenderer.h:38
void sourceChanged()
Emitted when source changes.
void cacheRenderParamsChanged()
Emitted when cacheRenderParams changes.
QString source
Path to the source texture.
Definition: ImageRenderer.h:59
bool cullingControlsBodyActive
Controls whether or not the Actor's associated Body's Body::active property is linked to this image's...
Definition: ImageRenderer.h:77