Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
🌐 English | Русский
Thunder Engine documentation
Thunder Engine documentation

Thunder Engine

  • Getting Started
    • Quick Start
    • Thunder Hub
    • Sample Projects
    • Thunder Engine Features
  • Editor
    • Viewport
    • Properties
    • Content Browser
    • Hierarchy
    • Plugin Manager
    • Building Project
  • Rendering
    • Camera
    • Geometry
      • Mesh Resource
      • MeshRender
      • SkinnedMeshRender
    • Lighting
    • Visual Effects (VFX)
      • VFX Editor
      • Creating Custom Modules
    • Graphics Pipeline
  • Audio
    • AudioClip
    • AudioSource
  • Scripting
    • Overview
    • Creating and Using Scripts
    • Variables and Property Editor
    • Instantiating Prefabs
    • Native Introspection
  • API Reference
    • Animation Module
      • Animation
      • PropertyAnimation
      • VariantAnimation
    • Bullet Module
      • BoxCollider
      • CapsuleCollider
      • CharacterController
      • Collider
      • MeshCollider
      • PhysicMaterial
      • RigidBody
      • SphereCollider
      • VolumeCollider
    • Components Module
      • Actor
      • Animator
      • AreaLight
      • Armature
      • BaseLight
      • Camera
      • Component
      • DirectLight
      • EffectRender
      • FixedJoint
      • HingeJoint
      • Joint
      • MeshRender
      • NativeBehaviour
      • PlayerInput
      • PointLight
      • PostProcessVolume
      • Renderable
      • Scene
      • SkinnedMeshRender
      • SkinnedSpriteRender
      • Spline
      • SpotLight
      • SpringJoint
      • SpriteRender
      • TextRender
      • TileMapRender
      • Transform
      • World
    • Core Module
      • Bson
      • Event
      • Json
      • MetaEnum
      • MetaMethod
      • MetaObject
      • MetaProperty
      • MetaType
      • MethodCallEvent
      • Object
      • ObjectSystem
      • TString
      • ThreadPool
      • Url
      • Variant
    • Engine Module
      • CommandBuffer
      • Engine
      • Gizmos
      • Input
      • Log
      • Module
      • PipelineContext
      • PipelineTask
      • System
      • Timer
    • Gui Module
      • AbstractButton
      • AbstractSlider
      • Button
      • Canvas
      • CheckBox
      • FloatInput
      • Foldout
      • Frame
      • Image
      • Label
      • Layout
      • LineEdit
      • Menu
      • ProgressBar
      • RectTransform
      • ScrollBar
      • Slider
      • Splitter
      • StyleSheet
      • Switch
      • TabBar
      • TabWidget
      • ToolButton
      • UiDocument
      • UiLoader
      • Widget
    • Math Module
      • AABBox
      • Matrix3
      • Matrix4
      • OBBox
      • Plane
      • Quaternion
      • Ray
      • Vector2
      • Vector3
      • Vector4
    • Media Module
      • AudioClip
      • AudioSource
    • Navigation Module
      • NavMesh
      • NavMeshAgent
      • NavMeshLink
      • NavMeshObstacle
      • NavMeshSurface
    • Os Module
      • Backtrace
      • FileSystemWatcher
      • Process
      • ProcessEnvironment
      • Uuid
    • Resources Module
      • AnimationClip
      • AnimationStateMachine
      • AnimationTrack
      • Bone
      • ComputeBuffer
      • ComputeInstance
      • ComputeShader
      • ControlScheme
      • Font
      • Map
      • Material
      • MaterialInstance
      • Mesh
      • Pipeline
      • Pose
      • Prefab
      • RenderTarget
      • Resource
      • Sprite
      • Text
      • Texture
      • TileMap
      • TileSet
      • Translator
      • VisualEffect
    • NetworkAddress
    • WebRequest

Get Involved

  • Contribute Documentation
    • Documentation Writing Guide
    • Documentation Style Guide
    • Documentation Review Process
    • Building Thunder Engine from Source
  • Documentation Localization
Back to top
View this page

MenuΒΆ

Inherited: Frame

DescriptionΒΆ

The Menu class represents a graphical user interface (GUI) menu that contains a list of options or actions that users can select. It provides a way to organize and display commands or choices in a structured manner, typically within a dropdown or context menu format. Menus are essential in GUI design for providing users with accessible options and actions within an application.

Public MethodsΒΆ

void

aboutToHide ()

void

aboutToShow ()

void

addAction (const TString & text, Sprite * icon = nullptr)

void

addSeparator ()

void

addSubmenu (const TString & text, Menu * submenu, Sprite * icon = nullptr)

Font *

font () const

void

hide ()

Sprite *

itemIcon (int index)

TString

itemText (int index)

void

setFont (Font * font)

void

setItemIcon (int index, Sprite * icon)

void

setItemText (int index, const TString & text)

void

show (const Vector2 & position)

void

triggered (int index)

Static MethodsΒΆ

None

Methods DescriptionΒΆ

void Menu::aboutToHide ()

Signal emitted when the menu is about to be hidden.


void Menu::aboutToShow ()

Signal emitted when the menu is about to be shown.


void Menu::addAction (TString & text, Sprite * icon = nullptr)

Adds a section to the menu with the specified text and optional icon. Creates a clickable menu item that triggers an action when selected.


void Menu::addSeparator ()

Adds a separator line to the menu. Creates a visual separator to group related menu items.


void Menu::addSubmenu (TString & text, Menu * submenu, Sprite * icon = nullptr)

Adds a submenu item with specified text and optional icon. Creates a menu item that opens a submenu when hovered or clicked.


Font * Menu::font () const

Returns the font which will be used to draw a text.

See also setFont().


void Menu::hide ()

Hides the menu.


Sprite * Menu::itemIcon (int index)

Returns the icon of the item at the specified index.

See also setItemIcon().


TString Menu::itemText (int index)

Returns the text of the item at the specified index.

See also setItemText().


void Menu::setFont (Font * font)

Changes the font which will be used to draw a text.

See also font().


void Menu::setItemIcon (int index, Sprite * icon)

Updates the icon of an existing menu item at index of menu position.

See also itemIcon().


void Menu::setItemText (int index, TString & text)

Updates the text of an existing menu item at index of menu position.

See also itemText().


void Menu::show (Vector2 & position)

Displays the menu at the specified position.


void Menu::triggered (int index)

Signal emitted when a menu with index item is triggered.

Next
ProgressBar
Previous
LineEdit
Copyright © 2026, Thunder Engine
Made with Sphinx and @pradyunsg's Furo
On this page
  • Menu
    • Description
    • Public Methods
    • Static Methods
    • Methods Description