-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added updated source code with generated doxygen
- Loading branch information
Showing
484 changed files
with
21,121 additions
and
1,002 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
#include "Background.hpp" | ||
#include "background.hpp" | ||
#include <string> | ||
|
||
Background::Background(std::string filename): | ||
drawable(sf::Vector2f(0,0), sf::Vector2f(0, 0),"Background"), | ||
filename(filename) | ||
{ | ||
background_texture.loadFromFile(filename); | ||
background_sprite.setTexture(background_texture); | ||
} | ||
|
||
sf::FloatRect Background::getGlobalBounds() { | ||
return background_sprite.getGlobalBounds(); | ||
background_image{ | ||
image_from_file(sf::Vector2f(0,0),filename) | ||
} | ||
{} | ||
|
||
void Background::draw( sf::RenderWindow &window ) { | ||
window.draw(background_sprite); | ||
background_image.draw(window); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,46 @@ | ||
///@file | ||
|
||
/*! | ||
* \file Background.hpp | ||
* | ||
* \author Luke Roovers | ||
* \date 23-1-2017 | ||
* | ||
* Background class | ||
*/ | ||
|
||
|
||
#ifndef _BACKGROUND_HPP | ||
#define _BACKGROUND_HPP | ||
|
||
#include "drawable.hpp" | ||
#include <SFML\Graphics.hpp> | ||
|
||
#include <SFML/Graphics.hpp> | ||
#include "image.hpp" | ||
#include <iostream> | ||
#include <string> | ||
|
||
/*! | ||
* \class Background | ||
* | ||
* \brief Class that draws a background | ||
* | ||
* class with a position, size and name, that is inherited by all | ||
* object that can be drawn on the screen. | ||
* | ||
* \date 23/01/17 | ||
*/ | ||
class Background:public drawable | ||
/// | ||
/// \class Background | ||
/// | ||
/// \brief Class that draws a background | ||
/// | ||
/// class with a position, size and name, that is inherited by all | ||
/// object that can be drawn on the screen. | ||
/// | ||
/// \date 23/01/17 | ||
|
||
class Background | ||
{ | ||
public: | ||
/*! drawable(std::string str = "x") | ||
* \brief constructor for background class | ||
* | ||
* constructor that initializes the file that the background class will use. Default is "x", if default a default picture will be loaded. | ||
* | ||
* \param[in] str name of the .png file that will be loaded as a background, this is a sf::Vector2f | ||
*/ | ||
/// \brief constructor for background class | ||
/// | ||
/// constructor that initializes the file that the background class will use. Default is "x", if default a default picture will be loaded. | ||
/// | ||
/// \param[in] std::string name of the .png file that will be loaded as a background | ||
|
||
Background(std::string filename); | ||
/*!void draw(sf::RenderWindow & window) override | ||
* \brief Draw function for background class | ||
* | ||
* defines draw function in super class. Draws the background. | ||
* | ||
* \param[in] window SFML window that is used to display the drawable | ||
*/ | ||
void draw(sf::RenderWindow &window) override; | ||
|
||
sf::FloatRect getGlobalBounds() override; | ||
/// void draw(sf::RenderWindow & window) override | ||
/// \brief Draw function for background class | ||
/// | ||
/// defines draw function in super class. Draws the background. | ||
/// | ||
/// \param[in] window SFML window that is used to display the drawable | ||
/// | ||
void draw(sf::RenderWindow &window); | ||
private: | ||
sf::Texture background_texture; | ||
sf::Sprite background_sprite; | ||
std::string filename; | ||
image_from_file background_image; | ||
|
||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.