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

Author Topic: SFML Draw Map  (Read 2020 times)

0 Members and 1 Guest are viewing this topic.

arshak23

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML Draw Map
« on: May 19, 2011, 06:28:48 pm »
Hello!

I'm trying to make a map loading function for my game but i have a problem..   :shock:


In SDL i was loading the file and checking for numbers(1 and 2) and drawing it on the buffer if one was found so i'm wondering if i can do it with SFML?

This is that i want:

So how do i draw a sprite over an other one? (I'm using SFML 2.0)



Thanks!!

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
SFML Draw Map
« Reply #1 on: May 20, 2011, 02:38:08 am »
Please try to specify your question, it sounds too general.

However when you want to display a tilemap, one approach is to create as much sf::Sprites as the resolution can display. Then you load your resources into sf::Images and set the sprite's images accordingly.

When you move the map (tile-based), you reassign the sprite's images. For smooth movements (ergo pixel-wise), take a look at sf::View.