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

Author Topic: Is it possible to merge sprites/textures for a tiling engine?  (Read 1976 times)

0 Members and 1 Guest are viewing this topic.

Merle

  • Newbie
  • *
  • Posts: 17
    • View Profile
I always thought people just drew every single tile and wrote one long if-else statement to check which sprite to load, but now I realized there are way too many possible block formations to do that. How do people normally approach auto-tiling? Is it possible to have one sprite of the border of a tile, and then instead of loading a million different tiles, just merging the border on top of the original tile texture?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Is it possible to merge sprites/textures for a tiling engine?
« Reply #1 on: July 16, 2017, 12:49:18 pm »
Grid-like tiling?

You can use a single vertex array (set up to draw quads) to draw the entire visible "tilemap". There is even a tile map example within that tutorial! ;)

You can also consider using Selba Ward's Tile Map, which does all this for you 8)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything