Update raylib.h
Added support form vertical and horizontal 3-patches. Corrected the distortion caused when destRec size is smaller than 4x4. Now even 1x10 or 0x0 sizes are drawn correctly.
This commit is contained in:
parent
7cc2a5585b
commit
6ef03ea4e8
1 changed files with 11 additions and 3 deletions
14
src/raylib.h
14
src/raylib.h
|
@ -412,13 +412,14 @@ typedef struct RenderTexture2D {
|
||||||
// RenderTexture type, same as RenderTexture2D
|
// RenderTexture type, same as RenderTexture2D
|
||||||
typedef RenderTexture2D RenderTexture;
|
typedef RenderTexture2D RenderTexture;
|
||||||
|
|
||||||
typedef struct NinePatch {
|
typedef struct NPatch {
|
||||||
Texture2D texture; // The texture associated with the 9-patch (maybe Texture2D *, instead?)
|
Texture2D texture; // The texture associated with the 9-patch (maybe Texture2D *, instead?)
|
||||||
Rectangle sourceRec; // The 9-patch region in the texture
|
Rectangle sourceRec; // The 9-patch region in the texture
|
||||||
Vector2 minSize; // The minimum size the 9-patch can be shrunk to
|
Vector2 minSize; // The minimum size the 9-patch can be shrunk to
|
||||||
float borderWidth[4]; // The widths of the left, top, right and bottom borders
|
float borderWidth[4]; // The widths of the left, top, right and bottom borders
|
||||||
int padding[4]; // Helps the n-patch contents fit nicely inside
|
int padding[4]; // Helps the n-patch contents fit nicely inside
|
||||||
} NinePatch;
|
int type; // The type of this n-patch: 9-patch, 3-patch vertical or 3-patch horizontal
|
||||||
|
} NPatch;
|
||||||
|
|
||||||
// Font character info
|
// Font character info
|
||||||
typedef struct CharInfo {
|
typedef struct CharInfo {
|
||||||
|
@ -737,6 +738,13 @@ typedef enum {
|
||||||
HMD_SONY_PSVR
|
HMD_SONY_PSVR
|
||||||
} VrDeviceType;
|
} VrDeviceType;
|
||||||
|
|
||||||
|
// Type of n-patch
|
||||||
|
typedef enum {
|
||||||
|
NPT_9PATCH = 0, // 3x3
|
||||||
|
NPT_3PATCH_VERTICAL, // 1x3
|
||||||
|
NPT_3PATCH_HORIZONTAL // 3x1
|
||||||
|
} NPatchType;
|
||||||
|
|
||||||
// Callbacks to be implemented by users
|
// Callbacks to be implemented by users
|
||||||
typedef void (*TraceLogCallback)(int msgType, const char *text, va_list args);
|
typedef void (*TraceLogCallback)(int msgType, const char *text, va_list args);
|
||||||
|
|
||||||
|
@ -1007,7 +1015,7 @@ RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
|
||||||
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters
|
||||||
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle
|
||||||
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters
|
||||||
RLAPI void DrawNinePatch(NinePatch ninePatch, Rectangle destRec, bool usePadding, Vector2 origin, float rotation, Color tint);
|
RLAPI void DrawNPatch(NPatch nPatch, Rectangle destRec, bool usePadding, Vector2 origin, float rotation, Color tint); //Draw 9x9, 3x1 or 1x3 stretchable Texture2D
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Font Loading and Text Drawing Functions (Module: text)
|
// Font Loading and Text Drawing Functions (Module: text)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue