Museum of Lost Lights · Lesson 46 of 50 · Publishing · About 40 min
A shop visitor sees your lantern as a tiny square before seeing the puzzle. Use a strong shape for the icon and show the game the buyer will actually play.

Download the projects from the course page. In Godot’s Project Manager, choose Import, select project.godot, and use Run Project (F5). Start from checkpoints/45 when the lesson builds on prior work, or copy the checkpoints/46 folder to try this lesson on its own. Read the file names in the steps before editing.

Build it step by step
Language and tools in this lesson ColorRect and PNG, Color, Vector2, arrays of caption strings, Button press, wrapping with %.
-
Open the checkpoint in Godot
Extract the course files. In Godot Project Manager, choose Import and point it to this lesson’s project.godot. Double-click main.gd in FileSystem to open the script. Press F6 to run the current scene once main.tscn is open, or F5 to run the project. Toggle both preview sizes. This checkpoint only checks whether a design idea stays readable. Capture the actual full game for listings.
const UI = preload("res://lesson_ui.gd")Why it works This small project lets you see one release skill at a time. The finished Museum of Lost Lights is a second, independent project. Keep both projects in their own folders.
-
Make three rough icon ideas
Draw three 1:1 squares. Give each one central silhouette such as your lantern, moth or mirror. Start with flat colours and leave room near the edges. Pick one by shrinking all three to about the height of a thumb.
Why it works A strong silhouette stays memorable when a phone draws the icon smaller than your original art.
-
Read the preview size controls
In main.gd, find the two calls to UI.button. bind stores a number in the callable. Follow that number into _make_preview. Set badge.custom_minimum_size to a Vector2 with both sides equal.
badge.custom_minimum_size = Vector2(side, side)Why it works The number sends the same design through different display sizes. A Vector2 holds a horizontal and a vertical measurement.
-
Export an editable master and a store-sized copy
Keep the original layers in your painting program and export PNG copies for the stores. For the Apple route, use the current icon guidance for your target Xcode version. For Google Play, follow its graphic asset requirements. Install the icon on a test device and inspect it beside other icons.
Why it works Keep the master so you can revise or crop later. The platform guide sets the accepted size, file format and any masking rules.
-
Capture the game in play
Use your game on a real device or a representative simulator. Hide development overlays if you enabled them. Capture a real opening puzzle, a more challenging puzzle, a lit gallery and your level-selection screen. Check current store upload dimensions before exporting the copies.
Why it works Screenshots help shoppers see the actual controls, puzzles and art. Device-specific captures reveal tiny buttons or important text near a cut-out.
-
Build an ordered shot list
Use the next-example button to cycle through four storyboard captions. In the real game, take the same four shots and compare them with your shot list. If adding captions in a design app, leave room for the gameplay and keep your promises specific.
shot_index = (shot_index + 1) % SHOTS.size()Why it works A shot list tells a clear story. The % operator wraps the next picture number back to zero after the last item.
-
Read the result, then apply it to your game
Keep the app icon, device screenshots and any optional feature image in a separate export folder. Record the target platform and capture dimensions in each filename so you can easily find the right file in the upload form.
Why it works The checkpoint shows what to look for. Your game’s real result comes from testing your own build, assets and settings.
Watch the values change
-
Choose large icon side is 144.
What you see. The painted square appears large. -
Choose small icon side is 64.
What you see. The same mark is easier to judge at a smaller size. -
Cycle past the last example The count wraps through modulo.
What you see. The shot list returns to the opening puzzle.
Predict before you run If there are four captions and you increase the index from 3, what does (3 + 1) % 4 return?
Reveal the answer
It returns 0 because dividing 4 by 4 leaves a remainder of zero. The first caption appears again.
Complete checkpoint
Two buttons change the illustrated sample’s size. Next shot cycles through four suggested real-game screenshots. No screenshot is generated automatically.
main.gd
extends Control
const UI = preload("res://lesson_ui.gd")
const SHOTS: Array[String] = [
"Opening puzzle and touch controls",
"Two mirrors and a split beam",
"The gallery when the exhibit is lit",
"Level selection and progression",
]
var badge: ColorRect
var shot_index := 0
var shot_label: Label
func _ready() -> void:
var column := UI.build(self, "Museum store art desk", "Try two icon sizes and organise the shots you’ll capture in the finished game.")
badge = ColorRect.new()
badge.color = Color("#1e766e")
badge.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
column.add_child(badge)
var symbol := Label.new()
symbol.text = "✦"
symbol.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
symbol.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
symbol.add_theme_font_size_override("font_size", 40)
badge.add_child(symbol)
symbol.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
UI.button(column, "Preview at 144 pixels", _make_preview.bind(144))
UI.button(column, "Preview at 64 pixels", _make_preview.bind(64))
UI.button(column, "Next shot to plan", _next_shot)
shot_label = UI.message(column, SHOTS[shot_index])
_make_preview(144)
func _make_preview(side: int) -> void:
badge.custom_minimum_size = Vector2(side, side)
func _next_shot() -> void:
shot_index = (shot_index + 1) % SHOTS.size()
shot_label.text = SHOTS[shot_index]
lesson_ui.gd
extends RefCounted
static func build(screen: Control, heading: String, opening: String) -> VBoxContainer:
var margins := MarginContainer.new()
screen.add_child(margins)
margins.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
for edge in ["left", "right", "top", "bottom"]:
margins.add_theme_constant_override("margin_" + edge, 24)
var scroll := ScrollContainer.new()
margins.add_child(scroll)
var column := VBoxContainer.new()
column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
scroll.add_child(column)
column.add_theme_constant_override("separation", 12)
var title := Label.new()
title.text = heading
title.add_theme_font_size_override("font_size", 30)
column.add_child(title)
message(column, opening)
return column
static func message(column: VBoxContainer, text: String) -> Label:
var line := Label.new()
line.text = text
line.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
column.add_child(line)
return line
static func button(column: Container, caption: String, action: Callable) -> Button:
var control := Button.new()
control.text = caption
control.custom_minimum_size.y = 48
control.pressed.connect(action)
column.add_child(control)
return control
GDScript line by line
Follow the line numbers, including the indent at the start of each line. Find the code the game will run first, then look for the function that reacts when you tap or change something.
Read main.gd line by line
-
extends ControlStarts with Godot's Control type. This script gets the abilities of that type and adds the game's own rules. -
const UI = preload("res://lesson_ui.gd")Creates a constant named UI. The expression prepares a resource at a fixed project path when the script is loaded. -
const SHOTS: Array[String] = [Creates a constant named SHOTS. The expression makes a list whose items keep their order. The type after the colon says what kind of value it can hold. -
"Opening puzzle and touch controls",Continues the same instruction on a new line. This is one of the arguments, data entries or expressions started above. -
"Two mirrors and a split beam",Continues the same instruction on a new line. This is one of the arguments, data entries or expressions started above. -
"The gallery when the exhibit is lit",Continues the same instruction on a new line. This is one of the arguments, data entries or expressions started above. -
"Level selection and progression",Continues the same instruction on a new line. This is one of the arguments, data entries or expressions started above. -
]Closes the parentheses, list or dictionary opened above. Any trailing comma separates this item from the next. -
var badge: ColorRectDeclares badge for later use. A colon followed by a type says which kind of value belongs here. -
var shot_index := 0Creates a variable named shot_index. The expression uses the whole number 0. Godot infers the type from the first value. -
var shot_label: LabelDeclares shot_label for later use. A colon followed by a type says which kind of value belongs here. -
func _ready() -> void:Godot calls this once after the scene and its children are ready. Use it to set up the room and connect controls. -
var column := UI.build(self, "Museum store art desk", "Try two icon sizes and organise the shots you’ll capture in the finished game.")Creates a variable named column. The expression calls UI.build with the values in its parentheses. Godot infers the type from the first value. -
badge = ColorRect.new()Stores the new value in badge. The expression creates a new ColorRect object. -
badge.color = Color("#1e766e")Stores the new value in badge.color. The expression builds a colour from these values. -
badge.size_flags_horizontal = Control.SIZE_SHRINK_BEGINStores the new value in badge.size_flags_horizontal. The expression reads Control.SIZE_SHRINK_BEGIN. -
column.add_child(badge)Adds the new node to the scene tree so that Godot can run and draw it. -
var symbol := Label.new()Creates a variable named symbol. The expression creates a new Label object. Godot infers the type from the first value. -
symbol.text = "✦"Updates symbol.text, which controls the words a player sees. The expression uses the text inside the quotes. -
symbol.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTERStores the new value in symbol.horizontal_alignment. The expression reads HORIZONTAL_ALIGNMENT_CENTER. -
symbol.vertical_alignment = VERTICAL_ALIGNMENT_CENTERStores the new value in symbol.vertical_alignment. The expression reads VERTICAL_ALIGNMENT_CENTER. -
symbol.add_theme_font_size_override("font_size", 40)Calls symbol.add_theme_font_size_override with the values in its parentheses. -
badge.add_child(symbol)Adds the new node to the scene tree so that Godot can run and draw it. -
symbol.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)Positions this Control relative to the bounds of its parent. -
UI.button(column, "Preview at 144 pixels", _make_preview.bind(144))Calls UI.button with the values in its parentheses. -
UI.button(column, "Preview at 64 pixels", _make_preview.bind(64))Calls UI.button with the values in its parentheses. -
UI.button(column, "Next shot to plan", _next_shot)Calls UI.button with the values in its parentheses. -
shot_label = UI.message(column, SHOTS[shot_index])Stores the new value in shot_label. The expression calls UI.message with the values in its parentheses. -
_make_preview(144)Calls _make_preview with the values in its parentheses. -
func _make_preview(side: int) -> void:Defines make preview, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
badge.custom_minimum_size = Vector2(side, side)Updates badge.custom_minimum_size, which controls the smallest space the layout should reserve for this control. The expression packs x and y into one value. -
func _next_shot() -> void:Defines next shot, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
shot_index = (shot_index + 1) % SHOTS.size()Stores the new value in shot_index. The expression calculates a new value from the expressions on either side of the operator. -
shot_label.text = SHOTS[shot_index]Updates shot_label.text, which controls the words a player sees. The expression looks up the item or key written between the square brackets.
Read lesson_ui.gd line by line
-
extends RefCountedStarts with Godot's RefCounted type. This script gets the abilities of that type and adds the game's own rules. -
static func build(screen: Control, heading: String, opening: String) -> VBoxContainer:Defines build, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var margins := MarginContainer.new()Creates a variable named margins. The expression creates a new MarginContainer object. Godot infers the type from the first value. -
screen.add_child(margins)Adds the new node to the scene tree so that Godot can run and draw it. -
margins.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)Positions this Control relative to the bounds of its parent. -
for edge in ["left", "right", "top", "bottom"]:Repeats the indented instructions for each value in ["left", "right", "top", "bottom"]. -
margins.add_theme_constant_override("margin_" + edge, 24)Calls margins.add_theme_constant_override with the values in its parentheses. -
var scroll := ScrollContainer.new()Creates a variable named scroll. The expression creates a new ScrollContainer object. Godot infers the type from the first value. -
margins.add_child(scroll)Adds the new node to the scene tree so that Godot can run and draw it. -
var column := VBoxContainer.new()Creates a variable named column. The expression creates a new VBoxContainer object. Godot infers the type from the first value. -
column.size_flags_horizontal = Control.SIZE_EXPAND_FILLStores the new value in column.size_flags_horizontal. The expression reads Control.SIZE_EXPAND_FILL. -
scroll.add_child(column)Adds the new node to the scene tree so that Godot can run and draw it. -
column.add_theme_constant_override("separation", 12)Calls column.add_theme_constant_override with the values in its parentheses. -
var title := Label.new()Creates a variable named title. The expression creates a new Label object. Godot infers the type from the first value. -
title.text = headingUpdates title.text, which controls the words a player sees. The expression reads heading. -
title.add_theme_font_size_override("font_size", 30)Calls title.add_theme_font_size_override with the values in its parentheses. -
column.add_child(title)Adds the new node to the scene tree so that Godot can run and draw it. -
message(column, opening)Calls message with the values in its parentheses. -
return columnFinishes the function and hands its result back to the caller. The expression reads column. -
static func message(column: VBoxContainer, text: String) -> Label:Defines message, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var line := Label.new()Creates a variable named line. The expression creates a new Label object. Godot infers the type from the first value. -
line.text = textUpdates line.text, which controls the words a player sees. The expression reads text. -
line.autowrap_mode = TextServer.AUTOWRAP_WORD_SMARTStores the new value in line.autowrap_mode. The expression reads TextServer.AUTOWRAP_WORD_SMART. -
column.add_child(line)Adds the new node to the scene tree so that Godot can run and draw it. -
return lineFinishes the function and hands its result back to the caller. The expression reads line. -
static func button(column: Container, caption: String, action: Callable) -> Button:Defines button, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var control := Button.new()Creates a variable named control. The expression creates a new Button object. Godot infers the type from the first value. -
control.text = captionUpdates control.text, which controls the words a player sees. The expression reads caption. -
control.custom_minimum_size.y = 48Stores the new value in control.custom_minimum_size.y. The expression uses the whole number 48. -
control.pressed.connect(action)Links a signal to the function that should run when the event happens. -
column.add_child(control)Adds the new node to the scene tree so that Godot can run and draw it. -
return controlFinishes the function and hands its result back to the caller. The expression reads control.
Find and fix a bug
If a type looks sharp at normal size and unclear at small size, remove small ornament and strengthen the silhouette. Compare screenshots against the store’s current slot requirements.
Try a change
Ages 10–12: draw a tiny icon with two colours. Ages 13–16: test the icon on light and dark backgrounds, then write four distinct screenshot captions in fewer than six words each.