Skip to content
Snippets Groups Projects
Commit 00278d6a authored by PoloNX's avatar PoloNX
Browse files

added circle cursor for icons under payload

parent 3d823829
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ CXXFLAGS := $(CFLAGS) -fexceptions -fno-rtti -fno-exceptions -std=gnu++17 -Wno-r
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LIBS := -lminizip -lstdc++fs -lz -lfreetype -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2 -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lwebp -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx`
LIBS := -lminizip -lstdc++fs -lz -lfreetype -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2 -lEGL -lGLESv2 -lglapi -ldrm_nouveau -lwebp -lpng -ljpeg `sdl2-config --libs` `freetype-config --libs` -lnx
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
......
......@@ -17,6 +17,7 @@ private:
int column = 0;
SDL_Rect rectCursor {0, 0, 0, 0};
void moveCursorX(bool right);
void cursorRecenter();
void refreshPos();
public:
......
......@@ -36,6 +36,8 @@ public:
int horizontal = 0;
int vertical = 0;
void renderCursorCircle(int column);
void drawCircleBehindIcons();
private:
......
......@@ -87,17 +87,39 @@ bool Cursor::checkInputCursor(int value)
return false;
}
void Cursor::printCursor(RenderWindow render)
void Cursor::cursorRecenter()
{
if (column > 3){
column = 0;
if (line == 0){
if (column > 3){
column = 0;
}
if (column < 0){
column = 3;
}
}
if (column < 0){
column = 3;
if (line == 1){
if (column > 1){
column = 0;
}
if (column < 0){
column = 1;
}
}
}
void Cursor::printCursor(RenderWindow render)
{
cursorRecenter();
refreshPos();
rectCursor = {posX, posY, cursorWandH, cursorWandH};
render.renderRect(rectCursor);
if (line == 0){
rectCursor = {posX, posY, cursorWandH, cursorWandH};
render.renderRect(rectCursor);
}
else if (line == 1){
render.renderCursorCircle(column);
}
}
void Cursor::refreshPos(){
......@@ -113,3 +135,5 @@ void Cursor::refreshPos(){
......@@ -83,7 +83,6 @@ void Menu::printMenu()
vEntity.push_back(Entity (Vector2f(horizontal / 2 + size.x * 0.5, 550), tInfo, size.x, size.y, 0, 0));
for (auto i : vEntity)
{
window.render(i, 1);
......
......@@ -103,7 +103,7 @@ void RenderWindow::renderRect(SDL_Rect rect)
rectangleRGBA(renderer, cursor.getPosX() + 258 + i, cursor.getPosY() - i, cursor.getPosX() - i, cursor.getPosY() + 258 + i, 25, 145, 218, 255);
}*/
SDL_SetRenderDrawColor(renderer, 25, 145, 218, 255);
SDL_SetRenderDrawColor(renderer, 3, 194, 195, 255);
for (int i = 0; i < 5; ++i){
rect.w += 2;
rect.h += 2;
......@@ -118,4 +118,12 @@ void RenderWindow::drawCircleBehindIcons()
{
filledCircleRGBA(renderer, 1280 / 2 + 50, 575, 38, 80, 80, 80, 255);
filledCircleRGBA(renderer, 1280 / 2 - 50, 575, 38, 80, 80, 80, 255);
}
\ No newline at end of file
}
void RenderWindow::renderCursorCircle(int column)
{
for (int i = 0; i < 6; ++i){
circleRGBA(renderer, 552 + column * (100) + 38, 575, 38 + i, 3, 194, 195, 255);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment