Skip to content

Sprites

The sprites are located in data/sprites/*.sprite

They are json files which looks like this:

{

"item_food_potato" : {
        "texture" : "food",
        "topx" : 0,
        "topy" : 0,
        "height" : 32,
        "width" : 32,
        "originx" : 16,
        "originy" : 16
}

}

In this case:

name meaning type
item_food_potato This is the name of the sprite Object representing the sprite
texture The texture referring. "food" means "data/textures/food.png" string
topx The topx coordinate of the top-left corner of the sprite in the texture int
topy The topy coordinate of the top-left corner of the sprite in the texture int
height Height of the sprite int
width Width of a frame in the sprite int
originx Where the engine starts drawing. Defaults to 0 float
originy Where the engine starts drawing. Defaults to 0 float