Slicing Images

edited August 2017 in How To...

So im trying to make a game for testing my skills and other stuff that i know. And i want to make textures but not make them all their single image. I want them all to be on one image, that are in sections of 16. If you don't understand ill try to explain a little big better. And as always any help would be great!

Answers

    1. Why? Why do you want 16 textures combined into one image file?
    2. What is the problem, exactly? What are you not able to do? Can you show us a simple working example of what you are trying to do with separate image files, and point out the part where you want them to load from a combined file?
  • Answer ✓

    He's talking about sprite sheets or tile sheets.

    The image that's posted is pretty useless.

  • @koogs ya thats what im going for a spite sheet. A 80x48 image with 16x16 sections for a wall tile that i could use to make a room type of thing. But the thing is that im not sure how to do that. Could you explain the process to do it?

  • Answer ✓

    copy() will copy blocks out of an image

    https://processing.org/reference/copy_.html

  • Ok thanks so much!

  • edited August 2017 Answer ✓

    Ah, sprites. See also @quark 's sprite library for processing, S4P:

    http://www.lagers.org.uk/s4p/

    A sprite is a 2D image created from a bitmap file and the S4P library supports creating, moving, resizing and rotating sprites. In addition S4P supports sprite image animation and pixel level transparency (see the ghost example). A sprite's movement can be defined in terms of speed, acceleration and direction leaving S4P to take care of the movement for you. Once moving then sprites can collide - S4P has 4 collision detection modes of varying speed and accuracy.

Sign In or Register to comment.