GithubHelp home page GithubHelp logo

yoyoberenguer / magicspritesheet Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 18.05 MB

Load and add special effect to sprite sheet

License: MIT License

Python 58.83% Cython 41.17%
spritesheet sprite sprites sprite-animation animation image-processing

magicspritesheet's People

Contributors

yoyoberenguer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magicspritesheet's Issues

loading sprite with different width and height is not implemented

Loading a sprites with different width and height is not implemented

Code exposed :

  • def open_spritesheet(self) -> None
if self.gl.input_format_24bit.get() == 1:
    try:

        sprites = sprite_sheet_fs8(filename, chunk_=int(width), rows_=int(rows), columns_=int(columns))
    except Exception as error:
        messagebox.showerror(
            "Error", "Fail to open spritesheet %s\nError code : %s" % (filename, error))
        return
else:
    try:
        sprites = sprite_sheet_per_pixel(filename, chunk_=int(width), rows_=int(rows),
                                         columns_=int(columns))
    except Exception as error:
        messagebox.showerror(
            "Error", "Fail to open spritesheet %s\nError code : %s" % (filename, error))
        return

Sprite loading issue for certain type of image

SpriteSheet studio version 1.0.0-alpha
Loading a spritesheet with the correct attributes (columns, rows , width and height) is failing with error code :

  • a 2d surface view is not C contiguous

Code failing to load the spritesheet:

file Spritesheet.pyx
method cpdef sprite_sheet(str file_, int chunk_, int rows_, int columns_)

try:
    surface = pygame.image.load(file_)
    buffer_ = surface.get_view('2')
    w, h = surface.get_size()
    source_array = numpy.frombuffer(buffer_, dtype=uint8).reshape((h, w, 3))

except Exception as e:
    raise ValueError("Cannot load spritesheet %s.\n"
                     "Invalid file format or bitsize incompatible\nError %s\n"
                     "This version is compatible with 24-bit spritesheet without layer alpha" % (file_, e))

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.