LoadAnimImage missing?

About Monkey 2 Forums Monkey 2 Programming Help LoadAnimImage missing?

Tagged: 

This topic contains 11 replies, has 5 voices, and was last updated by  Amon 2 years, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #7056

    EdzUp
    Participant

    Coming from mojo1 I cannot seem to find the LoadAnimImage command to load in sprite sheets.

    Is this a oversight or is there a new way of doing it in MonkeyX2?

    #7060

    Jesse
    Participant

    It’s not programed in to mojo. you will have to implement it yourself.

    #7061

    EdzUp
    Participant

    Hmm is there any way to scale images or grab sections of them as I can’t see that either, or do I have to write the OpenGL code for that?

    #7062

    Jesse
    Participant

    to scale:

    [/crayon]

    or

    [/crayon]

    to grab a section of an image:

    [/crayon]
    #7063

    EdzUp
    Participant

    Ah brilliant thanks for that I will use that in my conversions 🙂

    #7069

    nerobot
    Participant

    Also u can write “sprite” class that contains reference to the source image and drawing rect. With that + some addon code you can change source image on the fly and so that change all sprites.

    #7071

    EdzUp
    Participant

    @nerobot that sounds interesting 🙂 Will look into it more and see what I can do with MonkeyX2 🙂

    #7072

    Ethernaut
    Participant

    Here ya go:

     

    The “padding” and “border” arguments are designed to work with the way Aseprite exports sprite sheets. I haven’t tested this out of my framework, but it looks like it should work. Let me know.

    I think I based this on some code someone posted on the Monkey-X forum. It’s been too long, can’t remember now…

    #7073

    EdzUp
    Participant

    @ethernaut thank you very much will test it once I get the latest build and recompile 🙂

    #7077

    Ethernaut
    Participant

    Tested, works here. Here’s a sample usage with a 5 frame 32×32 sprite (160×32 sprite sheet, no border or padding):
    (requires previously posted LoadSpriteSheet function)

    [/crayon]
    #7080

    EdzUp
    Participant

    Amazing stuff haven’t even downloaded the latest build yet lol 🙂

    #7212

    Amon
    Participant

    @ethernaut

    That’s what I needed, thank you.

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

You must be logged in to reply to this topic.