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

Author Topic: All sprites disappear when i scale up any sprites. [solved]  (Read 1619 times)

0 Members and 1 Guest are viewing this topic.

baguettio

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
All sprites disappear when i scale up any sprites. [solved]
« on: March 07, 2020, 08:56:01 pm »
    Sprite player;
    player.setTexture(blue);
    player.setColor(Color(0, 255, 0));

    Sprite sprite1;
    sprite1.setTexture(blue);
    sprite1.setPosition(Vector2f(0, 700));


Works fine, but this:

    Sprite player;
    player.setTexture(blue);
    player.setColor(Color(0, 255, 0));

    Sprite sprite1;
    sprite1.setTexture(blue);
    sprite1.setPosition(Vector2f(0, 700));
    sprite1.setScale(10.f, 0.f);


causes sprite1 to not be drawn, or registered in my collision system, similar issue happens when I try and add a third sprite.
« Last Edit: March 07, 2020, 09:58:36 pm by baguettio »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: All sprites disappear when i scale up any sprites.
« Reply #1 on: March 07, 2020, 09:01:50 pm »
That's because its height is zero after scaling.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

baguettio

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: All sprites disappear when i scale up any sprites.
« Reply #2 on: March 07, 2020, 09:08:38 pm »
why am i this stupid

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: All sprites disappear when i scale up any sprites.
« Reply #3 on: March 07, 2020, 09:10:03 pm »
Everyone makes these errors all the time. Don't worry about it! :D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything