Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: bitmap font texture is scaled to 0.5 after exporting in version 1.3.0 #113

Open
hotyes opened this issue Jan 30, 2025 · 8 comments · Fixed by #120
Open

Bug: bitmap font texture is scaled to 0.5 after exporting in version 1.3.0 #113

hotyes opened this issue Jan 30, 2025 · 8 comments · Fixed by #120

Comments

@hotyes
Copy link

hotyes commented Jan 30, 2025

After upgrade assetpack to 1.3.0 the bitmap font is broken

Image

but it is working on assetpack 1.2.3

Image

I used {fix} as the tags

@hotyes hotyes changed the title Bug: bitmap font texture scale to 0.5 after export for version 1.3.0 Bug: bitmap font texture is scaled to 0.5 after exporting in version 1.3.0 Jan 30, 2025
@Zyie
Copy link
Member

Zyie commented Jan 30, 2025

Hey @hotyes can you share with me your assetpack config?

@hotyes
Copy link
Author

hotyes commented Jan 30, 2025

@Zyie yes sure

.assetpack.js

import { pixiPipes } from '@assetpack/core/pixi'
import { webfont } from '@assetpack/core/webfont'
import { json } from '@assetpack/core/json'

export default {
    entry: './raw-assets',
    output: './public/assets/',
    cache: false,
    compression: true,
    pipes: [
        ...pixiPipes({
            cacheBust: false,
            resolutions: { high: 2, default: 1, low: 0.5 },
            texturePacker: {
                texturePacker: {
                    removeFileExtension: true,
                },
            },
            manifest: {
                trimExtensions: true,
                output: './public/assets/assets-manifest.json',
            },
        }),
    ],
}

Image

@Zyie
Copy link
Member

Zyie commented Jan 30, 2025

Thank you!

I think I know what has happened here, can you try out this config and tell me if it fixes the issue:

import { audio } from '@assetpack/core/ffmpeg';
import { compress, mipmap } from '@assetpack/core/image';
import { json } from '@assetpack/core/json';
import { pixiManifest } from '@assetpack/core/manifest';
import { spineAtlasCompress, spineAtlasManifestMod, spineAtlasMipmap } from '@assetpack/core/spine';
import { texturePacker, texturePackerCompress } from '@assetpack/core/texture-packer';
import { webfont } from '@assetpack/core/webfont';

const manifestOptions = {
    createShortcuts: true,
    trimExtensions: true,
    output: './public/assets/assets-manifest.json',
};

export default {
    entry: './raw-assets',
    output: './public/assets/',
    cache: false,
    pipes: [
        webfont(),
        audio(),
        texturePacker({
            texturePacker: {
                removeFileExtension: true,
            },
            resolutionOptions: {
                fixedResolution: 'default',
                resolutions: { high: 2, default: 1, low: 0.5 },
            },
        }),
        mipmap({
            fixedResolution: 'high',
            resolutions: { high: 2, default: 1, low: 0.5 },
        }),
        spineAtlasMipmap({
            fixedResolution: 'default',
            resolutions: { high: 2, default: 1, low: 0.5 },
        }),
        compress(),
        spineAtlasCompress(),
        texturePackerCompress(),
        json(),
        pixiManifest(manifestOptions),
        spineAtlasManifestMod(manifestOptions),
    ],
};

@hotyes
Copy link
Author

hotyes commented Jan 30, 2025

hi @Zyie unfortunately it is not working and I got this error now:

Uncaught (in promise) Error: [Loader.load] Failed to load http://localhost:5173/assets/game/numbers/numbers.xml.
Error: [Loader.load] Failed to load http://localhost:5173/assets/game/numbers/numbers.png.
InvalidStateError: The source image could not be decoded.

and my other textures also scaled

@Zyie
Copy link
Member

Zyie commented Jan 30, 2025

unfortunately it is not working and I got this error now:

hmm ok, i'll dig into this further. it definitely this PR that caused this to happen: #96

@hotyes
Copy link
Author

hotyes commented Jan 30, 2025

ok thanks

@Zyie
Copy link
Member

Zyie commented Feb 6, 2025

Hey @hotyes

After looking into this one a bit more we have now introduced the {nomip} tag in 1.4.0. If you could replace the {fix} tag with this one it should solve your problem! If not let me know and i'll have another go at this

@hotyes
Copy link
Author

hotyes commented Feb 7, 2025

hi @Zyie thanks for this..

after upgrading to 1.4.0 whether using {nomip} or {fix}, it solved solved my problem, not sure if this is expected ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants