Git Product home page Git Product logo

texmate's Introduction

TexMate

Texture Packer and ShoeBox importer and animation helper library for LÖVE.

Atlas importer is designed to use the corona exporter from texture packer. It keeps all animations related to a player sprite handy.

Texture packer automatically combines unique frames but keeps references, and preserves offset data after automatic trimming.

Texmate requires a specific class library, middleclass, to be on the packages.path. Supporting for class commons is planned for a later release.

Usage

AtlasImporter = require("AtlasImporter")
TexMate = require("TexMate")

function love.load ()

    --Load atlas you want to use

    --myAtlas = AtlasImporter.loadAtlasShoeBox("ASSETS/sprites","ASSETS/sprites.png")
    myAtlas = AtlasImporter.loadAtlasTexturePacker("ASSETS/spriteTP2","ASSETS/spriteTP.png")

    -- use the exporter marked Corona TM SDK from texture packer.
    -- If using shoebox, use the settings file provided

    animlist = {}
    animlist["Death"] = {
        framerate = 14,
        frames = {
                "Death001",
                "Death002",
                "Death003",

                }
        }

    animlist["Run"] = {
        framerate = 14,
        frames = {
                "Run001",
                "Run002",
                "Run003",

                }
        }

    --make the sprite , arguments: atlas, animlist, defaultanim, x, y, pivotx, pivoty, rotation
    --Pivot x and y is an offset from the center of the image.

    sprite = TexMate(myAtlas,animlist,"Death",nil,nil,0,-30)

    sprite:changeAnim("Run")

end

function love.update(dt)
    sprite:update(dt)
end

function love.draw()
    sprite:draw()
end

Credits

Written by Murry Lancashire

texmate's People

Contributors

loklaan avatar muzz avatar videah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

videah loklaan

texmate's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.