Added various missing functions.

This commit is contained in:
jussi
2024-02-25 14:06:59 +02:00
parent 631cea6aa7
commit 47ed28b006
21 changed files with 697 additions and 178 deletions

View File

@@ -188,6 +188,21 @@ int laudioIsSoundReady( lua_State* L ) {
return 1;
}
/*
> RL.UpdateSound( Sound sound, Buffer data, int sampleCount )
Update sound buffer with new data
*/
int laudioUpdateSound( lua_State* L ) {
Sound* sound = uluaGetSound( L, 1 );
Buffer* buffer = uluaGetBuffer( L, 2 );
int sampleCount = luaL_checkinteger( L, 3 );
UpdateSound( *sound, buffer->data, sampleCount );
return 0;
}
/*
> RL.UnloadWave( Wave wave )
@@ -386,6 +401,29 @@ int laudioWaveFormat( lua_State* L ) {
return 0;
}
/*
> samples = RL.LoadWaveSamples( Wave wave )
Load samples data from wave as a 32bit float data array
- Success return float{}
*/
int laudioLoadWaveSamples( lua_State* L ) {
Wave* wave = uluaGetWave( L, 1 );
float* samples = LoadWaveSamples( *wave );
lua_createtable( L, wave->frameCount * wave->channels, 0 );
for ( int i = 0; i < wave->frameCount * wave->channels; ++i ) {
lua_pushnumber( L, samples[i] );
lua_rawseti( L, -2, i+1 );
}
UnloadWaveSamples( samples );
return 1;
}
/*
> wave = RL.WaveCopy( Wave wave )

View File

@@ -1220,19 +1220,6 @@ int lcoreSetTargetFPS( lua_State* L ) {
return 0;
}
/*
> FPS = RL.GetFPS()
Get current FPS
- Success return int
*/
int lcoreGetFPS( lua_State* L ) {
lua_pushinteger( L, GetFPS() );
return 1;
}
/*
> delta = RL.GetFrameTime()
@@ -1259,6 +1246,58 @@ int lcoreGetTime( lua_State* L ) {
return 1;
}
/*
> FPS = RL.GetFPS()
Get current FPS
- Success return int
*/
int lcoreGetFPS( lua_State* L ) {
lua_pushinteger( L, GetFPS() );
return 1;
}
/*
## Core - Custom frame control functions
*/
/*
> RL.SwapScreenBuffer()
Swap back buffer with front buffer (screen drawing)
*/
int lcoreSwapScreenBuffer( lua_State* L ) {
SwapScreenBuffer();
return 0;
}
/*
> RL.PollInputEvents()
Register all input events
*/
int lcorePollInputEvents( lua_State* L ) {
PollInputEvents();
return 0;
}
/*
> RL.WaitTime( number seconds )
Wait for some time (halt program execution)
*/
int lcoreWaitTime( lua_State* L ) {
double seconds = luaL_checknumber( L, 1 );
WaitTime( seconds );
return 0;
}
/*
## Core - Random values generation functions
*/
@@ -1907,6 +1946,21 @@ int lcoreIsKeyPressed( lua_State* L ) {
return 1;
}
/*
> pressed = RL.IsKeyPressedRepeat( int key )
Check if a key has been pressed again (Only PLATFORM_DESKTOP)
- Success return bool
*/
int lcoreIsKeyPressedRepeat( lua_State* L ) {
int key = luaL_checkinteger( L, 1 );
lua_pushboolean( L, IsKeyPressedRepeat( key ) );
return 1;
}
/*
> pressed = RL.IsKeyDown( int key )
@@ -2073,6 +2127,35 @@ int lcoreIsGamepadButtonReleased( lua_State* L ) {
return 1;
}
/*
> notPressed = RL.IsGamepadButtonUp( int gamepad, int button )
Check if a gamepad button is NOT being pressed
- Success return bool
*/
int lcoreIsGamepadButtonUp( lua_State* L ) {
int gamepad = luaL_checkinteger( L, 1 );
int button = luaL_checkinteger( L, 2 );
lua_pushboolean( L, IsGamepadButtonUp( gamepad, button ) );
return 1;
}
/*
> button = RL.GetGamepadButtonPressed()
Get the last gamepad button pressed
- Success return int
*/
int lcoreGetGamepadButtonPressed( lua_State* L ) {
lua_pushinteger( L, GetGamepadButtonPressed() );
return 1;
}
/*
> count = RL.GetGamepadAxisCount( int gamepad )
@@ -2251,7 +2334,7 @@ int lcoreSetMouseScale( lua_State* L ) {
/*
> movement = RL.GetMouseWheelMove()
Returns mouse wheel movement Y
Get mouse wheel movement for X or Y, whichever is larger
- Success return float
*/
@@ -2261,6 +2344,19 @@ int lcoreGetMouseWheelMove( lua_State* L ) {
return 1;
}
/*
> movement = RL.GetMouseWheelMoveV()
Get mouse wheel movement for both X and Y
- Success return Vector2
*/
int lcoreGetMouseWheelMoveV( lua_State* L ) {
uluaPushVector2( L, GetMouseWheelMoveV() );
return 1;
}
/*
> RL.SetMouseCursor( int cursor )

View File

@@ -1285,9 +1285,13 @@ void luaRegister() {
assingGlobalFunction( "GetScreenToWorld2D", lcoreGetScreenToWorld2D );
/* Timing-related functions. */
assingGlobalFunction( "SetTargetFPS", lcoreSetTargetFPS );
assingGlobalFunction( "GetFPS", lcoreGetFPS );
assingGlobalFunction( "GetFrameTime", lcoreGetFrameTime );
assingGlobalFunction( "GetTime", lcoreGetTime );
assingGlobalFunction( "GetFPS", lcoreGetFPS );
/* Custom frame control functions. */
assingGlobalFunction( "SwapScreenBuffer", lcoreSwapScreenBuffer );
assingGlobalFunction( "PollInputEvents", lcorePollInputEvents );
assingGlobalFunction( "WaitTime", lcoreWaitTime );
/* Random values generation functions. */
assingGlobalFunction( "SetRandomSeed", lcoreSetRandomSeed );
assingGlobalFunction( "GetRandomValue", lcoreGetRandomValue );
@@ -1335,6 +1339,7 @@ void luaRegister() {
assingGlobalFunction( "DecodeDataBase64", lcoreDecodeDataBase64 );
/* Input-related functions: keyboard. */
assingGlobalFunction( "IsKeyPressed", lcoreIsKeyPressed );
assingGlobalFunction( "IsKeyPressedRepeat", lcoreIsKeyPressedRepeat );
assingGlobalFunction( "IsKeyDown", lcoreIsKeyDown );
assingGlobalFunction( "IsKeyReleased", lcoreIsKeyReleased );
assingGlobalFunction( "IsKeyUp", lcoreIsKeyUp );
@@ -1347,6 +1352,8 @@ void luaRegister() {
assingGlobalFunction( "IsGamepadButtonPressed", lcoreIsGamepadButtonPressed );
assingGlobalFunction( "IsGamepadButtonDown", lcoreIsGamepadButtonDown );
assingGlobalFunction( "IsGamepadButtonReleased", lcoreIsGamepadButtonReleased );
assingGlobalFunction( "IsGamepadButtonUp", lcoreIsGamepadButtonUp );
assingGlobalFunction( "GetGamepadButtonPressed", lcoreGetGamepadButtonPressed );
assingGlobalFunction( "GetGamepadAxisCount", lcoreGetGamepadAxisCount );
assingGlobalFunction( "GetGamepadAxisMovement", lcoreGetGamepadAxisMovement );
assingGlobalFunction( "SetGamepadMappings", lcoreSetGamepadMappings );
@@ -1361,6 +1368,7 @@ void luaRegister() {
assingGlobalFunction( "SetMouseOffset", lcoreSetMouseOffset );
assingGlobalFunction( "SetMouseScale", lcoreSetMouseScale );
assingGlobalFunction( "GetMouseWheelMove", lcoreGetMouseWheelMove );
assingGlobalFunction( "GetMouseWheelMoveV", lcoreGetMouseWheelMoveV );
assingGlobalFunction( "SetMouseCursor", lcoreSetMouseCursor );
/* Input-related functions: touch */
assingGlobalFunction( "GetTouchPosition", lcoreGetTouchPosition );
@@ -1513,6 +1521,7 @@ void luaRegister() {
assingGlobalFunction( "ImageCopy", ltexturesImageCopy );
assingGlobalFunction( "ImageFromImage", ltexturesImageFromImage );
assingGlobalFunction( "ImageText", ltexturesImageText );
assingGlobalFunction( "ImageTextEx", ltexturesImageTextEx );
assingGlobalFunction( "ImageFormat", ltexturesImageFormat );
assingGlobalFunction( "ImageToPOT", ltexturesImageToPOT );
assingGlobalFunction( "ImageCrop", ltexturesImageCrop );
@@ -1555,6 +1564,7 @@ void luaRegister() {
assingGlobalFunction( "ImageDrawRectangle", ltexturesImageDrawRectangle );
assingGlobalFunction( "ImageDrawRectangleLines", ltexturesImageDrawRectangleLines );
assingGlobalFunction( "ImageDraw", ltexturesImageDraw );
assingGlobalFunction( "ImageDrawText", ltexturesImageDrawText );
assingGlobalFunction( "ImageDrawTextEx", ltexturesImageDrawTextEx );
/* Texture loading functions. */
assingGlobalFunction( "GetTextureDefault", ltexturesGetTextureDefault );
@@ -1580,6 +1590,7 @@ void luaRegister() {
assingGlobalFunction( "GetTextureFormat", ltexturesGetTextureFormat );
/* Texture drawing functions. */
assingGlobalFunction( "DrawTexture", ltexturesDrawTexture );
assingGlobalFunction( "DrawTextureEx", ltexturesDrawTextureEx );
assingGlobalFunction( "DrawTextureRec", ltexturesDrawTextureRec );
assingGlobalFunction( "DrawTexturePro", ltexturesDrawTexturePro );
assingGlobalFunction( "DrawTextureNPatch", ltexturesDrawTextureNPatch );
@@ -1601,7 +1612,6 @@ void luaRegister() {
assingGlobalFunction( "ColorAlpha", ltexturesColorAlpha );
assingGlobalFunction( "ColorAlphaBlend", ltexturesColorAlphaBlend );
assingGlobalFunction( "GetColor", ltexturesGetColor );
assingGlobalFunction( "GetPixelColor", ltexturesGetPixelColor );
assingGlobalFunction( "GetPixelDataSize", ltexturesGetPixelDataSize );
/* Models. */
@@ -1610,6 +1620,7 @@ void luaRegister() {
assingGlobalFunction( "DrawPoint3D", lmodelsDrawPoint3D );
assingGlobalFunction( "DrawCircle3D", lmodelsDrawCircle3D );
assingGlobalFunction( "DrawTriangle3D", lmodelsDrawTriangle3D );
assingGlobalFunction( "DrawTriangleStrip3D", lmodelsDrawTriangleStrip3D );
assingGlobalFunction( "DrawCube", lmodelsDrawCube );
assingGlobalFunction( "DrawCubeWires", lmodelsDrawCubeWires );
assingGlobalFunction( "DrawSphere", lmodelsDrawSphere );
@@ -1668,11 +1679,13 @@ void luaRegister() {
assingGlobalFunction( "GenMeshPlane", lmodelsGenMeshPlane );
assingGlobalFunction( "GenMeshCube", lmodelsGenMeshCube );
assingGlobalFunction( "GenMeshSphere", lmodelsGenMeshSphere );
assingGlobalFunction( "GenMeshHemiSphere", lmodelsGenMeshHemiSphere );
assingGlobalFunction( "GenMeshCylinder", lmodelsGenMeshCylinder );
assingGlobalFunction( "GenMeshCone", lmodelsGenMeshCone );
assingGlobalFunction( "GenMeshTorus", lmodelsGenMeshTorus );
assingGlobalFunction( "GenMeshKnot", lmodelsGenMeshKnot );
assingGlobalFunction( "GenMeshHeightmap", lmodelsGenMeshHeightmap );
assingGlobalFunction( "GenMeshCubicmap", lmodelsGenMeshCubicmap );
assingGlobalFunction( "GenMeshCustom", lmodelsGenMeshCustom );
/* Material management functions. */
assingGlobalFunction( "LoadMaterials", lmodelsLoadMaterials );
@@ -1740,6 +1753,7 @@ void luaRegister() {
/* Text font info functions. */
assingGlobalFunction( "SetTextLineSpacing", ltextSetTextLineSpacing );
assingGlobalFunction( "MeasureText", ltextMeasureText );
assingGlobalFunction( "MeasureTextEx", ltextMeasureTextEx );
assingGlobalFunction( "GetGlyphIndex", ltextGetGlyphIndex );
assingGlobalFunction( "GetGlyphInfo", ltextGetGlyphInfo );
assingGlobalFunction( "GetGlyphInfoByIndex", ltextGetGlyphInfoByIndex );
@@ -1769,9 +1783,12 @@ void luaRegister() {
assingGlobalFunction( "GetCodepointPrevious", ltextGetCodepointPrevious );
assingGlobalFunction( "CodepointToUTF8", ltextCodepointToUTF8 );
/* Text strings management functions (no UTF-8 strings, only byte chars) */
assingGlobalFunction( "TextSubtext", ltextTextSubtext );
assingGlobalFunction( "TextReplace", ltextTextReplace );
assingGlobalFunction( "TextInsert", ltextTextInsert );
assingGlobalFunction( "TextSplit", ltextTextSplit );
assingGlobalFunction( "TextFindIndex", ltextTextFindIndex );
assingGlobalFunction( "TextToPascal", ltextTextToPascal );
/* Audio. */
/* Audio device management functions. */
@@ -1788,6 +1805,7 @@ void luaRegister() {
assingGlobalFunction( "LoadSoundFromWave", laudioLoadSoundFromWave );
assingGlobalFunction( "LoadSoundAlias", laudioLoadSoundAlias );
assingGlobalFunction( "IsSoundReady", laudioIsSoundReady );
assingGlobalFunction( "UpdateSound", laudioUpdateSound );
assingGlobalFunction( "UnloadWave", laudioUnloadWave );
assingGlobalFunction( "UnloadSound", laudioUnloadSound );
assingGlobalFunction( "UnloadSoundAlias", laudioUnloadSoundAlias );
@@ -1803,6 +1821,7 @@ void luaRegister() {
assingGlobalFunction( "SetSoundPitch", laudioSetSoundPitch );
assingGlobalFunction( "SetSoundPan", laudioSetSoundPan );
assingGlobalFunction( "WaveFormat", laudioWaveFormat );
assingGlobalFunction( "LoadWaveSamples", laudioLoadWaveSamples );
assingGlobalFunction( "WaveCopy", laudioWaveCopy );
assingGlobalFunction( "WaveCrop", laudioWaveCrop );
/* Music management functions. */

View File

@@ -172,6 +172,32 @@ int lmodelsDrawTriangle3D( lua_State* L ) {
return 0;
}
/*
> RL.DrawTriangleStrip3D( Vector3{} points, Color color )
Draw a triangle strip defined by points
*/
int lmodelsDrawTriangleStrip3D( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 );
Color color = uluaGetColor( L, 2 );
Vector3 points[ pointCount ];
int t = 1, i = 0;
lua_pushnil( L );
while ( lua_next( L, t ) != 0 ) {
if ( lua_istable( L, -1 ) ) {
points[i] = uluaGetVector3( L, lua_gettop( L ) );
}
i++;
lua_pop( L, 1 );
}
DrawTriangleStrip3D( points, pointCount, color );
return 0;
}
/*
> RL.DrawCube( Vector3 position, Vector3 size, Color color )
@@ -1304,6 +1330,23 @@ int lmodelsGenMeshSphere( lua_State* L ) {
return 1;
}
/*
> mesh = RL.GenMeshHemiSphere( float radius, int rings, int slices )
Generate half-sphere mesh (no bottom cap)
- Success return Mesh
*/
int lmodelsGenMeshHemiSphere( lua_State* L ) {
float radius = luaL_checknumber( L, 1 );
int rings = luaL_checkinteger( L, 2 );
int slices = luaL_checkinteger( L, 3 );
uluaPushMesh( L, GenMeshHemiSphere( radius, rings, slices ) );
return 1;
}
/*
> mesh = RL.GenMeshCylinder( float radius, float height, int slices )

View File

@@ -663,18 +663,35 @@ int ltextSetTextLineSpacing( lua_State* L ) {
}
/*
> size = RL.MeasureText( Font font, string text, float fontSize, float spacing )
> width = RL.MeasureText( string text, int fontSize )
Measure string width for default font
- Success return int
*/
int ltextMeasureText( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 );
int fontSize = luaL_checkinteger( L, 2 );
lua_pushinteger( L, MeasureText( text, fontSize ) );
return 1;
}
/*
> size = RL.MeasureTextEx( Font font, string text, float fontSize, float spacing )
Measure string size for Font
- Success return Vector2
*/
int ltextMeasureText( lua_State* L ) {
int ltextMeasureTextEx( lua_State* L ) {
Font* font = uluaGetFont( L, 1 );
const char* text = luaL_checkstring( L, 2 );
float fontSize = luaL_checknumber( L, 3 );
float spacing = luaL_checknumber( L, 4 );
uluaPushVector2( L, MeasureTextEx( *font, luaL_checkstring( L, 2 ), fontSize, spacing ) );
uluaPushVector2( L, MeasureTextEx( *font, text, fontSize, spacing ) );
return 1;
}
@@ -1143,6 +1160,43 @@ int ltextCodepointToUTF8( lua_State* L ) {
## Text - Text strings management functions (no UTF-8 strings, only byte chars)
*/
/*
> text = RL.TextSubtext( string text, int position, int length )
Get a piece of a text string
- Success return string
*/
int ltextTextSubtext( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 );
int position = luaL_checkinteger( L, 2 );
int length = luaL_checkinteger( L, 3 );
lua_pushstring( L, TextSubtext( text, position, length ) );
return 1;
}
/*
> text = RL.TextReplace( string text, string replace, string by )
Replace text string
- Success return string
*/
int ltextTextReplace( lua_State* L ) {
char* text = (char*)luaL_checkstring( L, 1 );
const char* replace = luaL_checkstring( L, 2 );
const char* by = luaL_checkstring( L, 3 );
char* result = TextReplace( text, replace, by );
lua_pushstring( L, result );
free( result );
return 1;
}
/*
> text = RL.TextInsert( string text, string insert, int position )
@@ -1213,3 +1267,18 @@ int ltextTextFindIndex( lua_State* L ) {
return 1;
}
/*
> text = RL.TextToPascal( string text )
Get Pascal case notation version of provided string
- Success return string
*/
int ltextTextToPascal( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 );
lua_pushstring( L, TextToPascal( text ) );
return 1;
}

View File

@@ -433,19 +433,37 @@ int ltexturesImageFromImage( lua_State* L ) {
}
/*
> image = RL.ImageText( Font font, string text, float fontSize, float spacing, Color tint )
> image = RL.ImageText( string text, int fontSize, Color tint )
Create an image from text (default font)
- Success return Image
*/
int ltexturesImageText( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 );
int fontSize = luaL_checkinteger( L, 2 );
Color tint = uluaGetColor( L, 3 );
uluaPushImage( L, ImageText( text, fontSize, tint ) );
return 1;
}
/*
> image = RL.ImageTextEx( Font font, string text, float fontSize, float spacing, Color tint )
Create an image from text (custom sprite font)
- Success return Image
*/
int ltexturesImageText( lua_State* L ) {
int ltexturesImageTextEx( lua_State* L ) {
Font* font = uluaGetFont( L, 1 );
float fontSize = lua_tonumber( L, 3 );
float spacing = lua_tonumber( L, 4 );
const char* text = luaL_checkstring( L, 2 );
float fontSize = luaL_checknumber( L, 3 );
float spacing = luaL_checknumber( L, 4 );
Color tint = uluaGetColor( L, 5 );
uluaPushImage( L, ImageTextEx( *font, luaL_checkstring( L, 2 ), fontSize, spacing, tint ) );
uluaPushImage( L, ImageTextEx( *font, text, fontSize, spacing, tint ) );
return 1;
}
@@ -499,7 +517,7 @@ Crop image depending on alpha value
*/
int ltexturesImageAlphaCrop( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
float threshold = lua_tonumber( L, 2 );
float threshold = luaL_checknumber( L, 2 );
ImageAlphaCrop( image, threshold );
@@ -514,7 +532,7 @@ Clear alpha channel to desired color
int ltexturesImageAlphaClear( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
Color color = uluaGetColor( L, 2 );
float threshold = lua_tonumber( L, 3 );
float threshold = luaL_checknumber( L, 3 );
ImageAlphaClear( image, color, threshold );
@@ -1063,6 +1081,23 @@ int ltexturesImageDraw( lua_State* L ) {
return 0;
}
/*
> RL.ImageDrawText( Image dst, string text, Vector2 position, float fontSize, Color tint )
Draw text (using default font) within an image (destination)
*/
int ltexturesImageDrawText( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
const char* text = luaL_checkstring( L, 2 );
Vector2 position = uluaGetVector2( L, 3 );
float fontSize = luaL_checknumber( L, 4 );
Color tint = uluaGetColor( L, 5 );
ImageDrawText( image, text, position.x, position.y, fontSize, tint );
return 0;
}
/*
> RL.ImageDrawTextEx( Image dst, Font font, string text, Vector2 position, float fontSize, float spacing, Color tint )
@@ -1071,12 +1106,13 @@ Draw text (Custom sprite font) within an image (Destination)
int ltexturesImageDrawTextEx( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
Font* font = uluaGetFont( L, 2 );
const char* text = luaL_checkstring( L, 3 );
Vector2 position = uluaGetVector2( L, 4 );
float fontSize = luaL_checknumber( L, 5 );
float spacing = luaL_checknumber( L, 6 );
Color tint = uluaGetColor( L, 7 );
ImageDrawTextEx( image, *font, luaL_checkstring( L, 3 ), position, fontSize, spacing, tint );
ImageDrawTextEx( image, *font, text, position, fontSize, spacing, tint );
return 0;
}
@@ -1487,10 +1523,26 @@ Draw a Texture2D
*/
int ltexturesDrawTexture( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
Vector2 pos = uluaGetVector2( L, 2 );
Vector2 position = uluaGetVector2( L, 2 );
Color color = uluaGetColor( L, 3 );
DrawTexture( *texture, pos.x, pos.y, color );
DrawTexture( *texture, position.x, position.y, color );
return 0;
}
/*
> RL.DrawTextureEx( Texture texture, Vector2 position, float rotation, float scale, Color tint )
Draw a Texture2D with extended parameters
*/
int ltexturesDrawTextureEx( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
Vector2 position = uluaGetVector2( L, 2 );
float rotation = luaL_checknumber( L, 3 );
float scale = luaL_checknumber( L, 4 );
Color color = uluaGetColor( L, 5 );
DrawTextureEx( *texture, position, rotation, scale, color );
return 0;
}
@@ -1502,10 +1554,10 @@ Draw a part of a texture defined by a rectangle
int ltexturesDrawTextureRec( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
Rectangle srcRect = uluaGetRectangle( L, 2 );
Vector2 pos = uluaGetVector2( L, 3 );
Vector2 position = uluaGetVector2( L, 3 );
Color tint = uluaGetColor( L, 4 );
DrawTextureRec( *texture, srcRect, pos, tint );
DrawTextureRec( *texture, srcRect, position, tint );
return 0;
}
@@ -1519,10 +1571,10 @@ int ltexturesDrawTexturePro( lua_State* L ) {
Rectangle srcRect = uluaGetRectangle( L, 2 );
Rectangle dstRect = uluaGetRectangle( L, 3 );
Vector2 origin = uluaGetVector2( L, 4 );
float rot = luaL_checknumber( L, 5 );
float rotation = luaL_checknumber( L, 5 );
Color color = uluaGetColor( L, 6 );
DrawTexturePro( *texture, srcRect, dstRect, origin, rot, color );
DrawTexturePro( *texture, srcRect, dstRect, origin, rotation, color );
return 0;
}
@@ -2005,24 +2057,6 @@ int ltexturesGetColor( lua_State* L ) {
return 1;
}
/*
> color = RL.GetPixelColor( Texture texture, Vector2 position )
Get pixel color from source texture
- Success return Color
*/
int ltexturesGetPixelColor( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
Vector2 pos = uluaGetVector2( L, 2 );
Image srcImage = LoadImageFromTexture( *texture );
uluaPushColor( L, GetImageColor( srcImage, pos.x, pos.y ) );
UnloadImage( srcImage );
return 1;
}
/*
> size = RL.GetPixelDataSize( int width, int height, int format )