with Ada.Real_Time; use Ada.Real_Time;
private with Values.Lists;
package Widgets.Labels is
type Label is new Widget and Animated with private;
type A_Label is access all Label'Class;
function Create_Label( view : not null access Game_Views.Game_View'Class;
id : String;
text : String := "";
icon : String := "" ) return A_Label;
pragma Precondition( id'Length > 0 );
pragma Postcondition( Create_Label'Result /= null );
function Get_Text( this : not null access Label'Class ) return String;
procedure Set_Align( this : not null access Label'Class; align : Align_Type );
procedure Set_Color( this : access Label;
purpose : Color_Purpose;
color : Allegro_Color );
procedure Set_Icon( this : not null access Label'Class; icon : String );
procedure Set_Text( this : not null access Label'Class; text : String );
private
use Values.Lists;
type Label is new Widget and Animated with
record
align : Align_Type := Align_Left;
text : Unbounded_String;
icon : Natural := 0;
iconStart : Time_Span;
iconFrame : Natural := 0;
iconFrameDelay : Time_Span;
iconFrameLoop : List_Ptr;
end record;
procedure Construct( this : access Label;
view : not null access Game_Views.Game_View'Class;
id : String;
text : String;
icon : String );
procedure Draw_Content( this : access Label );
function Get_Min_Height( this : access Label ) return Natural;
function Get_Min_Width( this : access Label ) return Natural;
procedure Tick( this : access Label; time : Tick_Time );
end Widgets.Labels;