• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Graphics] [pokeemerald] How Do Subsprites Work?

  • 247
    Posts
    6
    Years
    • Seen May 28, 2024
    I've been trying to use the subsprites in pokeemerald, located in src/data/object_events/object_event_subsprites.h to have an object event's sprite be half cut-off vertically, meaning the left half is visible while the right half is invisible. I see that a similar process is used in regards to entering long grass, though it's a horizonal cut-off, making the bottom half invisible while keeping the top half visible. I've tried creating a new subsprite, using a similar pattern as the subsprite that is applied when walking in long grass, but changing the SPRITE_SHAPE and SPRITE_SIZE to be vertically oriented and having .x change instead of .y:
    Code:
    static const struct Subsprite sOamTable_32x32_5[] = {
        {
            .x = -16,
            .y = -16,
            .shape = SPRITE_SHAPE(16x32),
            .size = SPRITE_SIZE(16x32),
            .tileOffset = 0,
            .priority = 2
        },
        {
            .x = 0,
            .y = -16,
            .shape = SPRITE_SHAPE(16x32),
            .size = SPRITE_SIZE(16x32),
            .tileOffset = 8,
            .priority = 3
        }
    };
    This does not produce any kind of desirable result, unless you're goal was to make a corrupted-looking sprite. If anyone can point me to a subsprite tutorial, or at least explain to me how to accomplish my goal, I would be greatly appreciative.
     
    Back
    Top