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

Author Topic: emoji as output  (Read 1645 times)

0 Members and 1 Guest are viewing this topic.

FellowCoder

  • Newbie
  • *
  • Posts: 8
    • View Profile
emoji as output
« on: January 25, 2020, 02:15:46 am »
 ::)I was trying to check the sf::RectangleShape color using std::cout<<map.blocos.getFillColor().r<<std::endl; and the output is just "☺", can someone explain me how this happened and what i have to do to get the shape color?

Edit: i specifically want the color alpha, i was just trying new things and this happened. Also the RGB of the shape is (1, 0, 0)
« Last Edit: January 25, 2020, 08:53:00 am by Laurent »

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: emoji as output
« Reply #1 on: January 25, 2020, 07:17:23 am »
r is Uint8, a typedef of unsigned char, so it cout as a char.
Cast it to an unsigned int before printing it.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: emoji as output
« Reply #2 on: January 29, 2020, 09:42:45 pm »
In addition to what G. said above, since you specifically want the alpha, you should use a instead of r.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything