Home / Topic / texture packer lua file

texture packer lua file

Home Kwiksher Forums Kwik4 texture packer lua file

Viewing 1 post (of 1 total)
  • Yamamoto
    Keymaster
    #84804

    Kwik4 supports current texture packer lua file which returns SheetInfo table. You just specify the exported lua file from texture packer.

    You can create sheet image file from build4/assets/images/*.png which are generated with publish.
    create sheet image sheet from them and save it to a folder. (I don’t recommend to save it to under build4. create your own folder under the project folder and save it them, for instance, myAssets/)

    Kwik/YOUR_PROJCT/myAssets/page1_sheet.png
    Kwik/YOUR_PROJCT/myAssets/page1_sheet.lua

    If ‘build4/assets/images/’ folder contains @2.png files, you need to pack image sheet for @2.png files — chosen automatically depending on the screen resolution. Please export it to the same folder. Only png file. lua file is not necessary.

    Kwik/YOUR_PROJCT/myAssets/page1_sheet@2.png

    Kwik Panel > Layer Replacements > Sprite sheet replacement
    set page1_sheet.png and page1_sheet.lua
    you don’t need to set for @2.png">page1_sheet@2.png. Kwik/Corona automatically handles @2.png">page1_sheet@2.png

    P.S.
    OLD texture packer lua file does not contain SheetInfo table. kwik3 uses the old style. Please create a new lua file and cut and paste the inside SheetInfo.sheet for frames, sheetContentWidth and sheetContentHeight

       -- old texture packer style
        frames = {
            {
                -- p1_club
                x=1,
                y=1,
                width=221,
                height=251,
            },
            {
                -- p1_diamond
                x=261,
                y=216,
                width=200,
                height=253,
            },
            {
                -- p1_heart
                x=224,
                y=1,
                width=254,
                height=213,
    
            },
            {
                -- p1_spade
                x=1,
                y=254,
                width=258,
                height=218,
    
            },
        },
        sheetContentWidth = 479,
        sheetContentHeight = 473
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.