Skip to content

sonolus.script.instruction

Instruction

Bases: Record

Tutorial instruction text.

Usage
Instruction(id: int)

show()

Show this instruction text.

InstructionIcon

Bases: Record

Tutorial instruction icon.

Usage
InstructionIcon(id: int)

paint(position, size, rotation, z, a)

Paint this instruction icon.

Parameters:

Name Type Description Default
position Vec2

The position of the icon.

required
size float

The size of the icon.

required
rotation float

The rotation of the icon.

required
z float

The z-index of the icon.

required
a float

The alpha of the icon.

required

StandardInstruction

Standard instructions.

StandardInstructionIcon

Standard instruction icons.

clear_instruction()

Clear the current instruction text.

instruction(name)

Define an instruction with the given name.

instruction_icon(name)

Define an instruction icon with the given name.

instruction_icons(cls)

Decorator to define tutorial instruction icons.

Usage
@instruction_icons
class InstructionIcons:
    hand: StandardInstructionIcon.HAND
    other_icon: InstructionIcon = instruction_icon("Other Icon")

instructions(cls)

Decorator to define tutorial instructions.

Usage
@instructions
class Instructions:
    tap: StandardInstruction.TAP
    other_instruction: InstructionText = instruction("Other Instruction")

show_instruction(inst)

Show the given instruction text.