
dialog_box_scale = 1 --0.0009 -- scales how big dialog boxes are

text_padding_vertical = 10 -- top and bottom padding around lines of text in pixels
text_padding_horizontal = 25 -- left and right padding around lines of text in pixels

max_text_line_width = 40 -- how many characters wide can each line be

-- anim_dialog_box
--[[dialog_box = nil
dialog_box_light_background = nil
dialog_box_light_mask = nil
dialog_box_dark_background = nil
dialog_box_dark_mask = nil]]

dialog_box_overlay = nil
dialog_box_pos = { }
dialog_box_pos.x, dialog_box_pos.y, dialog_box_pos.z = 0,0,0

local min_x, min_y, tmp, max_x, max_y

-- create dialog_box images
dialog_box_divider = {
	["sprite"] = make_transparent_image_sprite(media_dir .. "dialog_box_divider.png");
	["width"] = E.get_image_size(E.create_image(media_dir .. "dialog_box_divider.png"));
}

--[[
dialog_box_border = {
	["sprite"] = make_transparent_image_sprite(media_dir .. "dialog_box_border.png")
}]]

--[[
dialog_box_corner = {
	["sprite"] = make_transparent_image_sprite(media_dir .. "dialog_box_border.png")
}]]

dialog_box_bar = {
	["sprite"] = make_transparent_image_sprite(media_dir .. "dialog_box_bar.png")
}

dialog_box_background = {
	["sprite"] = make_transparent_image_sprite(media_dir .. "dialog_box_background.png")
}

min_x, min_y, tmp, max_x, max_y = E.get_entity_bound(dialog_box_background.sprite)
dialog_box = { }
dialog_box.width, dialog_box.height = (max_x - min_x), (max_y - min_y)

dialog_box_mask = {
	["sprite"] = make_opaque_image_sprite(media_dir .. "dialog_box_mask.png")
}

dialog_box_npc_background = {
	["sprite"] = make_opaque_image_sprite(media_dir .. "dialog_box_npc_background.png")
}

dialog_box_player_background = {
	["sprite"] = make_opaque_image_sprite(media_dir .. "dialog_box_player_background.png")
}

min_x, min_y, tmp, max_x, max_y = E.get_entity_bound(dialog_box_mask.sprite)
dialog_box_mask.width, dialog_box_mask.height = (max_x - min_x), (max_y - min_y)

-- hide dialog_box images
E.set_entity_flags(dialog_box_divider.sprite, E.entity_flag_hidden, true)
--E.set_entity_flags(dialog_box_border.sprite, E.entity_flag_hidden, true)
--E.set_entity_flags(dialog_box_corner.sprite, E.entity_flag_hidden, true)
E.set_entity_flags(dialog_box_bar.sprite, E.entity_flag_hidden, true)
E.set_entity_flags(dialog_box_background.sprite, E.entity_flag_hidden, true)
E.set_entity_flags(dialog_box_mask.sprite, E.entity_flag_hidden, true)
E.set_entity_flags(dialog_box_npc_background.sprite, E.entity_flag_hidden, true)
E.set_entity_flags(dialog_box_player_background.sprite, E.entity_flag_hidden, true)


