///////////////////////////////////////////////////
// Input
///////////////////////////////////////////////////
var _state = mouse_check_state(mb_left);
var _region = mouse_check_region(input_rect[0], input_rect[1], input_rect[2], input_rect[3]);
var _input;
//Set input back to false if input is not of type toggle
if (input_type_ != 1) input = 0;
//Releasing
if (_state == 3)
{
if (_region)
{
//Press type
if (input_type_ == 0)
image_frame = 0
//Toggle type
else if (input_type_ == 1)
image_frame = toggle(image_frame, 0, 2) + 0;
//Minimize
if (minimizeable)
{
var _size = [0, max(rect[3] * minimized, minimized_height)]
editor_set_element_image_size(self, _size[0], _size[1]);
minimized = !minimized;
}
}
else
{
image_frame = 0;
input_state = 0;
input = 0
}
dragging = 0;
drag_x = 0;
drag_y = 0;
}
//Holding
else if (_state == 2)
{
if (_region)
{
if (input_type_ == 0)
image_frame = 1;
else if (input_type_ == 1)
image_frame = toggle(image_frame, 0, 2) + 1;
}
else
{
if (!draggable)
image_frame = 0;
//input = 0 + (input_type_ == 2);
}
if (dragging)
{
editor_set_element_position(self, drag_x + mouse_x, drag_y + mouse_y)
}
}
//Clicked
else if (_state == 1)
{
if (_region)
{
if (draggable)
{
dragging = 1;
drag_x = image_rect[0] - mouse_x;
drag_y = image_rect[1] - mouse_y;
}
}
}