BeardLib
  • Home
  • Things to Know
    • Adding Files
    • ScriptData
  • Modules
    • Achievements
    • Add Files
    • Adding your own modules
    • AssetUpdates (Mod Updates)
    • Classes
    • Contact (contractors)
    • Crime Spree Mission
    • DLC
    • Dependencies
    • Elements
    • Global Value (Tagging weapons/etc)
    • Heist Music
      • Stealth Music
    • Hooks
    • Interactions
    • Keybind
    • Level
    • Localization
    • Mask Material
    • Mask Pattern
    • Mask
    • Melee
    • Menu Music
    • Menu
    • ModuleBase
    • Narrative
    • Options
    • Package
    • Script Mods (Replace script data)
    • Sounds
    • Tweak Modify
    • Weapon Mod
    • Weapon Skin
    • Weapon
    • XML
  • API
    • BeardLib Class
    • Constants
    • File Manager
    • Frameworks
    • Hooks
    • ModCore
    • Package Manager
    • Special Hook IDs
  • Utilities
    • FileIO
    • Input
    • Main
    • Math
    • Menu Helper Plus
    • Path
    • String
    • Sync
    • Table
    • Tweak Data Helper
    • XML
    • YAML
  • MenuUI
    • ComboBox
    • ImageButton
    • Item
    • Items
    • Keybind
    • Menus
    • Slider
    • TextBox
    • Toggle
Powered by GitBook
On this page
  • ImageButton/Image
  • Creation
  • Parameters
  • Functions

Was this helpful?

Edit on GitHub
  1. MenuUI

ImageButton

PreviousComboBoxNextItem

Last updated 3 years ago

Was this helpful?

Updated for version 3.36.

It's recommended to first read about the base item before reading about other items

ImageButton/Image

Creation

    MyRandomMenu:ImageButton({
        name = "MyImageButton",
        texture = "path/to/my/texture",
        on_callback = function(item)
            log("I was pressed!")
        end
    })

Or if you need a divider type image:

    MyRandomMenu:Image({
        name = "MyImageButton",
        texture = "path/to/my/texture"
    })

Parameters

Parameter
Type
Description

texture

String/Idstring

Texture of the image

texture_rect

Table

Texture rectangle of the image, if used. Pivot points have to be left and top of what you need

icon_w

Number

Specific width for the image(unlike 'w' which gets subtracted with the x image offset)

icon_h

Number

Specific height for the image(unlike 'h' which gets subtracted with the y image offset)

img_offset

Table/Number

Offset for the image, useful if you want to have the image smaller while button itself bigger, defaults to {0,0}

img_offset_x

Number

Specific x offset for the image

img_offset_y

Number

Specific y offset for the image

highlight_image

Boolean

Should the image change color when highlighting(uses forground color)

img_color

Color

Color of the image, defaults to foreground color

Functions

Function
Description

SetImage(String/Idstring texture, Table texture_rect)

Sets a texture and texture rectangle for the item

https://luffyyy.gitbook.io/beardlib/menuui/menuui-item