sonolus.script.instruction¶
Instruction
¶
InstructionIcon
¶
Bases: Record
Tutorial instruction icon.
Usage
InstructionIcon(id: int)
paint(position: Vec2, size: float, rotation: float, z: float, a: float)
¶
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: str) -> Any
¶
Define an instruction with the given name.
instruction_icon(name: str) -> Any
¶
Define an instruction icon with the given name.
instruction_icons(cls: type[T]) -> T | TutorialInstructionIcons
¶
Decorator to define tutorial instruction icons.
Usage
@instruction_icons
class InstructionIcons:
hand: StandardInstructionIcon.HAND
other_icon: InstructionIcon = instruction_icon("Other Icon")
instructions(cls: type[T]) -> T | TutorialInstructions
¶
Decorator to define tutorial instructions.
Usage
@instructions
class Instructions:
tap: StandardInstruction.TAP
other_instruction: InstructionText = instruction("Other Instruction")
show_instruction(inst: Instruction)
¶
Show the given instruction text.