text
stringlengths 0
234
|
|---|
Bitmap_Buffer.Fill_Rect ((Position => (e.X, e.Y),
|
Width => Width / 12,
|
Height => Height / 12));
|
end draw_enn;
|
procedure draw(X : Integer; Y : Integer) is
|
begin
|
draw_space(space, X, Y);
|
for i in Missiles'First .. Missiles'Last loop
|
draw_mis(Missiles(i));
|
end loop;
|
for i in Ennmies'First .. Ennmies'Last loop
|
draw_enn(Ennmies(i));
|
end loop;
|
end draw;
|
begin
|
Reset(G);
|
-- Initialize LCD
|
Display.Initialize;
|
Display.Initialize_Layer (1, HAL.Bitmap.ARGB_8888);
|
Touch_Panel.Initialize;
|
Width := Bitmap_Buffer.Width;
|
Height := Bitmap_Buffer.Height;
|
space.Y := 20;
|
space.X := Width/2;
|
loop
|
declare
|
State : constant TP_State := Touch_Panel.Get_All_Touch_Points;
|
begin
|
if State'Length > 0 then
|
X_Coord := State (State'First).X;
|
Y_Coord := State (State'First).Y;
|
end if;
|
Function Definition: procedure Clear;
|
Function Body: -----------
|
-- Clear --
|
-----------
|
procedure Clear is
|
begin
|
Display.Hidden_Buffer (1).Set_Source (BG);
|
Display.Hidden_Buffer (1).Fill;
|
LCD_Std_Out.Clear_Screen;
|
LCD_Std_Out.Put_Line ("Touch the screen to draw or");
|
LCD_Std_Out.Put_Line ("press the blue button for");
|
LCD_Std_Out.Put_Line ("a demo of drawing primitives.");
|
Display.Update_Layer (1, Copy_Back => True);
|
end Clear;
|
Last_X : Integer := -1;
|
Last_Y : Integer := -1;
|
type Mode is (Drawing_Mode, Bitmap_Showcase_Mode);
|
Current_Mode : Mode := Drawing_Mode;
|
begin
|
-- Initialize LCD
|
Display.Initialize;
|
Display.Initialize_Layer (1, ARGB_8888);
|
-- Initialize touch panel
|
Touch_Panel.Initialize;
|
-- Initialize button
|
User_Button.Initialize;
|
LCD_Std_Out.Set_Font (BMP_Fonts.Font8x8);
|
LCD_Std_Out.Current_Background_Color := BG;
|
-- Clear LCD (set background)
|
Clear;
|
-- The application: set pixel where the finger is (so that you
|
-- cannot see what you are drawing).
|
loop
|
if User_Button.Has_Been_Pressed then
|
case Current_Mode is
|
when Drawing_Mode =>
|
Current_Mode := Bitmap_Showcase_Mode;
|
when Bitmap_Showcase_Mode =>
|
Clear;
|
Current_Mode := Drawing_Mode;
|
end case;
|
end if;
|
if Current_Mode = Drawing_Mode then
|
Display.Hidden_Buffer (1).Set_Source (HAL.Bitmap.Green);
|
declare
|
State : constant TP_State := Touch_Panel.Get_All_Touch_Points;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.