GetFontTexture.
This commit is contained in:
17
API.md
17
API.md
@@ -3579,7 +3579,7 @@ Get texture mipmaps. Mipmap levels, 1 by default
|
|||||||
|
|
||||||
> format = RL.GetTextureFormat( Texture2D texture )
|
> format = RL.GetTextureFormat( Texture2D texture )
|
||||||
|
|
||||||
Get texture mipmaps. Mipmap levels, 1 by default
|
Get texture data format ( PixelFormat type )
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -3802,7 +3802,7 @@ Measure string size for Font
|
|||||||
|
|
||||||
> baseSize = RL.GetFontBaseSize( Font font )
|
> baseSize = RL.GetFontBaseSize( Font font )
|
||||||
|
|
||||||
Get font baseSize
|
Get font base size ( default chars height )
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -3811,7 +3811,7 @@ Get font baseSize
|
|||||||
|
|
||||||
> glyphCount = RL.GetFontGlyphCount( Font font )
|
> glyphCount = RL.GetFontGlyphCount( Font font )
|
||||||
|
|
||||||
Get font glyphCount
|
Get font number of glyph characters
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -3820,13 +3820,22 @@ Get font glyphCount
|
|||||||
|
|
||||||
> glyphPadding = RL.GetFontGlyphPadding( Font font )
|
> glyphPadding = RL.GetFontGlyphPadding( Font font )
|
||||||
|
|
||||||
Get font glyphPadding
|
Get font padding around the glyph characters
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
> textureTable = RL.GetFontTexture( Font font )
|
||||||
|
|
||||||
|
Get font texture atlas containing the glyphs. NOTE! Texture in table form.
|
||||||
|
|
||||||
|
- Failure return false
|
||||||
|
- Success return table
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Models - Basic
|
## Models - Basic
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -2975,7 +2975,7 @@ function RL.GetTextureSize( texture ) end
|
|||||||
---@return any mipmaps
|
---@return any mipmaps
|
||||||
function RL.GetTextureMipmaps( texture ) end
|
function RL.GetTextureMipmaps( texture ) end
|
||||||
|
|
||||||
---Get texture mipmaps. Mipmap levels, 1 by default
|
---Get texture data format ( PixelFormat type )
|
||||||
---- Failure return false
|
---- Failure return false
|
||||||
---- Success return int
|
---- Success return int
|
||||||
---@param texture any
|
---@param texture any
|
||||||
@@ -3174,27 +3174,34 @@ function RL.DrawTextPro( font, text, position, origin, rotation, fontSize, spaci
|
|||||||
---@return any size
|
---@return any size
|
||||||
function RL.MeasureText( font, text, fontSize, spacing ) end
|
function RL.MeasureText( font, text, fontSize, spacing ) end
|
||||||
|
|
||||||
---Get font baseSize
|
---Get font base size ( default chars height )
|
||||||
---- Failure return false
|
---- Failure return false
|
||||||
---- Success return int
|
---- Success return int
|
||||||
---@param font any
|
---@param font any
|
||||||
---@return any baseSize
|
---@return any baseSize
|
||||||
function RL.GetFontBaseSize( font ) end
|
function RL.GetFontBaseSize( font ) end
|
||||||
|
|
||||||
---Get font glyphCount
|
---Get font number of glyph characters
|
||||||
---- Failure return false
|
---- Failure return false
|
||||||
---- Success return int
|
---- Success return int
|
||||||
---@param font any
|
---@param font any
|
||||||
---@return any glyphCount
|
---@return any glyphCount
|
||||||
function RL.GetFontGlyphCount( font ) end
|
function RL.GetFontGlyphCount( font ) end
|
||||||
|
|
||||||
---Get font glyphPadding
|
---Get font padding around the glyph characters
|
||||||
---- Failure return false
|
---- Failure return false
|
||||||
---- Success return int
|
---- Success return int
|
||||||
---@param font any
|
---@param font any
|
||||||
---@return any glyphPadding
|
---@return any glyphPadding
|
||||||
function RL.GetFontGlyphPadding( font ) end
|
function RL.GetFontGlyphPadding( font ) end
|
||||||
|
|
||||||
|
---Get font texture atlas containing the glyphs. NOTE! Texture in table form.
|
||||||
|
---- Failure return false
|
||||||
|
---- Success return table
|
||||||
|
---@param font any
|
||||||
|
---@return any textureTable
|
||||||
|
function RL.GetFontTexture( font ) end
|
||||||
|
|
||||||
-- Models - Basic
|
-- Models - Basic
|
||||||
|
|
||||||
---Draw a line in 3D world space
|
---Draw a line in 3D world space
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ Detailed changes:
|
|||||||
- ADDED: ImageDrawCircleLines
|
- ADDED: ImageDrawCircleLines
|
||||||
- ADDED: ImageBlurGaussian
|
- ADDED: ImageBlurGaussian
|
||||||
- ADDED: Values for API.md
|
- ADDED: Values for API.md
|
||||||
|
- ADDED: GetFontTexture
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
Release: ReiLua version 0.4.0 Using Raylib 4.2
|
Release: ReiLua version 0.4.0 Using Raylib 4.2
|
||||||
|
|||||||
3
devnotes
3
devnotes
@@ -10,11 +10,10 @@ Backlog {
|
|||||||
* New type validators.
|
* New type validators.
|
||||||
* Platformer example physics process for true framerate independence.
|
* Platformer example physics process for true framerate independence.
|
||||||
* Extend color lib functionality.
|
* Extend color lib functionality.
|
||||||
* Global descriptions for API.
|
* Global variable descriptions for API.
|
||||||
|
|
||||||
* IsWaveReady and other Is* ready functions.
|
* IsWaveReady and other Is* ready functions.
|
||||||
* Text
|
* Text
|
||||||
* Ability to set font texture filtering.
|
|
||||||
* Codepoints?
|
* Codepoints?
|
||||||
* Audio
|
* Audio
|
||||||
* AudioStream.
|
* AudioStream.
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ void uluaPushMatrix( lua_State *L, Matrix matrix );
|
|||||||
void uluaPushRay( lua_State *L, Ray ray );
|
void uluaPushRay( lua_State *L, Ray ray );
|
||||||
void uluaPushRayCollision( lua_State *L, RayCollision rayCol );
|
void uluaPushRayCollision( lua_State *L, RayCollision rayCol );
|
||||||
void uluaPushBoundingBox( lua_State *L, BoundingBox box );
|
void uluaPushBoundingBox( lua_State *L, BoundingBox box );
|
||||||
|
void uluaPushTexture( lua_State *L, Texture texture );
|
||||||
|
|
||||||
int uluaGetTableLen( lua_State *L );
|
int uluaGetTableLen( lua_State *L );
|
||||||
int uluaGetTableLenIndex( lua_State *L, int index );
|
int uluaGetTableLenIndex( lua_State *L, int index );
|
||||||
|
|||||||
@@ -16,3 +16,4 @@ int ltextMeasureText( lua_State *L );
|
|||||||
int ltextGetFontBaseSize( lua_State *L );
|
int ltextGetFontBaseSize( lua_State *L );
|
||||||
int ltextGetFontGlyphCount( lua_State *L );
|
int ltextGetFontGlyphCount( lua_State *L );
|
||||||
int ltextGetFontGlyphPadding( lua_State *L );
|
int ltextGetFontGlyphPadding( lua_State *L );
|
||||||
|
int ltextGetFontTexture( lua_State *L );
|
||||||
|
|||||||
@@ -1612,6 +1612,7 @@ void luaRegister() {
|
|||||||
assingGlobalFunction( "GetFontBaseSize", ltextGetFontBaseSize );
|
assingGlobalFunction( "GetFontBaseSize", ltextGetFontBaseSize );
|
||||||
assingGlobalFunction( "GetFontGlyphCount", ltextGetFontGlyphCount );
|
assingGlobalFunction( "GetFontGlyphCount", ltextGetFontGlyphCount );
|
||||||
assingGlobalFunction( "GetFontGlyphPadding", ltextGetFontGlyphPadding );
|
assingGlobalFunction( "GetFontGlyphPadding", ltextGetFontGlyphPadding );
|
||||||
|
assingGlobalFunction( "GetFontTexture", ltextGetFontTexture );
|
||||||
|
|
||||||
/* Audio. */
|
/* Audio. */
|
||||||
/* Audio device management. */
|
/* Audio device management. */
|
||||||
@@ -2959,6 +2960,20 @@ void uluaPushBoundingBox( lua_State *L, BoundingBox box ) {
|
|||||||
lua_rawseti( L, -2, 2 );
|
lua_rawseti( L, -2, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uluaPushTexture( lua_State *L, Texture texture ) {
|
||||||
|
lua_createtable( L, 5, 0 );
|
||||||
|
lua_pushinteger( L, texture.id );
|
||||||
|
lua_setfield( L, -2, "id" );
|
||||||
|
lua_pushinteger( L, texture.width );
|
||||||
|
lua_setfield( L, -2, "width" );
|
||||||
|
lua_pushinteger( L, texture.height );
|
||||||
|
lua_setfield( L, -2, "height" );
|
||||||
|
lua_pushinteger( L, texture.mipmaps );
|
||||||
|
lua_setfield( L, -2, "mipmaps" );
|
||||||
|
lua_pushinteger( L, texture.format );
|
||||||
|
lua_setfield( L, -2, "format" );
|
||||||
|
}
|
||||||
|
|
||||||
int uluaGetTableLen( lua_State *L ) {
|
int uluaGetTableLen( lua_State *L ) {
|
||||||
return uluaGetTableLenIndex( L, lua_gettop( L ) );
|
return uluaGetTableLenIndex( L, lua_gettop( L ) );
|
||||||
}
|
}
|
||||||
|
|||||||
31
src/text.c
31
src/text.c
@@ -286,7 +286,7 @@ int ltextMeasureText( lua_State *L ) {
|
|||||||
/*
|
/*
|
||||||
> baseSize = RL.GetFontBaseSize( Font font )
|
> baseSize = RL.GetFontBaseSize( Font font )
|
||||||
|
|
||||||
Get font baseSize
|
Get font base size ( default chars height )
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -311,7 +311,7 @@ int ltextGetFontBaseSize( lua_State *L ) {
|
|||||||
/*
|
/*
|
||||||
> glyphCount = RL.GetFontGlyphCount( Font font )
|
> glyphCount = RL.GetFontGlyphCount( Font font )
|
||||||
|
|
||||||
Get font glyphCount
|
Get font number of glyph characters
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -336,7 +336,7 @@ int ltextGetFontGlyphCount( lua_State *L ) {
|
|||||||
/*
|
/*
|
||||||
> glyphPadding = RL.GetFontGlyphPadding( Font font )
|
> glyphPadding = RL.GetFontGlyphPadding( Font font )
|
||||||
|
|
||||||
Get font glyphPadding
|
Get font padding around the glyph characters
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
@@ -357,3 +357,28 @@ int ltextGetFontGlyphPadding( lua_State *L ) {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> textureTable = RL.GetFontTexture( Font font )
|
||||||
|
|
||||||
|
Get font texture atlas containing the glyphs. NOTE! Texture in table form.
|
||||||
|
|
||||||
|
- Failure return false
|
||||||
|
- Success return table
|
||||||
|
*/
|
||||||
|
int ltextGetFontTexture( lua_State *L ) {
|
||||||
|
if ( !lua_isnumber( L, 1 ) ) {
|
||||||
|
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.GetFontTexture( Font font )" );
|
||||||
|
lua_pushboolean( L, false );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
size_t fontId = lua_tointeger( L, 1 );
|
||||||
|
|
||||||
|
if ( !validFont( fontId ) ) {
|
||||||
|
lua_pushboolean( L, false );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
uluaPushTexture( L, state->fonts[ fontId ]->texture );
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2209,7 +2209,7 @@ int ltexturesGetTextureMipmaps( lua_State *L ) {
|
|||||||
/*
|
/*
|
||||||
> format = RL.GetTextureFormat( Texture2D texture )
|
> format = RL.GetTextureFormat( Texture2D texture )
|
||||||
|
|
||||||
Get texture mipmaps. Mipmap levels, 1 by default
|
Get texture data format ( PixelFormat type )
|
||||||
|
|
||||||
- Failure return false
|
- Failure return false
|
||||||
- Success return int
|
- Success return int
|
||||||
|
|||||||
Reference in New Issue
Block a user