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

Author Topic: Sort Sprite List by Scale  (Read 1707 times)

0 Members and 1 Guest are viewing this topic.

Carlo Meroni

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Sort Sprite List by Scale
« on: October 07, 2013, 06:09:28 pm »
Hi! I have a list of Sprite and i want to sort it by the scale of the sprite (sprite.getScale ()). How can I do it ?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Carlo Meroni

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Sort Sprite List by Scale
« Reply #2 on: October 07, 2013, 07:37:52 pm »
I can not do it with those examples ... I'm not very good with C + +.
Can someone please show me an example with a list of sprites?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Sort Sprite List by Scale
« Reply #3 on: October 07, 2013, 08:06:50 pm »
I can not do it with those examples ... I'm not very good with C + +.
Can someone please show me an example with a list of sprites?

Those are very generic examples that you should easily be able to understand. Try to write something and if it doesn't work then post again while showing some code.

And if you are not familiar with C++ I highly recommend that you find a good C++ book and learn C++ before trying SFML.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: Sort Sprite List by Scale
« Reply #4 on: October 07, 2013, 08:08:33 pm »
I can not do it with those examples ... I'm not very good with C + +.
Why not? Where are you stuck? What do you not understand with the examples?

Do you know how STL containers and algorithms work? If not you should grab a good C++ book and learn some more basics of C++ first. C++ is a complex language and SFML requires you to have some basic understanding. Developing a game or application on the other hand requires you to have a lot more than just basic knowledge of if, for, while and #include. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/