Package org.lwjgl.nuklear
Class NkUserFont
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkUserFont
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class NkUserFont extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceMember documentation
userdata– user provided font handleheight– max height of the fontwidth– font string width in pixel callbackquery– font glyph callback to query drawing infotexture– texture handle to the used font atlas or texture
Layout
struct nk_user_font {nk_handleuserdata; float height;nk_text_width_fwidth;nk_query_font_glyph_fquery;nk_handletexture; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNkUserFont.BufferAn array ofNkUserFontstructs.
-
Constructor Summary
Constructors Constructor Description NkUserFont(java.nio.ByteBuffer container)Creates aNkUserFontinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkUserFontcalloc()Returns a newNkUserFontinstance allocated withmemCalloc.static NkUserFont.Buffercalloc(int capacity)Returns a newNkUserFont.Bufferinstance allocated withmemCalloc.static NkUserFontcallocStack()Returns a newNkUserFontinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkUserFont.BuffercallocStack(int capacity)Returns a newNkUserFont.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkUserFont.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkUserFont.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkUserFontcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkUserFontcreate()Returns a newNkUserFontinstance allocated withBufferUtils.static NkUserFont.Buffercreate(int capacity)Returns a newNkUserFont.Bufferinstance allocated withBufferUtils.static NkUserFontcreate(long address)Returns a newNkUserFontinstance for the specified memory address.static NkUserFont.Buffercreate(long address, int capacity)Create aNkUserFont.Bufferinstance at the specified memory.static NkUserFontcreateSafe(long address)static NkUserFont.BuffercreateSafe(long address, int capacity)floatheight()Returns the value of theheightfield.NkUserFontheight(float value)Sets the specified value to theheightfield.static NkUserFontmalloc()Returns a newNkUserFontinstance allocated withmemAlloc.static NkUserFont.Buffermalloc(int capacity)Returns a newNkUserFont.Bufferinstance allocated withmemAlloc.static NkUserFontmallocStack()Returns a newNkUserFontinstance allocated on the thread-localMemoryStack.static NkUserFont.BuffermallocStack(int capacity)Returns a newNkUserFont.Bufferinstance allocated on the thread-localMemoryStack.static NkUserFont.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkUserFont.Bufferinstance allocated on the specifiedMemoryStack.static NkUserFontmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontinstance allocated on the specifiedMemoryStack.static floatnheight(long struct)Unsafe version ofheight().static voidnheight(long struct, float value)Unsafe version ofheight.static NkQueryFontGlyphCallbacknquery(long struct)Unsafe version ofquery().static voidnquery(long struct, NkQueryFontGlyphCallbackI value)Unsafe version ofquery.static NkHandlentexture(long struct)Unsafe version oftexture().static voidntexture(long struct, NkHandle value)Unsafe version oftexture.static NkHandlenuserdata(long struct)Unsafe version ofuserdata().static voidnuserdata(long struct, NkHandle value)Unsafe version ofuserdata.static NkTextWidthCallbacknwidth(long struct)Unsafe version ofwidth().static voidnwidth(long struct, NkTextWidthCallbackI value)Unsafe version ofwidth.NkQueryFontGlyphCallbackquery()Returns the value of thequeryfield.NkUserFontquery(NkQueryFontGlyphCallbackI value)Sets the specified value to thequeryfield.NkUserFontset(NkHandle userdata, float height, NkTextWidthCallbackI width, NkQueryFontGlyphCallbackI query, NkHandle texture)Initializes this struct with the specified values.NkUserFontset(NkUserFont src)Copies the specified struct data to this struct.intsizeof()NkHandletexture()Returns aNkHandleview of thetexturefield.NkUserFonttexture(java.util.function.Consumer<NkHandle> consumer)Passes thetexturefield to the specifiedConsumer.NkUserFonttexture(NkHandle value)Copies the specifiedNkHandleto thetexturefield.NkHandleuserdata()Returns aNkHandleview of theuserdatafield.NkUserFontuserdata(java.util.function.Consumer<NkHandle> consumer)Passes theuserdatafield to the specifiedConsumer.NkUserFontuserdata(NkHandle value)Copies the specifiedNkHandleto theuserdatafield.NkTextWidthCallbackwidth()Returns the value of thewidthfield.NkUserFontwidth(NkTextWidthCallbackI value)Sets the specified value to thewidthfield.
-
-
-
Constructor Detail
-
NkUserFont
public NkUserFont(java.nio.ByteBuffer container)
Creates aNkUserFontinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
userdata
public NkUserFont userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdatafield to the specifiedConsumer.
-
height
public float height()
Returns the value of theheightfield.
-
width
@Nullable public NkTextWidthCallback width()
Returns the value of thewidthfield.
-
query
@Nullable public NkQueryFontGlyphCallback query()
Returns the value of thequeryfield.
-
texture
public NkUserFont texture(java.util.function.Consumer<NkHandle> consumer)
Passes thetexturefield to the specifiedConsumer.
-
userdata
public NkUserFont userdata(NkHandle value)
Copies the specifiedNkHandleto theuserdatafield.
-
height
public NkUserFont height(float value)
Sets the specified value to theheightfield.
-
width
public NkUserFont width(@Nullable NkTextWidthCallbackI value)
Sets the specified value to thewidthfield.
-
query
public NkUserFont query(@Nullable NkQueryFontGlyphCallbackI value)
Sets the specified value to thequeryfield.
-
texture
public NkUserFont texture(NkHandle value)
Copies the specifiedNkHandleto thetexturefield.
-
set
public NkUserFont set(NkHandle userdata, float height, NkTextWidthCallbackI width, NkQueryFontGlyphCallbackI query, NkHandle texture)
Initializes this struct with the specified values.
-
set
public NkUserFont set(NkUserFont src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static NkUserFont malloc()
Returns a newNkUserFontinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NkUserFont calloc()
Returns a newNkUserFontinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NkUserFont create()
Returns a newNkUserFontinstance allocated withBufferUtils.
-
create
public static NkUserFont create(long address)
Returns a newNkUserFontinstance for the specified memory address.
-
createSafe
@Nullable public static NkUserFont createSafe(long address)
-
malloc
public static NkUserFont.Buffer malloc(int capacity)
Returns a newNkUserFont.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NkUserFont.Buffer calloc(int capacity)
Returns a newNkUserFont.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NkUserFont.Buffer create(int capacity)
Returns a newNkUserFont.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NkUserFont.Buffer create(long address, int capacity)
Create aNkUserFont.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static NkUserFont.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkUserFont mallocStack()
Returns a newNkUserFontinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NkUserFont callocStack()
Returns a newNkUserFontinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NkUserFont mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NkUserFont callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static NkUserFont.Buffer mallocStack(int capacity)
Returns a newNkUserFont.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NkUserFont.Buffer callocStack(int capacity)
Returns a newNkUserFont.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static NkUserFont.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static NkUserFont.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuserdata
public static NkHandle nuserdata(long struct)
Unsafe version ofuserdata().
-
nheight
public static float nheight(long struct)
Unsafe version ofheight().
-
nwidth
@Nullable public static NkTextWidthCallback nwidth(long struct)
Unsafe version ofwidth().
-
nquery
@Nullable public static NkQueryFontGlyphCallback nquery(long struct)
Unsafe version ofquery().
-
nheight
public static void nheight(long struct, float value)Unsafe version ofheight.
-
nwidth
public static void nwidth(long struct, @Nullable NkTextWidthCallbackI value)Unsafe version ofwidth.
-
nquery
public static void nquery(long struct, @Nullable NkQueryFontGlyphCallbackI value)Unsafe version ofquery.
-
-