Class NkStyleText

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class NkStyleText
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct nk_style_text {
         struct nk_color color;
         struct nk_vec2 padding;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • COLOR, PADDING

        The struct member offsets.
    • Constructor Detail

      • NkStyleText

        public NkStyleText​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • 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

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

        public NkStyleText padding​(java.util.function.Consumer<NkVec2> consumer)
        Passes the padding field to the specified Consumer.
      • 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

        @Nullable
        public static 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

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

        public static NkStyleText mallocStack()
        Returns a new NkStyleText instance allocated on the thread-local MemoryStack.
      • callocStack

        public static NkStyleText callocStack()
        Returns a new NkStyleText instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static NkStyleText mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new NkStyleText instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static NkStyleText callocStack​(org.lwjgl.system.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
      • mallocStack

        public static NkStyleText.Buffer mallocStack​(int capacity)
        Returns a new NkStyleText.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static NkStyleText.Buffer callocStack​(int capacity)
        Returns a new NkStyleText.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static NkStyleText.Buffer mallocStack​(int capacity,
                                                     org.lwjgl.system.MemoryStack stack)
        Returns a new NkStyleText.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static NkStyleText.Buffer callocStack​(int capacity,
                                                     org.lwjgl.system.MemoryStack stack)
        Returns a new NkStyleText.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ncolor

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

        public static NkVec2 npadding​(long struct)
        Unsafe version of padding().
      • 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.