Page 1 of 1

Error loading spritesheet bounds

Posted: Wed Jul 03, 2024 9:35 pm
by Tilehax
Hello, I am making an ore protype and running into issues with loading the spritemap. (Not an animation)
The error I receive is: "The given sprite rectangle (left_top=0x1024, right_bottom=128x1152) is outside the actual sprite size (left_top=0x0, right_bottom=1024x10240. ...
This is for the stages of a new ore I am modding. This specific issue comes from the stages poperty of my resource entity prototype. My code:

Code: Select all

stages = {
        sheet =
        {
            filename = "__mod-name__/icons/pentite-ore.png",
            line_length = 8,
            height = 128,
            width = 128,
            variation_count = 64,
        }
    }
I can confirm that my spritemap is 8x8 sprites, each 128 pixels in size, and the total sprite is 1024x1024. In my testing, I also tried with height and width = 64, and I still recieve and error, but instead of right_bottom being 128x1152, I get 128x1088. I have also attempted using different scale modifiers to no change in error message.
I don't know how to fix this, and if anybody could help tell me what's wrong I would be very grateful!

Re: Error loading spritesheet bounds

Posted: Wed Jul 03, 2024 9:42 pm
by Bilka
See the description of ResourceEntityPrototype::stages:
When using AnimationVariations::sheet, frame_count is the amount of frames per row in the spritesheet. variation_count is the amount of rows in the spritesheet. Each row in the spritesheet is one stage of the animation.
So this should work:

Code: Select all

stages = {
        sheet =
        {
            filename = "__mod-name__/icons/pentite-ore.png",
            height = 128,
            width = 128,
            variation_count = 8,
            frame_count = 8
        }
    }