#Yellow lines won't go

14 messages · Page 1 of 1 (latest)

toxic ermine
#

Hello, I'm using Raylib and right now I'm making a function that draws rectangles with borders but for some reason there's yellow lines everywhere and they won't go no matter what I do.

I tried them without static_cast, I tried (float) I tried to create them as float at the start but none of them worked I still have yellow lines (If there's useless or wrong codes please tell me I have started scripting in C++ like a week ago, thanks)

indigo raptorBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@toxic ermine

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

toxic ermine
#
#include <iostream>
#include "raylib.h"

#define SCREEN_WIDTH  1280 // Window Values
#define SCREEN_HEIGHT 800
#define SCREEN_NAME   "Placeholder Name"
#define BASE_FPS   60

struct DrawBorderedRectangle // WIDTH, HEIGHT, MULT, POSX, POSY, COLOR1, COLOR2, IsDefault?
{
    int REC_WIDTH;
    int REC_HEIGHT;
    int RECBOR_MULT;
    int REC_POSX;
    int REC_POSY;
    Color REC_COLOR;
    Color RECBOR_COLOR;
    bool DEFAULT;
};

void DrawHoverableRectangle(const DrawBorderedRectangle& DBR)
    {
        
        if (DBR.DEFAULT)
            {
                Rectangle R  = 
                    {
                        (static_cast<float>(SCREEN_WIDTH)  / 0.5f) - (static_cast<float>(DBR.REC_WIDTH)  / 0.5f),
                        (static_cast<float>(SCREEN_HEIGHT) / 0.5f) - (static_cast<float>(DBR.REC_HEIGHT) / 0.5f),
                        static_cast<float>(DBR.REC_WIDTH),
                        static_cast<float>(DBR.REC_HEIGHT)
                    };

                DrawRectangleRec(R, DBR.REC_COLOR);
                DrawRectangleLinesEx(R, 3.0f, DBR.RECBOR_COLOR);
            }
        else
            {
                Rectangle R = 
                    {
                        static_cast<float>(DBR.REC_POSX  ),
                        static_cast<float>(DBR.REC_POSY  ),
                        static_cast<float>(DBR.REC_WIDTH ),
                        static_cast<float>(DBR.REC_HEIGHT)
                    };
                DrawRectangleRec(R, DBR.REC_COLOR);
                DrawRectangleLinesEx(R, DBR.RECBOR_MULT, DBR.RECBOR_COLOR);
            }
    }

bright phoenix
#

Move your mouse over them and see what the issue is

toxic ermine
#

I already have tried that

#

and it says that I should change them from int to float

#

Let me send you what it says incase I didn't understand it right

bright phoenix
#

Mmm, is there any chance that you already fixed those warnings, and the squiggles just didn't update?

#

They do that in if you set "problemMatcher" to ["$gcc]" in tasks.json. Set it [] to disable this

#

No idea why this is the default, no one wants this 😛

toxic ermine
#

Thanks a lot hiding them makes them less annoying

indigo raptorBOT
# indigo raptor

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity