Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Rectangle Colors - weird problem  (Read 2212 times)

0 Members and 1 Guest are viewing this topic.

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Rectangle Colors - weird problem
« on: October 03, 2010, 12:17:03 pm »
Okey, I try to display a rectangle around my string if mouse is over it, detecting if mouse is over string works great but when I want to draw a rectangle without fill and red borders I get some weird colors errors.
When I go in Debug with this parametrs of functions:

Code: [Select]

prostokat = sfShape_CreateRectangle(P1X, P1Y, P2X, P2Y, sfBlack, 2, sfBlue);
sfShape_EnableFill(prostokat, false);

I get red borders with no fill but to get this I need to set sfBlue as borders colors why?x_X
When I set sfBlue i get sfRed.
And when I set sfRed I don't get anything.

Okey now second problem, when I go in Release with the same parametrs I get no rectangle, but when I set sfBlack as 5 parametr and as last parametr I get rectangle but with really low visible borders.

Code of drawing function:
Code: [Select]

int RysujKwadrat(float P1X, float P1Y, float P2X, float P2Y)
{
prostokat = sfShape_Create();
prostokat = sfShape_CreateRectangle(P1X, P1Y, P2X, P2Y, sfBlack, 2, sfBlue);
sfShape_EnableFill(prostokat, false);
return 0;
}


Code of showing it on screen:
Code: [Select]

if (CzyNajechany(NapisMenuGlowne) == TRUE) // cheking if mouse is over string
{
RysujKwadrat(info.Left ,info.Top, info.Right, info.Bottom);
sfRenderWindow_DrawShape(aaa, prostokat);
}

Info structure is from function sfString_GetRect

Could someone tell me why it's working so freakcing weird?




EDIT: Fixed, I just create "new" Red using sfColor_CreateFromRGB function and it works pefect.
Sorry for useless thread.

 

anything