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.NativeResource
Member 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_handle
userdata; float height;nk_text_width_f
width;nk_query_font_glyph_f
query;nk_handle
texture; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkUserFont.Buffer
An array ofNkUserFont
structs.
-
Constructor Summary
Constructors Constructor Description NkUserFont(java.nio.ByteBuffer container)
Creates aNkUserFont
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkUserFont
calloc()
Returns a newNkUserFont
instance allocated withmemCalloc
.static NkUserFont.Buffer
calloc(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withmemCalloc
.static NkUserFont
callocStack()
Returns a newNkUserFont
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkUserFont.Buffer
callocStack(int capacity)
Returns a newNkUserFont.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkUserFont.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkUserFont
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkUserFont
create()
Returns a newNkUserFont
instance allocated withBufferUtils
.static NkUserFont.Buffer
create(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withBufferUtils
.static NkUserFont
create(long address)
Returns a newNkUserFont
instance for the specified memory address.static NkUserFont.Buffer
create(long address, int capacity)
Create aNkUserFont.Buffer
instance at the specified memory.static NkUserFont
createSafe(long address)
static NkUserFont.Buffer
createSafe(long address, int capacity)
float
height()
Returns the value of theheight
field.NkUserFont
height(float value)
Sets the specified value to theheight
field.static NkUserFont
malloc()
Returns a newNkUserFont
instance allocated withmemAlloc
.static NkUserFont.Buffer
malloc(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withmemAlloc
.static NkUserFont
mallocStack()
Returns a newNkUserFont
instance allocated on the thread-localMemoryStack
.static NkUserFont.Buffer
mallocStack(int capacity)
Returns a newNkUserFont.Buffer
instance allocated on the thread-localMemoryStack
.static NkUserFont.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont.Buffer
instance allocated on the specifiedMemoryStack
.static NkUserFont
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont
instance allocated on the specifiedMemoryStack
.static float
nheight(long struct)
Unsafe version ofheight()
.static void
nheight(long struct, float value)
Unsafe version ofheight
.static NkQueryFontGlyphCallback
nquery(long struct)
Unsafe version ofquery()
.static void
nquery(long struct, NkQueryFontGlyphCallbackI value)
Unsafe version ofquery
.static NkHandle
ntexture(long struct)
Unsafe version oftexture()
.static void
ntexture(long struct, NkHandle value)
Unsafe version oftexture
.static NkHandle
nuserdata(long struct)
Unsafe version ofuserdata()
.static void
nuserdata(long struct, NkHandle value)
Unsafe version ofuserdata
.static NkTextWidthCallback
nwidth(long struct)
Unsafe version ofwidth()
.static void
nwidth(long struct, NkTextWidthCallbackI value)
Unsafe version ofwidth
.NkQueryFontGlyphCallback
query()
Returns the value of thequery
field.NkUserFont
query(NkQueryFontGlyphCallbackI value)
Sets the specified value to thequery
field.NkUserFont
set(NkHandle userdata, float height, NkTextWidthCallbackI width, NkQueryFontGlyphCallbackI query, NkHandle texture)
Initializes this struct with the specified values.NkUserFont
set(NkUserFont src)
Copies the specified struct data to this struct.int
sizeof()
NkHandle
texture()
Returns aNkHandle
view of thetexture
field.NkUserFont
texture(java.util.function.Consumer<NkHandle> consumer)
Passes thetexture
field to the specifiedConsumer
.NkUserFont
texture(NkHandle value)
Copies the specifiedNkHandle
to thetexture
field.NkHandle
userdata()
Returns aNkHandle
view of theuserdata
field.NkUserFont
userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdata
field to the specifiedConsumer
.NkUserFont
userdata(NkHandle value)
Copies the specifiedNkHandle
to theuserdata
field.NkTextWidthCallback
width()
Returns the value of thewidth
field.NkUserFont
width(NkTextWidthCallbackI value)
Sets the specified value to thewidth
field.
-
-
-
Constructor Detail
-
NkUserFont
public NkUserFont(java.nio.ByteBuffer container)
Creates aNkUserFont
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
height
public float height()
Returns the value of theheight
field.
-
width
@Nullable public NkTextWidthCallback width()
Returns the value of thewidth
field.
-
query
@Nullable public NkQueryFontGlyphCallback query()
Returns the value of thequery
field.
-
userdata
public NkUserFont userdata(NkHandle value)
Copies the specifiedNkHandle
to theuserdata
field.
-
userdata
public NkUserFont userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdata
field to the specifiedConsumer
.
-
height
public NkUserFont height(float value)
Sets the specified value to theheight
field.
-
width
public NkUserFont width(@Nullable NkTextWidthCallbackI value)
Sets the specified value to thewidth
field.
-
query
public NkUserFont query(@Nullable NkQueryFontGlyphCallbackI value)
Sets the specified value to thequery
field.
-
texture
public NkUserFont texture(NkHandle value)
Copies the specifiedNkHandle
to thetexture
field.
-
texture
public NkUserFont texture(java.util.function.Consumer<NkHandle> consumer)
Passes thetexture
field to the specifiedConsumer
.
-
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 newNkUserFont
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkUserFont calloc()
Returns a newNkUserFont
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkUserFont create()
Returns a newNkUserFont
instance allocated withBufferUtils
.
-
create
public static NkUserFont create(long address)
Returns a newNkUserFont
instance for the specified memory address.
-
createSafe
@Nullable public static NkUserFont createSafe(long address)
-
malloc
public static NkUserFont.Buffer malloc(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkUserFont.Buffer calloc(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkUserFont.Buffer create(int capacity)
Returns a newNkUserFont.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkUserFont.Buffer create(long address, int capacity)
Create aNkUserFont.Buffer
instance 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 newNkUserFont
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkUserFont callocStack()
Returns a newNkUserFont
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkUserFont mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkUserFont callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFont
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkUserFont.Buffer callocStack(int capacity)
Returns a newNkUserFont.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-