if(settings[tooltip].style, set_tooltip_style(get(settings[tooltip].style)); , set_tooltip_style(default_tooltip_style); );
if(layer[tooltip].style != %1, set(layer[tooltip].style, %1);
ifnot(style[%1].generated, set(style[%1].generated, true);
set(style[%1].css, '');
txtadd(color, 'color:#', get(style[%1].font_color), '; ');
txtadd(font_family, 'font-family:', get(style[%1].font_family), '; ');
txtadd(font_size, 'font-size:', get(style[%1].font_size), 'px; ');
txtadd(font_weight, 'font-weight:', get(style[%1].font_weight), '; ');
if(device.html5,
if(style[%1].html5_font_family,
txtadd(font_family, 'font-family:', get(style[%1].html5_font_family), '; ');
);
);
txtadd(style[%1].css, get(color));
txtadd(style[%1].css, get(font_family));
txtadd(style[%1].css, get(font_size));
txtadd(style[%1].css, get(font_weight));
);
copy_style(tooltip, %1);
copy_style(tooltip_arrow_square, %1);
set(layer[tooltip_arrow_square].roundedge, 0); );
copy(layer[%1].css, style[%2].css); copy(layer[%1].embeddedfonts, style[%2].embeddedfonts); copy(layer[%1].padding, style[%2].padding); copy(layer[%1].padding_2x, style[%2].padding_2x); copy(layer[%1].roundedge, style[%2].roundedge); copy(layer[%1].background, style[%2].background); copy(layer[%1].backgroundcolor, style[%2].backgroundcolor); copy(layer[%1].backgroundalpha, style[%2].backgroundalpha); copy(layer[%1].border, style[%2].border); copy(layer[%1].bordercolor, style[%2].bordercolor); copy(layer[%1].borderalpha, style[%2].borderalpha); copy(layer[%1].borderwidth, style[%2].borderwidth); copy(layer[%1].shadow, style[%2].shadow); copy(layer[%1].shadowrange, style[%2].shadowrange); copy(layer[%1].shadowangle, style[%2].shadowangle); copy(layer[%1].shadowcolor, style[%2].shadowcolor); copy(layer[%1].shadowalpha, style[%2].shadowalpha); copy(layer[%1].textshadow, style[%2].textshadow); copy(layer[%1].textshadowrange, style[%2].textshadowrange); copy(layer[%1].textshadowangle, style[%2].textshadowangle); copy(layer[%1].textshadowcolor, style[%2].textshadowcolor); copy(layer[%1].textshadowalpha, style[%2].textshadowalpha);
if (ath !== null,
ifnot(hotspot[%1].tooltip_oy,
set(hotspot[%1].tooltip_oy, 000);
);
ifnot(hotspot[%1].tooltip,
set(hotspot[%1].tooltip, '');
);
ifnot(hotspot[%1].edge,
set(hotspot[%1].edge, center);
);
if(hotspot[%1].edge == center,
copy(new_tooltip_oy, hotspot[%1].height);
div(new_tooltip_oy, 2);
mul(new_tooltip_oy, -1);
add(hotspot[%1].tooltip_oy, new_tooltip_oy);
);
if(device.touchdevice,
ifnot(hotspot[%1].ondown,
set(hotspot[%1].ondown, '')
);
ifnot(hotspot[%1].onup,
set(hotspot[%1].onup, '')
);
txtadd(hotspot[%1].ondown, 'show_tooltip();');
txtadd(hotspot[%1].onup, 'hide_tooltip();');
,
ifnot(hotspot[%1].onover, set(hotspot[%1].onover, ''));
ifnot(hotspot[%1].onout, set(hotspot[%1].onout, ''));
txtadd(hotspot[%1].onover, 'show_tooltip();');
txtadd(hotspot[%1].onout, 'hide_tooltip();');
);
,
ifnot(layer[%1].tooltip_oy,
set(layer[%1].tooltip_oy, 000);
);
ifnot(layer[%1].tooltip, set(layer[%1].tooltip, ''); );
if(device.touchdevice,
ifnot(layer[%1].ondown, set(layer[%1].ondown, ''));
ifnot(layer[%1].onup, set(layer[%1].onup, ''));
txtadd(layer[%1].ondown, 'show_tooltip();');
txtadd(layer[%1].onup, 'hide_tooltip();');
,
ifnot(layer[%1].onover, set(layer[%1].onover, ''));
ifnot(layer[%1].onout, set(layer[%1].onout, ''));
txtadd(layer[%1].onover, 'show_tooltip();');
txtadd(layer[%1].onout, 'hide_tooltip();');
);
);
set(layer[tooltip].visible, true); set(layer[tooltip_arrow].visible, true); tween(layer[tooltip].alpha, 1, .10); tween(layer[tooltip_arrow].alpha, 1, .10);
if(tooltip,
if(settings[tooltip].visible
,
copy(layer[tooltip].html, tooltip);
copy(layer[tooltip].current, name);
if(tooltip_oy != '000',
copy(layer[tooltip_arrow].oy, tooltip_oy);
copy(layer[tooltip].oy, tooltip_oy);
sub(layer[tooltip].oy, layer[tooltip_arrow].pixelheight);
,
copy(layer[tooltip_arrow].oy, settings[tooltip].oy);
copy(layer[tooltip].oy, settings[tooltip].oy);
sub(layer[tooltip].oy, layer[tooltip_arrow].pixelheight);
);
set(arrow_offset, 5);
add(layer[tooltip_arrow].oy, arrow_offset);
add(layer[tooltip].oy, arrow_offset);
if(tooltip_style,
set_tooltip_style(get(tooltip_style));
,
reset_tooltip_style();
);
delayedcall(.06,
if(device.touchdevice,
if(layer[get(layer[tooltip].current)].pressed,
fadein_tooltip();
,
if(hotspot[get(layer[tooltip].current)].pressed,
fadein_tooltip();
);
);
,
if(layer[get(layer[tooltip].current)].hovering,
fadein_tooltip();
,
if(hotspot[get(layer[tooltip].current)].hovering,
fadein_tooltip();
);
);
);
);
set(i, 0);
update_tooltip_posiition();
if(device.touchdevice,
asyncloop(pressed, update_tooltip_posiition(); );
,
if (ath !== null,
asyncloop(hotspot[get(name)].hovering, update_tooltip_posiition(); , hide_tooltip(); );
,
asyncloop(layer[get(name)].hovering, update_tooltip_posiition(); );
);
);
));
stoptween(layer[tooltip].alpha); stoptween(layer[tooltip_arrow].alpha); set(layer[tooltip].alpha, 0); set(layer[tooltip_arrow].alpha, 0); set(layer[tooltip].visible,false); set(layer[tooltip_arrow].visible,false);
if (ath !== null,
spheretoscreen(ath, atv, abs_x, abs_y);
,
plugin[abs].get_y(abs_y, get(name));
plugin[abs].get_x(abs_x, get(name), center);
);
copy(layer[tooltip].y, abs_y);
copy(layer[tooltip_arrow].y, abs_y);
copy(layer[tooltip].x, abs_x);
copy(layer[tooltip_arrow].x, abs_x);
div(half_tooltip, layer[tooltip].width, 2);
sub(tooltip_left, layer[tooltip].x, half_tooltip);
set(max_tooltip, 4);
if(tooltip_left LT max_tooltip,
copy(layer[tooltip].x, tooltip_left);
mul(layer[tooltip].x, -1);
add(layer[tooltip].x, abs_x);
add(layer[tooltip].x, max_tooltip);
,
div(half_tooltip, layer[tooltip].width, 2);
add(tooltip_right, layer[tooltip].x, half_tooltip);
sub(tooltip_right, stagewidth, tooltip_right);
if(tooltip_right LT max_tooltip,
add(layer[tooltip].x, tooltip_right);
sub(layer[tooltip].x, max_tooltip);
);
);
set(max_arrow, 14);
if(layer[tooltip_arrow].x LT max_arrow, copy(layer[tooltip_arrow].x, max_arrow); , sub(arrow_limit, stagewidth, max_arrow); if(layer[tooltip_arrow].x GT arrow_limit, copy(layer[tooltip_arrow].x, arrow_limit); ); );
indexoftxt(p_index, get(style[%1].padding), ' ', %2); add(p_next_start, 1, p_index); sub(p_length, p_index, %2); set(p_start, %2); if(p_index LT 0, set(p_length, 3); ); subtxt(padding_value, style[%1].padding, get(p_start), get(p_length)); mul(padding_value, 2); txtadd(style[%1].padding_2x, get(padding_value)); if(p_index GT 0, txtadd(style[%1].padding_2x, ' '); mul_padding(%1, get(p_next_start)); );