Class NkStyleText

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkStyleText extends Struct<NkStyleText> implements NativeResource

 struct nk_style_text {
     struct nk_color color;
     struct nk_vec2 padding;
     float color_factor;
     float disabled_factor;
 }
  • Field Details

    • SIZEOF

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

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

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

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

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

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

    • NkStyleText

      public NkStyleText(ByteBuffer container)
      Creates a NkStyleText 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<NkStyleText>
    • color

      public NkColor color()
      Returns:
      a NkColor view of the color field.
    • padding

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

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

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

      public NkStyleText color(NkColor value)
      Copies the specified NkColor to the color field.
    • color

      public NkStyleText color(Consumer<NkColor> consumer)
      Passes the color field to the specified Consumer.
    • padding

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

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

      public NkStyleText color_factor(float value)
      Sets the specified value to the color_factor field.
    • disabled_factor

      public NkStyleText disabled_factor(float value)
      Sets the specified value to the disabled_factor field.
    • set

      public NkStyleText set(NkColor color, NkVec2 padding, float color_factor, float disabled_factor)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static NkStyleText.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NkStyleText.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
    • ncolor

      public static NkColor ncolor(long struct)
      Unsafe version of color().
    • npadding

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

      public static float ncolor_factor(long struct)
      Unsafe version of color_factor().
    • ndisabled_factor

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

      public static void ncolor(long struct, NkColor value)
      Unsafe version of color.
    • npadding

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

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

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