diff --git a/README.md b/README.md index 6de516dfc1c3287dbd787a1feaf1ce5056cee1ef..8ff0d81d7d251041569689f3b2c3f78002eeedb6 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,36 @@ | `color.BLACK` | 0 | 0 | 0 | 255 | | `color.BLANK` | 0 | 0 | 0 | 0 | | `color.MAGENTA` | 255 | 0 | 255 | 255 | +#### Using custom colors + +Color is essentially a structure with RGBA data. So constructing new colors is +very easy. + +Alpha channel can be omitted and will by default be 255. + +```lua +-- my_game.lua + +open_window(800, 800, "My Game") +set_fps(60) + +my_color1 = { r = 200, g = 200, b = 200, a = 255 } +my_color2 = { r = 200, g = 200, b = 200 } + +while window_running() do + start_drawing() + clear_window(color.BLACK) + + draw_rect(100, 100, 100, 100, my_color1) + draw_rect(300, 100, 100, 100, my_color2) + + draw_info() + stop_drawing() +end + +close_window() +``` + ## Libraries & Assets - https://github.com/rxi/microtar diff --git a/main.c b/main.c index aa72b330c14fc824822b00e8feb592c49a0150da..e895f2a8ce4b0bdf55bb50e5b6aa1d85880a4857 100644 --- a/main.c +++ b/main.c @@ -528,7 +528,7 @@ static void help(const char *argv0) { printf("Usage: %s [options]\n" "\nAvailable options:\n" - " -r,--run=file.lua run input file\n" + " -f,--file=file.lua run input file\n" " -b,--bundle bundles this folder\n" " -d,--debug prints debug information\n" " -h,--help this help\n" @@ -550,7 +550,7 @@ const char *run_file = NULL; const char short_options[] = "f:dbhv"; const struct option long_options[] = { - { "file", 1, NULL, 'r' }, + { "file", 1, NULL, 'f' }, { "debug", 0, NULL, 'd' }, { "bundle", 0, NULL, 'b' }, { "help", 0, NULL, 'h' },