NkGenie - button

From Riftui Wiki

Jump to: navigation, search

The nkExtButton widget is a basic widget for creating a button. There are two button widgets available in nkGenie: This and it's counterpart nkExtRiftButton. The later will fit more into the Rift standard UI, but the nkExtButton will allow for some individual colorization.

UI.CreateFrame('nkExtButton', name, parent, {})

Contents

Supported parameters

Due to the nature of the checkbox widget you cannot change it as dynamically as other widgets after creation. The following parameters are supported for UI:CreateFrame(). The method :update() only supports the parameters 'width'.

Parameter Description
width The width of the button. If none is specified the button gets a default width of 5 pixel
label The label of the button
autoWidth This parameter will automatically size the button based on the text length (true or false). Will override the width parameter
func The function to be called if the button is clicked. Use format: func = function () .. end
macro A macro which can be bound to the button at creation state. This will automatically set the secure mode of the button to restricted. You have to make sure that the whole ui element tree represented by parent is secured as well.
color Specifies the color of the widget. See below.
anchors The position of the mask widget. See How to position widgets
layer The layer of the button versus parent

Supported Methods

getElement()

This method retrieves the underlying Rift UI element.

Setting the color of the button

You'll have to supply a LUA table with a lot of properties:

color = { border = 'hex code', body = 'hex code', label = 'hex code' }
option Description
border The color used for the border of the button
body The color used to fill the button
label The color used to display the label
Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox