Where is Image.GrabImage ?

About Monkey 2 Forums Monkey 2 Programming Help Where is Image.GrabImage ?

This topic contains 3 replies, has 2 voices, and was last updated by  gcmartijn 2 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2837

    gcmartijn
    Participant

    I’m busy with translating code but now i’m searching for this monkey1 function

    http://www.monkey-x.com/docs/html/Modules_mojo.graphics_Image.html#GrabImage

    My game uses many sprites (and animations) using atlas files.
    But I can’t find this function for MX2

    #2838

    peterigz
    Participant

    You can grab a sub-section of an image with new image(image, recti) plus there’s a few other overloaded options I think. Here’s my function to load an animation from a spritesheet, it might have what you’re looking for?

    #2839

    gcmartijn
    Participant

    Thanks for sharing, I found the image overload in the modules section now.

    +1

    #2968

    gcmartijn
    Participant

    I’m wondering if there are some Atlas restrictions like grapimage have.

    These are.
    Multiple frame images are assumed to be laid out in a horizontal strip, in which case width and height are the dimensions of each frame, and the source image must be wide enough to contain the entire strip.
    Note that if image flags includes any padding, then the specified rectangle includes padding. This means image width and/or height may be ‘2 less’ than the width and/or height you specify.

    For New Image(img,recti(x,y,x2,y2))

    Because I get some weird things using a new spritesheet Atlas creator.

    I guess that all sort of Atlas image formats are now allowed , and no 1px padding is needed anymore ?

    Usefull information for others.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.