Atlas and Sprite concept

About Monkey 2 Forums Monkey 2 Development Atlas and Sprite concept

This topic contains 2 replies, has 2 voices, and was last updated by  AdamStrange 2 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2331

    AdamStrange
    Participant

    Right. Using my Blitzmax core system I developed for this here is a concept for how it could work here:

    Atlas extends image and has xsize and ysize. this basically gives an image basic minimum segments to work with. Assuming 8×8 was the minimum you could have sprites of any size conforming to 8, say 16×8 alongside 8×16, etc

    Sprite takes an Atlas, start x,y segment, and size x,y segment.

    E.G.

    Atlas1 =  “blah.png”, 8,8

    Sprite1 =  Atlas1, 0,0, 2,2

    would be using Atlas1, starting at 0,0 with a with of 16 (2×8) and height of 16 (2×8)

    Sprite2 =  Atlas1, 2,0,1,1

    would be using Atlas1, starting at 16 (2×8),0 with a with of 8 (1×8) and height of 8 (1×8)

    in use instead of drawimage, it would be drawsprite

    The coding is very simple as I have it all here in OpenGL for Max and it just needs to be converted to monkey2 – which is openGL too!

    It would also mean I can integrate both directly into ted21 editor

    Thoughts?

    #2344

    Gerry Quinn
    Participant

    I’ve done something like this in the past with spritesheet images – but I just used a point to define the sprite, knowing what the basic size of the image and its sprites is.

    I think a sprite atlas as such should probably be a real atlas, with arbitrary packed images.

    This design might suit some users, especially for a tile-based game – but it is a very specific approach, and might be best done ad hoc for such a game.

    #2359

    AdamStrange
    Participant

    Yep agreed, That’s exactly what I was proposing. Each sprite in the atlas can be a unique size

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

You must be logged in to reply to this topic.