All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almasb.fxgl.entity.level.tiled.Tileset.kt Maven / Gradle / Ivy

There is a newer version: 21.1
Show newest version
/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB ([email protected]).
 * See LICENSE for details.
 */

package com.almasb.fxgl.entity.level.tiled

/**
 * Specification: https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tmx-tileset-tile
 *
 * @author Almas Baimagambetov ([email protected])
 */
data class Tileset(
        var firstgid: Int = 0,
        var image: String = "",
        var name: String = "",
        var tilewidth: Int = 0,
        var tileheight: Int = 0,
        var imagewidth: Int = 0,
        var imageheight: Int = 0,
        var margin: Int = 0,
        var spacing: Int = 0,
        var columns: Int = 0,
        var tilecount: Int = 0,
        var transparentcolor: String = "",
        var tiles: MutableList = arrayListOf()
) {

    /**
     * @return true if tileset is a sprite sheet, false if tileset is a collection of images
     */
    val isSpriteSheet: Boolean
        get() = tiles.isEmpty()
}

data class Tile(
        var id: Int = 0,
        var image: String = "",
        var imagewidth: Int = 0,
        var imageheight: Int = 0,
        var transparentcolor: String = ""
)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy