Added mouse wheel, text scrolling...

This commit is contained in:
Ognjen Milan Robovic 2024-05-13 09:32:49 -04:00
parent 53a4179c40
commit 0d1b03cdd1
4 changed files with 8 additions and 2 deletions

View File

@ -431,6 +431,7 @@ package body core is
signal := ray.get_key_pressed;
cursor.x := ray.get_mouse_x;
cursor.y := ray.get_mouse_y;
wheel := wheel + ray.mouse_wheel_move;
--
ray.end_drawing;
--

View File

@ -91,6 +91,8 @@ package core is
gameplay_time : natural := 0;
animation_time : natural := 0;
wheel : float := 0.0;
zoom : natural := 1;
block_limit : constant natural := 40;

View File

@ -297,8 +297,8 @@ begin
declare source_code_data : string_box_data;
begin
import_text (source_code_data, to_string (source_code (view_source_code)));
if cursor_mode = 1 then view_source_code := (view_source_code + 1) mod 36; cursor_mode := 0; end if;
ui.write_ada_code (source_code_data, 0, 0);
if cursor_mode = 1 then view_source_code := (view_source_code + 1) mod 36; cursor_mode := 0; wheel := 0.0; end if;
ui.write_ada_code (source_code_data, 0, integer (wheel) * 30);
end;
end loop main_menu_loop;

View File

@ -177,6 +177,9 @@ package ray is
--~double GetTime(void);
--~void OpenURL(const char *url);
function load_text (file : in string) return char_array with import => true, convention => c, external_name => "LoadFileText";
function mouse_wheel_move return float with import => true, convention => c, external_name => "GetMouseWheelMove";
--~procedure unload_file (data : in access string) with import => true, convention => c, external_name => "UnloadFileText";
--~bool SaveFileText(const char *fileName, char *text);
--~FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs);