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

Author Topic: Using Sprite Arrays  (Read 1029 times)

0 Members and 1 Guest are viewing this topic.

Wrapperup

  • Newbie
  • *
  • Posts: 3
    • View Profile
Using Sprite Arrays
« on: May 18, 2014, 12:54:32 am »
Hi, I would like to use sprite arrays for my game's GUI class, as they are very easy to stylize and do fancy stuff.


Resized


The sprite array would show up in SFML like so:



Some parts will stretch across, some are the corners and the middle will resize to needs.

What would be the best way of achieving this?


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Using Sprite Arrays
« Reply #1 on: May 18, 2014, 02:12:28 am »
There's no "best" way.

Just go with whatever way comes into your mind.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Wrapperup

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Using Sprite Arrays
« Reply #2 on: May 18, 2014, 02:33:25 am »
Alright, then I'm going to have it set up like this:
Load sprite
Change TextureRect to fit each box (probably have arguments to define the size of each sprite box)
Draw for each box

All the drawing will be put into a RenderTexture, for easy management

Seems to be the best way i can think of.

 

anything