Some code tweaks...
This commit is contained in:
parent
415e7e972c
commit
3d755d617a
4 changed files with 17 additions and 6 deletions
|
@ -32,7 +32,7 @@ int main()
|
|||
GenTextureMipmaps(&font.texture);
|
||||
|
||||
float fontSize = font.baseSize;
|
||||
Vector2 fontPosition = { 40, screenHeight/2 + 50 };
|
||||
Vector2 fontPosition = { 40, screenHeight/2 - 50 };
|
||||
Vector2 textSize;
|
||||
|
||||
SetTextureFilter(font.texture, FILTER_POINT);
|
||||
|
|
14
src/core.c
14
src/core.c
|
@ -81,7 +81,7 @@
|
|||
#define SUPPORT_DEFAULT_FONT
|
||||
#define SUPPORT_MOUSE_GESTURES
|
||||
#define SUPPORT_CAMERA_SYSTEM
|
||||
#define SUPPORT_GESTURES_SYSTEM
|
||||
//#define SUPPORT_GESTURES_SYSTEM
|
||||
#define SUPPORT_BUSY_WAIT_LOOP
|
||||
#define SUPPORT_GIF_RECORDING
|
||||
//-------------------------------------------------
|
||||
|
@ -2526,6 +2526,8 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
|||
rlClearScreenBuffers(); // Clear screen buffers (color and depth)
|
||||
|
||||
// Window size must be updated to be used on 3D mode to get new aspect ratio (Begin3dMode())
|
||||
// NOTE: Be careful! GLFW3 will choose the closest fullscreen resolution supported by current monitor,
|
||||
// for example, if reescaling back to 800x450 (desired), it could set 720x480 (closest fullscreen supported)
|
||||
screenWidth = width;
|
||||
screenHeight = height;
|
||||
renderWidth = width;
|
||||
|
@ -2777,8 +2779,16 @@ static int32_t AndroidInputCallback(struct android_app *app, AInputEvent *event)
|
|||
ProcessGestureEvent(gestureEvent);
|
||||
#else
|
||||
|
||||
// TODO: Support only simple touch position
|
||||
// Support only simple touch position
|
||||
if (flags == AMOTION_EVENT_ACTION_DOWN)
|
||||
{
|
||||
// Get first touch position
|
||||
touchPosition[0].x = AMotionEvent_getX(event, 0);
|
||||
touchPosition[0].y = AMotionEvent_getY(event, 0);
|
||||
|
||||
touchPosition[0].x /= (float)GetScreenWidth();
|
||||
touchPosition[0].y /= (float)GetScreenHeight();
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -884,10 +884,9 @@ static SpriteFont LoadTTF(const char *fileName, int fontSize, int charsCount, in
|
|||
stbtt_GetFontVMetrics(&fontInfo, &ascent, 0, 0);
|
||||
baseline = (int)(ascent*scale);
|
||||
|
||||
|
||||
if (fontChars[0] != 32) TraceLog(LOG_WARNING, "TTF spritefont loading: first character is not SPACE(32) character");
|
||||
|
||||
// NOTE: Using stb_truetype crappy packing method, no guarante the font fits the image...
|
||||
// NOTE: Using stb_truetype crappy packing method, no guarantee the font fits the image...
|
||||
// TODO: Replace this function by a proper packing method and support random chars order,
|
||||
// we already receive a list (fontChars) with the ordered expected characters
|
||||
int result = stbtt_BakeFontBitmap(ttfBuffer, 0, fontSize, dataBitmap, textureSize, textureSize, fontChars[0], charsCount, charData);
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
#define SUPPORT_FILEFORMAT_PNG
|
||||
#define SUPPORT_FILEFORMAT_DDS
|
||||
#define SUPPORT_FILEFORMAT_HDR
|
||||
#define SUPPORT_FILEFORMAT_KTX
|
||||
#define SUPPORT_FILEFORMAT_ASTC
|
||||
#define SUPPORT_IMAGE_MANIPULATION
|
||||
#define SUPPORT_IMAGE_GENERATION
|
||||
//-------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue