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

Author Topic: Slices of an image  (Read 1892 times)

0 Members and 1 Guest are viewing this topic.

chbrules

  • Newbie
  • *
  • Posts: 16
    • AOL Instant Messenger - Conrad1986
    • View Profile
Slices of an image
« on: August 03, 2010, 01:35:51 pm »
Ok, call me stupid if this blaringly obvious concept exists and I've just totally missed it in the SFML docs, but I'm not seeing a way to make sprites use a "rect" area of a loaded Image (*see how SDL lets you do that).

Basically, what I want to do is load in an image of a pre-defined set of animation frames. Say there's 3 frames of animation for the player facing the four compass directions sequentially all on a single image. I want to be able to "slice" that single image of animation frames up into sprites, or at least have 1 sprite that I can program to sift through the animation sequence on the image for each frame. How might one go about doing that?

Thanks!  :D

chbrules

  • Newbie
  • *
  • Posts: 16
    • AOL Instant Messenger - Conrad1986
    • View Profile
Slices of an image
« Reply #1 on: August 03, 2010, 01:48:04 pm »
Oh wait, I am stupid. I see how to use the sprite's get and set subrect functions to do it. :3

 

anything