Update to version 1.0.3
View CHANGELOG for full list of changes
17
CHANGELOG
|
|
@ -1,11 +1,26 @@
|
||||||
changelog
|
changelog
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Current Release: raylib 1.0.2 (December 2013)
|
Current Release: raylib 1.0.3 (December 2013)
|
||||||
|
|
||||||
NOTE: Only versions marked as 'Release' are available on release folder, updates are only available as source.
|
NOTE: Only versions marked as 'Release' are available on release folder, updates are only available as source.
|
||||||
NOTE: Current Release includes all previous updates.
|
NOTE: Current Release includes all previous updates.
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
Release: raylib 1.0.3 (19 December 2013)
|
||||||
|
-----------------------------------------------
|
||||||
|
[fonts] Added 8 rBMF free fonts to be used on projects!
|
||||||
|
[text] LoadSpriteFont() - Now supports rBMF file loading (raylib Bitmap Font)
|
||||||
|
[examples] ex05a_sprite_fonts completed
|
||||||
|
[examples] ex05b_rbmf_fonts completed
|
||||||
|
[core] InitWindowEx() - InitWindow with extended parameters, resizing option and custom cursor!
|
||||||
|
[core] GetRandomValue() - Added, returns a random value within a range (int)
|
||||||
|
[core] SetExitKey() - Added, sets a key to exit program (default is ESC)
|
||||||
|
[core] Custom cursor not drawn when mouse out of screen
|
||||||
|
[shapes] CheckCollisionPointRec() - Added, check collision between point and rectangle
|
||||||
|
[shapes] CheckCollisionPointCircle() - Added, check collision between point and circle
|
||||||
|
[shapes] CheckCollisionPointTriangle() - Added, check collision between point and triangle
|
||||||
|
[shapes] DrawPoly() - Added, draw regular polygons of n sides, rotation can be defined!
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Release: raylib 1.0.2 (1 December 2013)
|
Release: raylib 1.0.2 (1 December 2013)
|
||||||
|
|
|
||||||
11
LICENSE.md
|
|
@ -27,4 +27,13 @@ applications, and to alter it and redistribute it freely, subject to the followi
|
||||||
fonts
|
fonts
|
||||||
------
|
------
|
||||||
|
|
||||||
...soon...
|
All rBMF fonts provided with raylib are free to use (freeware) and have been designed by the following people:
|
||||||
|
|
||||||
|
Alpha Beta - Brian Kent (AEnigma)
|
||||||
|
Setback - Brian Kent (AEnigma)
|
||||||
|
Jupiter Crash - Brian Kent (AEnigma)
|
||||||
|
Alagard - Hewett Tsoi
|
||||||
|
Romulus - Hewett Tsoi
|
||||||
|
Mecha - Captain Falcon
|
||||||
|
PixelPlay - Aleksander Shevchuk
|
||||||
|
PixAntiqua - Gerhard Großmann
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,28 @@ int main()
|
||||||
int screenWidth = 800;
|
int screenWidth = 800;
|
||||||
int screenHeight = 450;
|
int screenHeight = 450;
|
||||||
|
|
||||||
|
const char msg1[50] = "THIS IS A custom SPRITE FONT...";
|
||||||
|
const char msg2[50] = "...and this is ANOTHER CUSTOM font...";
|
||||||
|
const char msg3[50] = "...and a THIRD one! GREAT! :D";
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib example 05a - sprite fonts");
|
InitWindow(screenWidth, screenHeight, "raylib example 05a - sprite fonts");
|
||||||
|
|
||||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
SpriteFont font = LoadSpriteFont("resources/custom_font.png"); // SpriteFont loading
|
SpriteFont font1 = LoadSpriteFont("resources/fonts/custom_mecha.png"); // SpriteFont loading
|
||||||
|
SpriteFont font2 = LoadSpriteFont("resources/fonts/custom_alagard.png"); // SpriteFont loading
|
||||||
|
SpriteFont font3 = LoadSpriteFont("resources/fonts/custom_jupiter_crash.png"); // SpriteFont loading
|
||||||
|
|
||||||
|
Vector2 fontPosition1, fontPosition2, fontPosition3;
|
||||||
|
|
||||||
|
fontPosition1.x = screenWidth/2 - MeasureTextEx(font1, msg1, GetFontBaseSize(font1), -3).x/2;
|
||||||
|
fontPosition1.y = screenHeight/2 - GetFontBaseSize(font1)/2 - 80;
|
||||||
|
|
||||||
|
fontPosition2.x = screenWidth/2 - MeasureTextEx(font2, msg2, GetFontBaseSize(font2), -2).x/2;
|
||||||
|
fontPosition2.y = screenHeight/2 - GetFontBaseSize(font2)/2 - 10;
|
||||||
|
|
||||||
|
fontPosition3.x = screenWidth/2 - MeasureTextEx(font3, msg3, GetFontBaseSize(font3), 2).x/2;
|
||||||
|
fontPosition3.y = screenHeight/2 - GetFontBaseSize(font3)/2 + 50;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
|
|
@ -29,7 +47,7 @@ int main()
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// TODO: Update your variables here
|
// TODO: Update variables here...
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
|
@ -38,18 +56,19 @@ int main()
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
// TODO: Comming soon...
|
DrawTextEx(font1, msg1, fontPosition1, GetFontBaseSize(font1), -3, WHITE);
|
||||||
// TIP: Use DrawTextEx() function
|
DrawTextEx(font2, msg2, fontPosition2, GetFontBaseSize(font2), -2, WHITE);
|
||||||
/*
|
DrawTextEx(font3, msg3, fontPosition3, GetFontBaseSize(font3), 2, WHITE);
|
||||||
void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, int fontSize, int spacing, Color tint);
|
|
||||||
*/
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSpriteFont(font); // SpriteFont unloading
|
UnloadSpriteFont(font1); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font2); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font3); // SpriteFont unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
BIN
examples/ex05a_sprite_fonts.exe
Normal file
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 19 KiB |
|
|
@ -9,19 +9,26 @@
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
#include "raylib.h"
|
#include "../raylib.h"
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
int screenWidth = 800;
|
int screenWidth = 560;
|
||||||
int screenHeight = 450;
|
int screenHeight = 800;
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raylib example 04b - texture rectangle");
|
InitWindow(screenWidth, screenHeight, "raylib example 05b - rBMF fonts");
|
||||||
|
|
||||||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
||||||
SpriteFont font = LoadSpriteFont("resources/custom_font.rbmf"); // SpriteFont loading
|
SpriteFont font1 = LoadSpriteFont("resources/fonts/alagard.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font2 = LoadSpriteFont("resources/fonts/pixelplay.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font3 = LoadSpriteFont("resources/fonts/mecha.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font4 = LoadSpriteFont("resources/fonts/setback.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font5 = LoadSpriteFont("resources/fonts/romulus.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font6 = LoadSpriteFont("resources/fonts/pixantiqua.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font7 = LoadSpriteFont("resources/fonts/alpha_beta.rbmf"); // SpriteFont loading
|
||||||
|
SpriteFont font8 = LoadSpriteFont("resources/fonts/jupiter_crash.rbmf"); // SpriteFont loading
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
|
|
@ -38,20 +45,31 @@ int main()
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
// TODO: Comming soon...
|
DrawTextEx(font1, "TESTING ALAGARD FONT", (Vector2){ 100, 100 }, GetFontBaseSize(font1)*2, 2, MAROON);
|
||||||
// TIP: Use DrawTextEx() function
|
DrawTextEx(font2, "TESTING PIXELPLAY FONT", (Vector2){ 100, 180 }, GetFontBaseSize(font2)*2, 4, ORANGE);
|
||||||
/*
|
DrawTextEx(font3, "TESTING MECHA FONT", (Vector2){ 100, 260 }, GetFontBaseSize(font3)*2, 8, DARKGREEN);
|
||||||
void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, int fontSize, int spacing, Color tint);
|
DrawTextEx(font4, "TESTING SETBACK FONT", (Vector2){ 100, 350 }, GetFontBaseSize(font4)*2, 4, DARKBLUE);
|
||||||
*/
|
DrawTextEx(font5, "TESTING ROMULUS FONT", (Vector2){ 100, 430 }, GetFontBaseSize(font5)*2, 3, DARKPURPLE);
|
||||||
|
DrawTextEx(font6, "TESTING PIXANTIQUA FONT", (Vector2){ 100, 510 }, GetFontBaseSize(font6)*2, 4, LIME);
|
||||||
|
DrawTextEx(font7, "TESTING ALPHA_BETA FONT", (Vector2){ 100, 590 }, GetFontBaseSize(font7)*2, 4, GOLD);
|
||||||
|
DrawTextEx(font8, "TESTING JUPITER_CRASH FONT", (Vector2){ 100, 660 }, GetFontBaseSize(font8)*2, 1, RED);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSpriteFont(font); // SpriteFont unloading
|
UnloadSpriteFont(font1); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font2); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font3); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font4); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font5); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font6); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font7); // SpriteFont unloading
|
||||||
|
UnloadSpriteFont(font8); // SpriteFont unloading
|
||||||
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
CloseWindow(); // Close window and OpenGL context
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
BIN
examples/ex05b_rbmf_fonts.exe
Normal file
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 15 KiB |
|
|
@ -24,7 +24,7 @@ int main()
|
||||||
|
|
||||||
InitAudioDevice(); // Initialize audio device
|
InitAudioDevice(); // Initialize audio device
|
||||||
|
|
||||||
Sound fx = LoadSound("resources/weird.wav"); // Load WAV audio file
|
Sound fx = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
|
|
|
||||||
BIN
examples/resources/audio/coin.wav
Normal file
BIN
examples/resources/audio/spring.wav
Normal file
BIN
examples/resources/audio/weird.wav
Normal file
BIN
examples/resources/fonts/alagard.rbmf
Normal file
BIN
examples/resources/fonts/alpha_beta.rbmf
Normal file
BIN
examples/resources/fonts/custom_alagard.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
examples/resources/fonts/custom_jupiter_crash.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
examples/resources/fonts/custom_mecha.png
Normal file
|
After Width: | Height: | Size: 26 KiB |