\hypertarget{classSpriteComponent}{}\doxysection{Sprite\+Component Class Reference}
\label{classSpriteComponent}\index{SpriteComponent@{SpriteComponent}}


{\ttfamily \#include $<$Sprite.\+hpp$>$}



Inheritance diagram for Sprite\+Component\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=181pt]{d8/d27/classSpriteComponent__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Sprite\+Component\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=298pt]{d1/daa/classSpriteComponent__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classSpriteComponent_a99e5eff28736f3fc109037078564249a}{Sprite\+Component}} (\mbox{\hyperlink{classTransformComponent}{Transform\+Component}} $\ast$transform)
\item 
\mbox{\hyperlink{classSpriteComponent_add14acc8523a724c112e6c93b750b60e}{$\sim$\+Sprite\+Component}} ()
\item 
void \mbox{\hyperlink{classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46}{Load\+Image}} (std\+::string file\+Path, SDL\+\_\+\+Renderer $\ast$ren, int w, int h, int frames, \mbox{\hyperlink{structVec2D}{Vec2D}} target\+Display)
\item 
\mbox{\hyperlink{structVec2D}{Vec2D}} \mbox{\hyperlink{classSpriteComponent_aea73c1a8481eb269e495acd51a05697f}{get\+Dimensions}} ()
\item 
void \mbox{\hyperlink{classSpriteComponent_ae8f47512e84273fd8f5312920affb275}{Update}} (SDL\+\_\+\+Event e, int frame, std\+::vector$<$ std\+::string $>$ broadcast\+List) override
\item 
void \mbox{\hyperlink{classSpriteComponent_a843ce3d3a2f37cce8ecc8418969b3607}{Render}} (SDL\+\_\+\+Renderer $\ast$ren) override
\item 
void \mbox{\hyperlink{classSpriteComponent_a574dfd6e371ececbcb9067a9d18453ea}{Show\+Component\+Editor}} (bool $\ast$show\+Editor) override
\item 
const char $\ast$ \mbox{\hyperlink{classSpriteComponent_a9f2e32f4d314f0b5f903c0730011656e}{Component\+Type\+Name}} () override
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions inherited from \mbox{\hyperlink{classComponent}{Component}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classComponent_a8775db6d1a2c1afc2e77cd3c8f39da6f}{Component}} ()
\item 
\mbox{\hyperlink{classComponent_ab8378fa275af98e568a7e91d33d867af}{$\sim$\+Component}} ()
\item 
virtual void \mbox{\hyperlink{classComponent_a9c764c2a5607ef52629458d361ebf16e}{Update}} (SDL\+\_\+\+Event e, int frame, std\+::vector$<$ std\+::string $>$ broadcast\+List)
\item 
virtual void \mbox{\hyperlink{classComponent_ab856bdb8c4357a080d7abcf99871a573}{Render}} (SDL\+\_\+\+Renderer $\ast$ren)
\item 
virtual void \mbox{\hyperlink{classComponent_a92af5bb942ea9633515a0c0e16a0bb8c}{Show\+Component\+Editor}} (bool $\ast$show\+Editor)
\item 
virtual bool \mbox{\hyperlink{classComponent_aed93a0ec70ebc71f34f02eb0a3ad4006}{Has\+Tag}} (Component\+Tag t)
\item 
virtual const char $\ast$ \mbox{\hyperlink{classComponent_a6ad359e7f57daa4ba249aaf5c88da052}{Component\+Type\+Name}} ()
\item 
void \mbox{\hyperlink{classComponent_aea8f0f460a62d86183020bd667b6cbf0}{Parse\+And\+Update\+Broadcast}} (std\+::vector$<$ std\+::string $>$ broadcast\+List)
\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classSpriteComponent_afcee0b9ee76c6b0013a993e50466e117}\label{classSpriteComponent_afcee0b9ee76c6b0013a993e50466e117} 
unsigned int {\bfseries m\+Current\+Frame} \{0\}
\item 
\Hypertarget{classSpriteComponent_afcbf10f9e30460e02009374391b4f697}\label{classSpriteComponent_afcbf10f9e30460e02009374391b4f697} 
unsigned int {\bfseries m\+Last\+Frame} \{7\}
\item 
\Hypertarget{classSpriteComponent_a2cd5e5e66aed591ebe9877853ea0db60}\label{classSpriteComponent_a2cd5e5e66aed591ebe9877853ea0db60} 
SDL\+\_\+\+Surface $\ast$ {\bfseries m\+Sprite\+Sheet} = nullptr
\item 
\Hypertarget{classSpriteComponent_ac4a5c71950c1aed25328f71973969831}\label{classSpriteComponent_ac4a5c71950c1aed25328f71973969831} 
SDL\+\_\+\+Texture $\ast$ {\bfseries m\+Texture} = nullptr
\item 
\Hypertarget{classSpriteComponent_aee0ed4d2284184d3057357346b912353}\label{classSpriteComponent_aee0ed4d2284184d3057357346b912353} 
SDL\+\_\+\+Rect {\bfseries m\+Src}
\item 
\Hypertarget{classSpriteComponent_a4febc662437993622c64835e238cd994}\label{classSpriteComponent_a4febc662437993622c64835e238cd994} 
SDL\+\_\+\+Rect {\bfseries m\+Dest}
\item 
\Hypertarget{classSpriteComponent_adc5b11a14b6698556822757f6c4a5376}\label{classSpriteComponent_adc5b11a14b6698556822757f6c4a5376} 
int {\bfseries width}
\item 
\Hypertarget{classSpriteComponent_a62ae7c4b06bd296958b8311c48e93138}\label{classSpriteComponent_a62ae7c4b06bd296958b8311c48e93138} 
int {\bfseries height}
\item 
\Hypertarget{classSpriteComponent_a61b278700c7a2355a8b155935479b903}\label{classSpriteComponent_a61b278700c7a2355a8b155935479b903} 
int {\bfseries frame\+Count}
\item 
\Hypertarget{classSpriteComponent_a59c93f7fd2f17bd377dfa31bcdc8e149}\label{classSpriteComponent_a59c93f7fd2f17bd377dfa31bcdc8e149} 
\mbox{\hyperlink{structVec2D}{Vec2D}} {\bfseries dimensions}
\item 
\Hypertarget{classSpriteComponent_a73e0ed30934991be535aeb7ec4ae1c85}\label{classSpriteComponent_a73e0ed30934991be535aeb7ec4ae1c85} 
\mbox{\hyperlink{classTransformComponent}{Transform\+Component}} $\ast$ {\bfseries transform}
\item 
\Hypertarget{classSpriteComponent_ab20997853d2e2b103b24cdd2cb765941}\label{classSpriteComponent_ab20997853d2e2b103b24cdd2cb765941} 
SDL\+\_\+\+Renderer $\ast$ {\bfseries last\+\_\+used} = nullptr
\end{DoxyCompactItemize}
\doxysubsection*{Additional Inherited Members}
\doxysubsubsection*{Protected Attributes inherited from \mbox{\hyperlink{classComponent}{Component}}}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classComponent_ab9b45a6a11e943c86770a1b3e085c25c}\label{classComponent_ab9b45a6a11e943c86770a1b3e085c25c} 
std\+::vector$<$ Component\+Tag $>$ {\bfseries tags}
\item 
\Hypertarget{classComponent_a929d29b8cdb9447b70f5e7d990c7d0f0}\label{classComponent_a929d29b8cdb9447b70f5e7d990c7d0f0} 
std\+::vector$<$ std\+::string $>$ {\bfseries previous\+Broadcasts}
\item 
\Hypertarget{classComponent_a7d03b8c23a6fa95fd83f08ad88cd59ee}\label{classComponent_a7d03b8c23a6fa95fd83f08ad88cd59ee} 
std\+::vector$<$ std\+::string $>$ {\bfseries pending\+Broadcasts}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A \doxylink{classComponent}{Component} implementation to load and display sprites. 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classSpriteComponent_a99e5eff28736f3fc109037078564249a}\label{classSpriteComponent_a99e5eff28736f3fc109037078564249a} 
\index{SpriteComponent@{SpriteComponent}!SpriteComponent@{SpriteComponent}}
\index{SpriteComponent@{SpriteComponent}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{SpriteComponent()}{SpriteComponent()}}
{\footnotesize\ttfamily Sprite\+Component\+::\+Sprite\+Component (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classTransformComponent}{Transform\+Component}} $\ast$}]{transform }\end{DoxyParamCaption})}

Construct a new Sprite \doxylink{classComponent}{Component} object


\begin{DoxyParams}{Parameters}
{\em transform} & the position of the parent \doxylink{classGameObject}{Game\+Object} \\
\hline
\end{DoxyParams}
Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{d6/d77/classSpriteComponent_a99e5eff28736f3fc109037078564249a_cgraph}
\end{center}
\end{figure}
\Hypertarget{classSpriteComponent_add14acc8523a724c112e6c93b750b60e}\label{classSpriteComponent_add14acc8523a724c112e6c93b750b60e} 
\index{SpriteComponent@{SpriteComponent}!````~SpriteComponent@{$\sim$SpriteComponent}}
\index{````~SpriteComponent@{$\sim$SpriteComponent}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{$\sim$SpriteComponent()}{\string~SpriteComponent()}}
{\footnotesize\ttfamily Sprite\+Component\+::$\sim$\+Sprite\+Component (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Destroy the Sprite \doxylink{classComponent}{Component} object 

\doxysubsection{Member Function Documentation}
\Hypertarget{classSpriteComponent_a9f2e32f4d314f0b5f903c0730011656e}\label{classSpriteComponent_a9f2e32f4d314f0b5f903c0730011656e} 
\index{SpriteComponent@{SpriteComponent}!ComponentTypeName@{ComponentTypeName}}
\index{ComponentTypeName@{ComponentTypeName}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{ComponentTypeName()}{ComponentTypeName()}}
{\footnotesize\ttfamily const char $\ast$ Sprite\+Component\+::\+Component\+Type\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [override]}, {\ttfamily [virtual]}}

The name of the component type. Used by the GUI

\begin{DoxySeeAlso}{See also}
\doxylink{classGameMakerGUI_a39546dd352c9c5d198f61e34011131b4}{Game\+Maker\+GUI\+::\+Create\+Component()} 
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
the name of the component 
\end{DoxyReturn}


Reimplemented from \mbox{\hyperlink{classComponent_a6ad359e7f57daa4ba249aaf5c88da052}{Component}}.

\Hypertarget{classSpriteComponent_aea73c1a8481eb269e495acd51a05697f}\label{classSpriteComponent_aea73c1a8481eb269e495acd51a05697f} 
\index{SpriteComponent@{SpriteComponent}!getDimensions@{getDimensions}}
\index{getDimensions@{getDimensions}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{getDimensions()}{getDimensions()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structVec2D}{Vec2D}} Sprite\+Component\+::get\+Dimensions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Get the dimensions of the Sprite.

\begin{DoxyReturn}{Returns}
the dimensions of the Sprite 
\end{DoxyReturn}
\Hypertarget{classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46}\label{classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46} 
\index{SpriteComponent@{SpriteComponent}!LoadImage@{LoadImage}}
\index{LoadImage@{LoadImage}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{LoadImage()}{LoadImage()}}
{\footnotesize\ttfamily void Sprite\+Component\+::\+Load\+Image (\begin{DoxyParamCaption}\item[{std\+::string}]{file\+Path,  }\item[{SDL\+\_\+\+Renderer $\ast$}]{ren,  }\item[{int}]{w,  }\item[{int}]{h,  }\item[{int}]{frames,  }\item[{\mbox{\hyperlink{structVec2D}{Vec2D}}}]{target\+Display }\end{DoxyParamCaption})}

Load a new image to be displayed.


\begin{DoxyParams}{Parameters}
{\em file\+Path} & the path to the imagefile (must be .bmp currently) \\
\hline
{\em ren} & the renderer to be drawn to \\
\hline
{\em w} & the width of the Sprite \\
\hline
{\em h} & the height of the Sprite \\
\hline
{\em frames} & how many frames are on the spritesheet \\
\hline
{\em target\+Display} & how big the displayed sprite is \\
\hline
\end{DoxyParams}
Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{d6/d77/classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{d6/d77/classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46_icgraph}
\end{center}
\end{figure}
\Hypertarget{classSpriteComponent_a843ce3d3a2f37cce8ecc8418969b3607}\label{classSpriteComponent_a843ce3d3a2f37cce8ecc8418969b3607} 
\index{SpriteComponent@{SpriteComponent}!Render@{Render}}
\index{Render@{Render}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{Render()}{Render()}}
{\footnotesize\ttfamily void Sprite\+Component\+::\+Render (\begin{DoxyParamCaption}\item[{SDL\+\_\+\+Renderer $\ast$}]{ren }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}

Render the Sprite.


\begin{DoxyParams}{Parameters}
{\em ren} & the SDL\+\_\+\+Renderer to draw the sprite to \\
\hline
\end{DoxyParams}


Reimplemented from \mbox{\hyperlink{classComponent_ab856bdb8c4357a080d7abcf99871a573}{Component}}.

\Hypertarget{classSpriteComponent_a574dfd6e371ececbcb9067a9d18453ea}\label{classSpriteComponent_a574dfd6e371ececbcb9067a9d18453ea} 
\index{SpriteComponent@{SpriteComponent}!ShowComponentEditor@{ShowComponentEditor}}
\index{ShowComponentEditor@{ShowComponentEditor}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{ShowComponentEditor()}{ShowComponentEditor()}}
{\footnotesize\ttfamily void Sprite\+Component\+::\+Show\+Component\+Editor (\begin{DoxyParamCaption}\item[{bool $\ast$}]{show\+Editor }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}

Using Imgui, render an editor for this component

\begin{DoxySeeAlso}{See also}
\doxylink{classGameMakerGUI_a2cc6da97c0f4b45175ddc9683308866e}{Game\+Maker\+GUI\+::\+Render\+Editor()} 
\end{DoxySeeAlso}

\begin{DoxyParams}{Parameters}
{\em show\+Editor} & \\
\hline
\end{DoxyParams}


Reimplemented from \mbox{\hyperlink{classComponent_a92af5bb942ea9633515a0c0e16a0bb8c}{Component}}.

Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{d6/d77/classSpriteComponent_a574dfd6e371ececbcb9067a9d18453ea_cgraph}
\end{center}
\end{figure}
\Hypertarget{classSpriteComponent_ae8f47512e84273fd8f5312920affb275}\label{classSpriteComponent_ae8f47512e84273fd8f5312920affb275} 
\index{SpriteComponent@{SpriteComponent}!Update@{Update}}
\index{Update@{Update}!SpriteComponent@{SpriteComponent}}
\doxysubsubsection{\texorpdfstring{Update()}{Update()}}
{\footnotesize\ttfamily void Sprite\+Component\+::\+Update (\begin{DoxyParamCaption}\item[{SDL\+\_\+\+Event}]{e,  }\item[{int}]{frame,  }\item[{std\+::vector$<$ std\+::string $>$}]{broadcast\+List }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}

Animate the Sprite based on the frame given. Updates the state of the component object. Called by the \doxylink{classEngine}{Engine} every tick


\begin{DoxyParams}{Parameters}
{\em e} & any inputs given by the user \\
\hline
{\em frame} & what frame is the game currently displaying \\
\hline
{\em broadcast\+List} & a list to be used to send messages between components \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxylink{classComponent_aea8f0f460a62d86183020bd667b6cbf0}{Parse\+And\+Update\+Broadcast()}
\end{DoxySeeAlso}
 

Reimplemented from \mbox{\hyperlink{classComponent_a9c764c2a5607ef52629458d361ebf16e}{Component}}.

Here is the call graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{d6/d77/classSpriteComponent_ae8f47512e84273fd8f5312920affb275_cgraph}
\end{center}
\end{figure}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
include/Sprite.\+hpp\item 
src/Sprite.\+cpp\end{DoxyCompactItemize}
