Skip to content

The LevelSprites

Sygmei edited this page Jul 20, 2017 · 11 revisions

The sprites in a 2D game are one of the most important element, without them you couldn't even play !

We will check here how to import sprites in your map.

Remember the project structure ? We had a LevelSprite/ folder !

That's where you need to put all your sprites you want to add in the maps of your project :)

Of course no need to stay at the root of this folder, you can organize the sprites the way you want !

For example let's imagine your project is a Terraria-like game, your folder could look like this :

📂 LevelSprites
├───📂 Tiles
│   ├───📂 Rock
│   │   └───🖼 Rock.jpg
│   ├───📂 Dirt
│   │   ├───🖼 Dirt1Tile.png
│   │   └───🖼 Dirt2Tile.png
│   └───📂 Grass
│       └───🖼 GrassTile.png
├───📂 Weapons
│   ├───📂 Swords
│   │   └───🖼 Sword1.gif
│   └───📂 Bows
│       └───🖼 Bow1.gif
└───🖼 Background.png

LevelSprites supports the following image formats :

  • bmp
  • png (Except 8-bits PNGs)
  • tga
  • jpg (No progressive JPEG support)
  • gif (No animated GIF support)
  • psd
  • hdr
  • pic

To test the LevelSprite I will provide you a beautiful sprite :

ObEngine Logo

That you can download right there : Sprite

Now create a folder named Eggplants (not specific at all), in the LevelSprites folder and put the image in it, your folder should look like that now :

📂 LevelSprites
└───📂 Eggplants
    └───🖼 logo.png

Now open the map you created previously in My first map.

The interface should look like this :

Editor

You should notice an Editor Menu button on top-right of the Window, click on it to get the following screen :

EditorMenu

Now click on the "Sprites" tab on top, if you followed everything correctly you should get that :

EditorSprites

Now go in the Eggplants folder by clicking on it.

Without any surprise we found our little eggplant friend :

EditorLogo

Once again, click on it to make it spawn on the map :

SpriteInMap

If you check carefully the last screen, you can see that the first droplist on top is set on "LevelSprites".

As you can guess, this mode is about manipulating LevelSprites. As it's the current thing we are learning you can click on the DropList and select "LevelSprites".

Now you should be able to move the Eggplant with your cursor by clicking on it, holding the left-click and moving your cursor around.

MovingSprite

You can also resize the Sprite using one of the 8 points around the Sprite :

ResizingSprite

Now you know everything about the LevelSprite, what about learning about the Colliders

Clone this wiki locally