52 m_pTexture = resourceManager.
Load<
Texture>(
"Textures\\Logo.png");
59 Font *pFont = resourceManager.
Load<
Font>(
"Fonts\\arial.ttf");
63 enum Items { START_GAME, QUIT };
64 std::string text[COUNT] = {
"Start Game",
"Quit" };
66 for (
int i = 0; i < COUNT; i++)
void OnMainMenuScreenRemoved(Screen *pScreen)
Callback function for when the main menu screen is removed from the screen manager.
void OnStartGameSelect(MenuScreen *pScreen)
Callback function for when the Start Game menu item is selected.
void OnQuitSelect(MenuScreen *pScreen)
Callback function for when the Quit menu item is selected.
The gameplay screen for the Space Fighter Game. It is responsible for creating and loading levels.
static const Color Blue
Blue.
static const Color White
White.
Represents a font or true-type font.
static void SetLoadSize(const int size, const bool restore=false)
Specifies the size of the font when loaded.
virtual void Quit()
Quits the game.
static Vector2 GetScreenCenter()
Gets the screen size in pixels.
Contains timing values for game updates and rendering.
Loads and manages the lifespan of objects from external files.
T * Load(const std::string &path, const bool cache=true, const bool appendContentPath=true)
Load and manage a resource.
Base class for all game screens and menus.
virtual ScreenManager * GetScreenManager()
Gets a pointer to the ScreenManager, for managing game screens.
virtual Game * GetGame() const
Gets a pointer to the Game.
float GetAlpha() const
Gets the overall screen transition alpha value (or opacity). This is handy for fading screens in and ...
virtual void SetTransitionInTime(double seconds)
Set the time in seconds that the screen should transition in.
virtual void Show()
Tells the screen to transition in.
virtual void Exit()
Tells the screen to transition out. When the screen has completed its transition, UnloadContent() wil...
virtual void SetTransitionOutTime(double seconds)
Set the time in seconds that the screen should transition out.
virtual void SetRemoveCallback(OnRemove callback)
Sets the callback function for when the screen is about to be removed by the screen manager.
virtual void AddScreen(Screen *pScreen)
Add a screen to be managed.
Enables a group of sprites to be drawn using the same settings.
void Begin(const SpriteSortMode sortMode=SpriteSortMode::Deferred, const BlendState blendState=BlendState::Alpha, ALLEGRO_TRANSFORM *pTransformation=NULL)
Begins a sprite batch operation.
void End()
Flushes the sprite batch and restores the device state to how it was before Begin was called.
void Draw(const Texture *pTexture, const Vector2 position, const Region region, const Color color=Color::White, const Vector2 origin=Vector2::ZERO, const Vector2 scale=Vector2::ONE, const float rotation=0, const float drawDepth=0)
Adds a sprite to a batch of sprites to be rendered.
Represents a 2D grid of texels.
Vector2 GetCenter() const
Gets the center position of the texture.
Defines a vector with 2 components (x and y).
static const Vector2 UNIT_Y
A unit vector on the y-axis.
The main menu screen for the game.
MainMenuScreen()
Instantiate a main menu screen object.
virtual void Update(const GameTime &gameTime)
Unload the content for the screen.
virtual void Draw(SpriteBatch &spriteBatch)
Render the screen.
virtual void SetQuittingGame()
Set the flag to quit the game, so the game will exit when screen fades out.
virtual bool IsQuittingGame()
Check if the game is quitting.
virtual void LoadContent(ResourceManager &resourceManager)
Load the content for the screen.