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

Fix ProjectRunner issue with small backdrop #585

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion spx-gui/src/models/project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ export type Selected =
}
| null

export type RunConfig = {
width?: number
height?: number
}

type RawProjectConfig = RawStageConfig & {
// TODO: support other types in zorder
zorder?: string[]
run?: RunConfig
// TODO: camera
}

Expand Down Expand Up @@ -249,7 +255,17 @@ export class Project extends Disposble {
exportGameFiles(): Files {
const files: Files = {}
const [stageConfig, stageFiles] = this.stage.export()
const config: RawProjectConfig = { ...stageConfig, zorder: this.zorder }
const config: RawProjectConfig = {
...stageConfig,
run: {
// TODO: we should not hard code the width & height here,
// instead we should use the runtime size of component `ProjectRunner`,
// after https://github.com/goplus/builder/issues/584
width: stageConfig.map?.width,
height: stageConfig.map?.height,
},
zorder: this.zorder
}
files[projectConfigFilePath] = fromConfig(projectConfigFileName, config)
Object.assign(files, stageFiles)
Object.assign(files, ...this.sprites.map((s) => s.export()))
Expand Down
Loading