Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
José Pardo Madera
/
ProjectoMultimeda2025
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
abb24053
authored
Apr 06, 2025
by
José Pardo Madera
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Posicionado elementos de la interfaz de la pantalla fecha.
parent
714c58ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
Executable
PantallaFecha.cpp
Texto.cpp
Executable
View file @
abb24053
No preview for this file type
PantallaFecha.cpp
View file @
abb24053
...
...
@@ -11,15 +11,17 @@ PantallaFecha::PantallaFecha() :
carne
(
Sprite
(
"assets/carneNombre.png"
),
Sprite
(
"assets/carneNombre.png"
),
Sprite
(
"assets/carneNombre.png"
),
Hitbox
(
0
,
0
,
0
,
0
),
0
,
0
,
0
,
0
,
normal
,
nullptr
),
botonesArriba
{
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
)
botonesArriba
{
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
300
,
200
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
600
,
200
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
1050
,
200
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Sprite
(
"assets/flechaArriba.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
1325
,
200
,
200
,
100
,
normal
,
nullptr
)
},
botonesAbajo
{
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
650
,
500
,
600
,
200
,
normal
,
nullptr
)
botonesAbajo
{
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
300
,
600
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
600
,
600
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
1050
,
600
,
200
,
100
,
normal
,
nullptr
),
Objeto
(
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Sprite
(
"assets/flechaAbajo.jpg"
),
Hitbox
(
0
,
0
,
0
,
0
),
1325
,
600
,
200
,
100
,
normal
,
nullptr
)
},
combinacionBuena
{
1
,
3
,
0
,
3
},
combinacionActual
{
0
,
0
,
0
,
0
}
...
...
@@ -90,10 +92,10 @@ void PantallaFecha::renderizar(SDL_Renderer *renderer, int tamx, int tamy) {
Texto
num3
(
fuente1
,
std
::
to_string
(
combinacionActual
[
2
]).
c_str
(),{
0
,
0
,
0
});
Texto
num4
(
fuente1
,
std
::
to_string
(
combinacionActual
[
3
]).
c_str
(),{
0
,
0
,
0
});
num1
.
renderizar
(
renderer
,
0
,
0
,
tamx
,
tamy
);
num2
.
renderizar
(
renderer
,
0
,
0
,
tamx
,
tamy
);
num3
.
renderizar
(
renderer
,
0
,
0
,
tamx
,
tamy
);
num4
.
renderizar
(
renderer
,
0
,
0
,
tamx
,
tamy
);
num1
.
renderizar
(
renderer
,
375
,
30
0
,
tamx
,
tamy
);
num2
.
renderizar
(
renderer
,
675
,
30
0
,
tamx
,
tamy
);
num3
.
renderizar
(
renderer
,
1125
,
30
0
,
tamx
,
tamy
);
num4
.
renderizar
(
renderer
,
1400
,
30
0
,
tamx
,
tamy
);
}
...
...
Texto.cpp
View file @
abb24053
...
...
@@ -4,7 +4,10 @@
SDL_Texture
*
Texto
::
get_textura
(
SDL_Renderer
*
renderer
)
{
if
(
texture
==
nullptr
)
{
texture
=
SDL_CreateTextureFromSurface
(
renderer
,
surface
);
texture
=
SDL_CreateTextureFromSurface
(
renderer
,
get_surface
());
if
(
texture
==
nullptr
)
{
throw
std
::
runtime_error
(
SDL_GetError
());
}
}
return
texture
;
}
...
...
@@ -33,4 +36,5 @@ void Texto::renderizar(SDL_Renderer *renderer, int x, int y, int tamx, int tamy)
dest
.
h
*=
(
tamy
/
1080.0
);
SDL_RenderCopy
(
renderer
,
texture
,
nullptr
,
&
dest
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment