Class NkStyleButton

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkStyleButton extends Struct<NkStyleButton> implements NativeResource

 struct nk_style_button {
     struct nk_style_item normal;
     struct nk_style_item hover;
     struct nk_style_item active;
     struct nk_color border_color;
     float color_factor_background;
     struct nk_color text_background;
     struct nk_color text_normal;
     struct nk_color text_hover;
     struct nk_color text_active;
     nk_flags text_alignment;
     float color_factor_text;
     float border;
     float rounding;
     struct nk_vec2 padding;
     struct nk_vec2 image_padding;
     struct nk_vec2 touch_padding;
     float disabled_factor;
     nk_handle userdata;
     nk_draw_begin draw_begin;
     nk_draw_end draw_end;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • NORMAL

      public static final int NORMAL
      The struct member offsets.
    • HOVER

      public static final int HOVER
      The struct member offsets.
    • ACTIVE

      public static final int ACTIVE
      The struct member offsets.
    • BORDER_COLOR

      public static final int BORDER_COLOR
      The struct member offsets.
    • COLOR_FACTOR_BACKGROUND

      public static final int COLOR_FACTOR_BACKGROUND
      The struct member offsets.
    • TEXT_BACKGROUND

      public static final int TEXT_BACKGROUND
      The struct member offsets.
    • TEXT_NORMAL

      public static final int TEXT_NORMAL
      The struct member offsets.
    • TEXT_HOVER

      public static final int TEXT_HOVER
      The struct member offsets.
    • TEXT_ACTIVE

      public static final int TEXT_ACTIVE
      The struct member offsets.
    • TEXT_ALIGNMENT

      public static final int TEXT_ALIGNMENT
      The struct member offsets.
    • COLOR_FACTOR_TEXT

      public static final int COLOR_FACTOR_TEXT
      The struct member offsets.
    • BORDER

      public static final int BORDER
      The struct member offsets.
    • ROUNDING

      public static final int ROUNDING
      The struct member offsets.
    • PADDING

      public static final int PADDING
      The struct member offsets.
    • IMAGE_PADDING

      public static final int IMAGE_PADDING
      The struct member offsets.
    • TOUCH_PADDING

      public static final int TOUCH_PADDING
      The struct member offsets.
    • DISABLED_FACTOR

      public static final int DISABLED_FACTOR
      The struct member offsets.
    • USERDATA

      public static final int USERDATA
      The struct member offsets.
    • DRAW_BEGIN

      public static final int DRAW_BEGIN
      The struct member offsets.
    • DRAW_END

      public static final int DRAW_END
      The struct member offsets.
  • Constructor Details

    • NkStyleButton

      public NkStyleButton(ByteBuffer container)
      Creates a NkStyleButton instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<NkStyleButton>
    • normal

      public NkStyleItem normal()
      Returns:
      a NkStyleItem view of the normal field.
    • hover

      public NkStyleItem hover()
      Returns:
      a NkStyleItem view of the hover field.
    • active

      public NkStyleItem active()
      Returns:
      a NkStyleItem view of the active field.
    • border_color

      public NkColor border_color()
      Returns:
      a NkColor view of the border_color field.
    • color_factor_background

      public float color_factor_background()
      Returns:
      the value of the color_factor_background field.
    • text_background

      public NkColor text_background()
      Returns:
      a NkColor view of the text_background field.
    • text_normal

      public NkColor text_normal()
      Returns:
      a NkColor view of the text_normal field.
    • text_hover

      public NkColor text_hover()
      Returns:
      a NkColor view of the text_hover field.
    • text_active

      public NkColor text_active()
      Returns:
      a NkColor view of the text_active field.
    • text_alignment

      public int text_alignment()
      Returns:
      the value of the text_alignment field.
    • color_factor_text

      public float color_factor_text()
      Returns:
      the value of the color_factor_text field.
    • border

      public float border()
      Returns:
      the value of the border field.
    • rounding

      public float rounding()
      Returns:
      the value of the rounding field.
    • padding

      public NkVec2 padding()
      Returns:
      a NkVec2 view of the padding field.
    • image_padding

      public NkVec2 image_padding()
      Returns:
      a NkVec2 view of the image_padding field.
    • touch_padding

      public NkVec2 touch_padding()
      Returns:
      a NkVec2 view of the touch_padding field.
    • disabled_factor

      public float disabled_factor()
      Returns:
      the value of the disabled_factor field.
    • userdata

      public NkHandle userdata()
      Returns:
      a NkHandle view of the userdata field.
    • draw_begin

      public @Nullable NkDrawBeginCallback draw_begin()
      Returns:
      the value of the draw_begin field.
    • draw_end

      public @Nullable NkDrawEndCallback draw_end()
      Returns:
      the value of the draw_end field.
    • normal

      public NkStyleButton normal(NkStyleItem value)
      Copies the specified NkStyleItem to the normal field.
    • normal

      public NkStyleButton normal(Consumer<NkStyleItem> consumer)
      Passes the normal field to the specified Consumer.
    • hover

      public NkStyleButton hover(NkStyleItem value)
      Copies the specified NkStyleItem to the hover field.
    • hover

      public NkStyleButton hover(Consumer<NkStyleItem> consumer)
      Passes the hover field to the specified Consumer.
    • active

      public NkStyleButton active(NkStyleItem value)
      Copies the specified NkStyleItem to the active field.
    • active

      public NkStyleButton active(Consumer<NkStyleItem> consumer)
      Passes the active field to the specified Consumer.
    • border_color

      public NkStyleButton border_color(NkColor value)
      Copies the specified NkColor to the border_color field.
    • border_color

      public NkStyleButton border_color(Consumer<NkColor> consumer)
      Passes the border_color field to the specified Consumer.
    • color_factor_background

      public NkStyleButton color_factor_background(float value)
      Sets the specified value to the color_factor_background field.
    • text_background

      public NkStyleButton text_background(NkColor value)
      Copies the specified NkColor to the text_background field.
    • text_background

      public NkStyleButton text_background(Consumer<NkColor> consumer)
      Passes the text_background field to the specified Consumer.
    • text_normal

      public NkStyleButton text_normal(NkColor value)
      Copies the specified NkColor to the text_normal field.
    • text_normal

      public NkStyleButton text_normal(Consumer<NkColor> consumer)
      Passes the text_normal field to the specified Consumer.
    • text_hover

      public NkStyleButton text_hover(NkColor value)
      Copies the specified NkColor to the text_hover field.
    • text_hover

      public NkStyleButton text_hover(Consumer<NkColor> consumer)
      Passes the text_hover field to the specified Consumer.
    • text_active

      public NkStyleButton text_active(NkColor value)
      Copies the specified NkColor to the text_active field.
    • text_active

      public NkStyleButton text_active(Consumer<NkColor> consumer)
      Passes the text_active field to the specified Consumer.
    • text_alignment

      public NkStyleButton text_alignment(int value)
      Sets the specified value to the text_alignment field.
    • color_factor_text

      public NkStyleButton color_factor_text(float value)
      Sets the specified value to the color_factor_text field.
    • border

      public NkStyleButton border(float value)
      Sets the specified value to the border field.
    • rounding

      public NkStyleButton rounding(float value)
      Sets the specified value to the rounding field.
    • padding

      public NkStyleButton padding(NkVec2 value)
      Copies the specified NkVec2 to the padding field.
    • padding

      public NkStyleButton padding(Consumer<NkVec2> consumer)
      Passes the padding field to the specified Consumer.
    • image_padding

      public NkStyleButton image_padding(NkVec2 value)
      Copies the specified NkVec2 to the image_padding field.
    • image_padding

      public NkStyleButton image_padding(Consumer<NkVec2> consumer)
      Passes the image_padding field to the specified Consumer.
    • touch_padding

      public NkStyleButton touch_padding(NkVec2 value)
      Copies the specified NkVec2 to the touch_padding field.
    • touch_padding

      public NkStyleButton touch_padding(Consumer<NkVec2> consumer)
      Passes the touch_padding field to the specified Consumer.
    • disabled_factor

      public NkStyleButton disabled_factor(float value)
      Sets the specified value to the disabled_factor field.
    • userdata

      public NkStyleButton userdata(NkHandle value)
      Copies the specified NkHandle to the userdata field.
    • userdata

      public NkStyleButton userdata(Consumer<NkHandle> consumer)
      Passes the userdata field to the specified Consumer.
    • draw_begin

      public NkStyleButton draw_begin(@Nullable NkDrawBeginCallbackI value)
      Sets the specified value to the draw_begin field.
    • draw_end

      public NkStyleButton draw_end(@Nullable NkDrawEndCallbackI value)
      Sets the specified value to the draw_end field.
    • set

      public NkStyleButton set(NkStyleItem normal, NkStyleItem hover, NkStyleItem active, NkColor border_color, float color_factor_background, NkColor text_background, NkColor text_normal, NkColor text_hover, NkColor text_active, int text_alignment, float color_factor_text, float border, float rounding, NkVec2 padding, NkVec2 image_padding, NkVec2 touch_padding, float disabled_factor, NkHandle userdata, NkDrawBeginCallbackI draw_begin, NkDrawEndCallbackI draw_end)
      Initializes this struct with the specified values.
    • set

      public NkStyleButton set(NkStyleButton src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static NkStyleButton malloc()
      Returns a new NkStyleButton instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static NkStyleButton calloc()
      Returns a new NkStyleButton instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static NkStyleButton create()
      Returns a new NkStyleButton instance allocated with BufferUtils.
    • create

      public static NkStyleButton create(long address)
      Returns a new NkStyleButton instance for the specified memory address.
    • createSafe

      public static @Nullable NkStyleButton createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static NkStyleButton.Buffer malloc(int capacity)
      Returns a new NkStyleButton.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static NkStyleButton.Buffer calloc(int capacity)
      Returns a new NkStyleButton.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NkStyleButton.Buffer create(int capacity)
      Returns a new NkStyleButton.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NkStyleButton.Buffer create(long address, int capacity)
      Create a NkStyleButton.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable NkStyleButton.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static NkStyleButton malloc(MemoryStack stack)
      Returns a new NkStyleButton instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static NkStyleButton calloc(MemoryStack stack)
      Returns a new NkStyleButton instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static NkStyleButton.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new NkStyleButton.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static NkStyleButton.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NkStyleButton.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nnormal

      public static NkStyleItem nnormal(long struct)
      Unsafe version of normal().
    • nhover

      public static NkStyleItem nhover(long struct)
      Unsafe version of hover().
    • nactive

      public static NkStyleItem nactive(long struct)
      Unsafe version of active().
    • nborder_color

      public static NkColor nborder_color(long struct)
      Unsafe version of border_color().
    • ncolor_factor_background

      public static float ncolor_factor_background(long struct)
      Unsafe version of color_factor_background().
    • ntext_background

      public static NkColor ntext_background(long struct)
      Unsafe version of text_background().
    • ntext_normal

      public static NkColor ntext_normal(long struct)
      Unsafe version of text_normal().
    • ntext_hover

      public static NkColor ntext_hover(long struct)
      Unsafe version of text_hover().
    • ntext_active

      public static NkColor ntext_active(long struct)
      Unsafe version of text_active().
    • ntext_alignment

      public static int ntext_alignment(long struct)
      Unsafe version of text_alignment().
    • ncolor_factor_text

      public static float ncolor_factor_text(long struct)
      Unsafe version of color_factor_text().
    • nborder

      public static float nborder(long struct)
      Unsafe version of border().
    • nrounding

      public static float nrounding(long struct)
      Unsafe version of rounding().
    • npadding

      public static NkVec2 npadding(long struct)
      Unsafe version of padding().
    • nimage_padding

      public static NkVec2 nimage_padding(long struct)
      Unsafe version of image_padding().
    • ntouch_padding

      public static NkVec2 ntouch_padding(long struct)
      Unsafe version of touch_padding().
    • ndisabled_factor

      public static float ndisabled_factor(long struct)
      Unsafe version of disabled_factor().
    • nuserdata

      public static NkHandle nuserdata(long struct)
      Unsafe version of userdata().
    • ndraw_begin

      public static @Nullable NkDrawBeginCallback ndraw_begin(long struct)
      Unsafe version of draw_begin().
    • ndraw_end

      public static @Nullable NkDrawEndCallback ndraw_end(long struct)
      Unsafe version of draw_end().
    • nnormal

      public static void nnormal(long struct, NkStyleItem value)
      Unsafe version of normal.
    • nhover

      public static void nhover(long struct, NkStyleItem value)
      Unsafe version of hover.
    • nactive

      public static void nactive(long struct, NkStyleItem value)
      Unsafe version of active.
    • nborder_color

      public static void nborder_color(long struct, NkColor value)
      Unsafe version of border_color.
    • ncolor_factor_background

      public static void ncolor_factor_background(long struct, float value)
      Unsafe version of color_factor_background.
    • ntext_background

      public static void ntext_background(long struct, NkColor value)
      Unsafe version of text_background.
    • ntext_normal

      public static void ntext_normal(long struct, NkColor value)
      Unsafe version of text_normal.
    • ntext_hover

      public static void ntext_hover(long struct, NkColor value)
      Unsafe version of text_hover.
    • ntext_active

      public static void ntext_active(long struct, NkColor value)
      Unsafe version of text_active.
    • ntext_alignment

      public static void ntext_alignment(long struct, int value)
      Unsafe version of text_alignment.
    • ncolor_factor_text

      public static void ncolor_factor_text(long struct, float value)
      Unsafe version of color_factor_text.
    • nborder

      public static void nborder(long struct, float value)
      Unsafe version of border.
    • nrounding

      public static void nrounding(long struct, float value)
      Unsafe version of rounding.
    • npadding

      public static void npadding(long struct, NkVec2 value)
      Unsafe version of padding.
    • nimage_padding

      public static void nimage_padding(long struct, NkVec2 value)
      Unsafe version of image_padding.
    • ntouch_padding

      public static void ntouch_padding(long struct, NkVec2 value)
      Unsafe version of touch_padding.
    • ndisabled_factor

      public static void ndisabled_factor(long struct, float value)
      Unsafe version of disabled_factor.
    • nuserdata

      public static void nuserdata(long struct, NkHandle value)
      Unsafe version of userdata.
    • ndraw_begin

      public static void ndraw_begin(long struct, @Nullable NkDrawBeginCallbackI value)
      Unsafe version of draw_begin.
    • ndraw_end

      public static void ndraw_end(long struct, @Nullable NkDrawEndCallbackI value)
      Unsafe version of draw_end.