I have some image and video hotspots that I am using as image and video popups in VR Devices. It looks like the following (a video popup):
Here I want to place a close button top-center but the problem is that I am not able to position the close button based on height of the popup as I am not setting any explicit width/height for popup, it has to be based on the image/video original size.
My question is, is it possible to get native width/height/bounding-rectangle of a hotspot to calculate the position of the close button like ath + height/2 or so?
Any other idea to solve this close button position is also obviously a great help. I saw that layers or parent-child has issues in VR thats why I am trying flat / single level of hotspots.
This is the code I use to add close button: hotspot[popup] is the video/image popup shown in above image
<!-- ADD CLOSE BUTTON -->
addhotspot(popup_close);
set(hotspot[popup_close].url,'https://....../close.png');
set(hotspot[popup_close].distorted,true);
set(hotspot[popup_close].alpha,0);
set(hotspot[popup_close].edge,bottom);
set(hotspot[popup_close].depth,900);
set(hotspot[popup_close].tx,0);
set(hotspot[popup_close].ty,-300); <!-- Calculate using hotspot[popup].nativeHeight??? -!>
trace(get(hotspot[popup].width));
set(hotspot[popup_close].ath,get(hotspot[popup].ath));
set(hotspot[popup_close].atv,get(hotspot[popup].atv));
set(hotspot[popup_close].onclick,removepopuphotspot());
tween(hotspot[popup_close].alpha,1, 2);
Alles anzeigen
Peace,