Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • 🖥️Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • ⚙️Instances
      • 🔢Math
      • ☎️Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • 🕹️Mods
        • events_t
      • ✏️Draw
        • ⚙️Types
          • ⚙️rect
          • ⚙️vec2
          • ⚙️color
          • ⚙️accessor
        • 🖥️Adapter
        • ✏️Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • 🖼️Managed
          • 🖼️texture
            • svg_texture
            • animated_texture
          • 🖼️shader
          • ™️font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • 🖥️Gui
        • ⚙️Types
          • ⚙️bits
          • ⚙️control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • ⚙️Utils
    • ⚙️Types
      • ⚙️ptr
      • ⚙️ref_holder_t
      • ⚙️vector
      • ⚙️vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

© 2025 - FATALITY

On this page
  • __call
  • get_value
Export as PDF
  1. API
  2. Instances
  3. Gui
  4. control

slider

PreviouscheckboxNextlabel

Last updated 3 months ago

This type represents a slider control.

This type inherits type. All of its base methods and fields are also available in this type.

__call

Constructs the slider.

Arguments

Name

Type

Description

id

Control ID.

low

float

Minimum value.

high

float

Maximum value.

fmt

table[...]

Format. Defaults to {'%.0f'}.

step

float

Step value. Defaults to 1.0.

Format Table

Format table can either be a single string with the desired format, or multiple elements with different minimum actuators. You have to pass multiple values in the descendant order, starting from the highest value to the lowest value. min and add values are both optional, but it makes no sense to leave either of them out.

Formatting uses standard printf syntax.

Passing invalid format will lead to an undefined behavior.

1. Single Formatting.

Type

Description

string

Format string.

2. Multi Formatting.

Name

Type

Description

min

float?

Minimal value.

add

float?

Add step.

fmt

string

Format string.

Returns

Type

Description

slider

Slider object.

Example

local slider = gui.slider(id, 0, 100, {'%.0f%%'});

get_value

Returns slider' value.

Arguments

None.

Returns

Type

Description

Value data.

Example

local val = slider:get_value():get();

⚙️
🖥️
control
Documentation
control_id
value_param<float>