afegida clase text
This commit is contained in:
@@ -43,6 +43,7 @@ set(APP_SOURCES
|
|||||||
source/core/rendering/shape_renderer.cpp
|
source/core/rendering/shape_renderer.cpp
|
||||||
source/core/graphics/shape.cpp
|
source/core/graphics/shape.cpp
|
||||||
source/core/graphics/shape_loader.cpp
|
source/core/graphics/shape_loader.cpp
|
||||||
|
source/core/graphics/vector_text.cpp
|
||||||
source/game/options.cpp
|
source/game/options.cpp
|
||||||
source/game/joc_asteroides.cpp
|
source/game/joc_asteroides.cpp
|
||||||
source/game/entities/nau.cpp
|
source/game/entities/nau.cpp
|
||||||
|
|||||||
1
Makefile
1
Makefile
@@ -43,6 +43,7 @@ APP_SOURCES := \
|
|||||||
source/core/rendering/shape_renderer.cpp \
|
source/core/rendering/shape_renderer.cpp \
|
||||||
source/core/graphics/shape.cpp \
|
source/core/graphics/shape.cpp \
|
||||||
source/core/graphics/shape_loader.cpp \
|
source/core/graphics/shape_loader.cpp \
|
||||||
|
source/core/graphics/vector_text.cpp \
|
||||||
source/game/options.cpp \
|
source/game/options.cpp \
|
||||||
source/game/joc_asteroides.cpp \
|
source/game/joc_asteroides.cpp \
|
||||||
source/game/entities/nau.cpp \
|
source/game/entities/nau.cpp \
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
JocAsteroides::JocAsteroides(SDL_Renderer *renderer)
|
JocAsteroides::JocAsteroides(SDL_Renderer *renderer)
|
||||||
: renderer_(renderer), nau_(renderer), itocado_(0) {
|
: renderer_(renderer), nau_(renderer), itocado_(0), text_(renderer) {
|
||||||
// Inicialitzar bales amb renderer
|
// Inicialitzar bales amb renderer
|
||||||
for (auto &bala : bales_) {
|
for (auto &bala : bales_) {
|
||||||
bala = Bala(renderer);
|
bala = Bala(renderer);
|
||||||
@@ -73,6 +73,12 @@ void JocAsteroides::dibuixar() {
|
|||||||
bala.dibuixar();
|
bala.dibuixar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [PRUEBA] Text vectorial
|
||||||
|
text_.render("0123456789", {10, 10}, 1.5f);
|
||||||
|
text_.render("SCORE: 1234", {10, 40}, 1.0f);
|
||||||
|
text_.render("10:45", {10, 70}, 2.0f);
|
||||||
|
text_.render("LEVEL-3", {10, 110}, 1.5f);
|
||||||
|
|
||||||
// TODO: Dibuixar marges (Fase 11)
|
// TODO: Dibuixar marges (Fase 11)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#ifndef JOC_ASTEROIDES_HPP
|
#ifndef JOC_ASTEROIDES_HPP
|
||||||
#define JOC_ASTEROIDES_HPP
|
#define JOC_ASTEROIDES_HPP
|
||||||
|
|
||||||
|
#include "core/graphics/vector_text.hpp"
|
||||||
#include "core/types.hpp"
|
#include "core/types.hpp"
|
||||||
#include "game/constants.hpp"
|
#include "game/constants.hpp"
|
||||||
#include "game/entities/bala.hpp"
|
#include "game/entities/bala.hpp"
|
||||||
@@ -35,6 +36,9 @@ private:
|
|||||||
Poligon chatarra_cosmica_;
|
Poligon chatarra_cosmica_;
|
||||||
uint16_t itocado_;
|
uint16_t itocado_;
|
||||||
|
|
||||||
|
// [NUEVO] Text vectorial
|
||||||
|
Graphics::VectorText text_;
|
||||||
|
|
||||||
// Funcions privades
|
// Funcions privades
|
||||||
void tocado();
|
void tocado();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user