gel.events: Add space mouse click detection for 2D.
This commit is contained in:
@@ -775,9 +775,6 @@ is
|
||||
|
||||
Site_world_space : constant Vector_3 := the_Camera.to_world_Site (Site_window_space);
|
||||
|
||||
sprite_Event : constant gel.Events.sprite_click_down_Event := (mouse_Button => the_Event.Button,
|
||||
world_Site => Site_world_space);
|
||||
|
||||
begin
|
||||
case the_world_Info.World.space_Kind
|
||||
is
|
||||
@@ -788,7 +785,12 @@ is
|
||||
begin
|
||||
if the_Collision.near_Sprite /= null
|
||||
then
|
||||
the_Collision.near_Sprite.emit (sprite_Event);
|
||||
declare
|
||||
sprite_clicked_Event : constant gel.Events.sprite_click_down_Event := (mouse_Button => the_Event.Button,
|
||||
world_Site => Site_world_space);
|
||||
begin
|
||||
the_Collision.near_Sprite.emit (sprite_clicked_Event);
|
||||
end;
|
||||
end if;
|
||||
end;
|
||||
|
||||
@@ -802,7 +804,20 @@ is
|
||||
begin
|
||||
if the_Collision.near_Sprite /= null
|
||||
then
|
||||
the_Collision.near_Sprite.emit (sprite_Event);
|
||||
declare
|
||||
sprite_clicked_Event : constant gel.Events.sprite_click_down_Event := (mouse_Button => the_Event.Button,
|
||||
world_Site => Site_world_space);
|
||||
|
||||
begin
|
||||
the_Collision.near_Sprite.emit (sprite_clicked_Event);
|
||||
end;
|
||||
else
|
||||
declare
|
||||
space_clicked_Event : constant gel.Events.space_click_down_Event := (mouse_Button => the_Event.Button,
|
||||
world_Site => Site_world_space);
|
||||
begin
|
||||
Self.Applet.emit (space_clicked_Event);
|
||||
end;
|
||||
end if;
|
||||
end;
|
||||
end case;
|
||||
|
||||
@@ -73,6 +73,20 @@ is
|
||||
end record;
|
||||
|
||||
|
||||
type space_click_down_Event is new lace.Event.item with
|
||||
record
|
||||
mouse_Button : gel.Mouse.Button_Id;
|
||||
world_Site : math.Vector_3;
|
||||
end record;
|
||||
|
||||
|
||||
type space_click_up_Event is new lace.Event.item with
|
||||
record
|
||||
mouse_Button : gel.Mouse.Button_Id;
|
||||
world_Site : math.Vector_3;
|
||||
end record;
|
||||
|
||||
|
||||
type sprite_click_down_Event is new lace.Event.item with
|
||||
record
|
||||
mouse_Button : gel.Mouse.Button_Id;
|
||||
|
||||
Reference in New Issue
Block a user