Found one bug, do not move on arrow keys...
This commit is contained in:
parent
0c54eb0226
commit
d14d5f719f
@ -68,7 +68,7 @@ package core is
|
||||
global_time : natural := 0;
|
||||
gameplay_time : natural := 0;
|
||||
animation_time : natural := 0;
|
||||
zoom : natural := 2;
|
||||
zoom : natural := 1;
|
||||
|
||||
text_box : text_box_data;
|
||||
|
||||
|
@ -146,8 +146,8 @@ begin
|
||||
--
|
||||
exit when core.engine_active = false;
|
||||
--
|
||||
core.camera.x := core.clip (core.camera.x, 0, world.width - preview_width / core.base);
|
||||
core.camera.y := core.clip (core.camera.y, 0, world.height - preview_height / core.base);
|
||||
core.camera.x := core.clip (core.camera.x, 0, world.width - preview_width / core.base / core.zoom);
|
||||
core.camera.y := core.clip (core.camera.y, 0, world.height - preview_height / core.base / core.zoom);
|
||||
--
|
||||
world.draw;
|
||||
--
|
||||
|
@ -11,22 +11,33 @@ package body ui is
|
||||
type element is (
|
||||
none,
|
||||
main_background,
|
||||
corner_upper_left, corner_upper_right, corner_lower_left, corner_lower_right,
|
||||
tiny_corner_upper_left, tiny_corner_upper_right, tiny_corner_lower_left, tiny_corner_lower_right,
|
||||
border_upper, border_lower, border_left, border_right,
|
||||
tiny_border_upper, tiny_border_lower, tiny_border_left, tiny_border_right,
|
||||
--
|
||||
corner_upper_left, border_upper, corner_upper_right,
|
||||
border_left, border_right,
|
||||
corner_lower_left, border_lower, corner_lower_right,
|
||||
--
|
||||
tiny_corner_upper_left, tiny_border_upper, tiny_corner_upper_right,
|
||||
tiny_border_left, tiny_border_right,
|
||||
tiny_corner_lower_left, tiny_border_lower, tiny_corner_lower_right,
|
||||
--
|
||||
frame_upper_left, frame_upper, frame_upper_right,
|
||||
frame_left, frame_middle, frame_right,
|
||||
frame_lower_left, frame_lower, frame_lower_right,
|
||||
cursor, icon, overicon,
|
||||
--
|
||||
icon_upper_left, icon_upper, icon_upper_right,
|
||||
icon_left, icon_right,
|
||||
icon_lower_left, icon_lower, icon_lower_right,
|
||||
--
|
||||
text_upper_left, text_upper, text_upper_right,
|
||||
text_left, text_middle, text_right,
|
||||
text_lower_left, text_lower, text_lower_right,
|
||||
--
|
||||
cursor, icon, overicon,
|
||||
--
|
||||
fill_bar_left, fill_bar_horizontal, fill_bar_right, fill_horizontal,
|
||||
--
|
||||
scroll_bar_lower, scroll_bar_middle, scroll_bar_upper,
|
||||
--
|
||||
title_bar_left, title_bar_middle, title_bar_right
|
||||
);
|
||||
|
||||
@ -48,19 +59,21 @@ package body ui is
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure draw (index : in element; x, y : in integer) is
|
||||
save_zoom : natural := core.zoom;
|
||||
begin
|
||||
core.zoom := 1;
|
||||
core.draw (sprite (active, index), x, y);
|
||||
core.zoom := 2;
|
||||
core.zoom := save_zoom;
|
||||
end draw;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure crop (index : in element; x, y, width, height : in integer) is
|
||||
save_zoom : natural := core.zoom;
|
||||
begin
|
||||
core.zoom := 1;
|
||||
core.draw (sprite (active, index), x, y, 0, 0, width, height);
|
||||
core.zoom := 2;
|
||||
core.zoom := save_zoom;
|
||||
end crop;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
@ -141,6 +154,7 @@ package body ui is
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure draw_icon (data : in core.sprite; description : in string; x, y : in integer) is
|
||||
save_zoom : natural := core.zoom;
|
||||
begin
|
||||
select_text_box (description, x, y, core.icon, core.icon);
|
||||
--
|
||||
@ -148,18 +162,19 @@ package body ui is
|
||||
--
|
||||
core.zoom := 1;
|
||||
core.draw (data, x, y);
|
||||
core.zoom := 2;
|
||||
core.zoom := save_zoom;
|
||||
end draw_icon;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure draw_overicon (data : in core.sprite; description : in string; x, y : in integer) is
|
||||
save_zoom : natural := core.zoom;
|
||||
begin
|
||||
select_text_box (description, x, y, core.icon, core.icon);
|
||||
--
|
||||
core.zoom := 1;
|
||||
core.draw (data, x, y);
|
||||
core.zoom := 2;
|
||||
core.zoom := save_zoom;
|
||||
--
|
||||
draw (overicon, x, y);
|
||||
end draw_overicon;
|
||||
|
Loading…
Reference in New Issue
Block a user