Quitadas todas las variables globales y transformadas en punteros
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
#include "background.h"
|
||||
|
||||
//Constructor
|
||||
// Constructor
|
||||
Background::Background()
|
||||
{
|
||||
init(0, 0, 0, 0, NULL);
|
||||
}
|
||||
|
||||
//Inicializador
|
||||
// Inicializador
|
||||
void Background::init(int x, int y, int w, int h, LTexture *texture)
|
||||
{
|
||||
//Establece el alto y el ancho del sprite del fondo
|
||||
// Establece el alto y el ancho del sprite del fondo
|
||||
mSprite.setWidth(w);
|
||||
mSprite.setHeight(h);
|
||||
|
||||
//Establece la posición X,Y del sprite del fondo
|
||||
// Establece la posición X,Y del sprite del fondo
|
||||
mSprite.setPosX(x);
|
||||
mSprite.setPosY(y);
|
||||
|
||||
//Establece la textura donde están los gráficos para el sprite del fondo
|
||||
// Establece la textura donde están los gráficos para el sprite del fondo
|
||||
mSprite.setTexture(*texture);
|
||||
|
||||
//Establece el rectangulo de donde coger la imagen
|
||||
// Establece el rectangulo de donde coger la imagen
|
||||
mSprite.setSpriteClip(0, 0, mSprite.getWidth(), mSprite.getHeight());
|
||||
}
|
||||
|
||||
//Pinta el fondo en la pantalla
|
||||
// Pinta el fondo en la pantalla
|
||||
void Background::render()
|
||||
{
|
||||
mSprite.render();
|
||||
|
||||
Reference in New Issue
Block a user