2023-08-28, 11:58
Hi,
The site I am developing an addon for has a captcha solution implemented. Basically there is a background image and an icon placed on this randomly that the user has to click on and then send the position of the icon. I haven't found a way to get the cursor position from kodi, so I decided to use a skin instead. I am rendering the captcha image and on top of that I want to render a 90x90 image border which is to "aim" the captcha. I am subscribed to actions on this dialog and whenever the user presses left, the border should jump 10px to the left and so on.
I have tried doing that, but it doesn't seem to be possible to set left and top values as strings. I have read about a single workaround which would be using conditional includes. But that would be a lot of combinations... Any other way? I am open to crazy ones as well such as adding some invisible list elements to a grid or so that force the item's position to move.
The site I am developing an addon for has a captcha solution implemented. Basically there is a background image and an icon placed on this randomly that the user has to click on and then send the position of the icon. I haven't found a way to get the cursor position from kodi, so I decided to use a skin instead. I am rendering the captcha image and on top of that I want to render a 90x90 image border which is to "aim" the captcha. I am subscribed to actions on this dialog and whenever the user presses left, the border should jump 10px to the left and so on.
Code:
<control type="image" id="50">
<description>Captcha image</description>
<visible>true</visible>
<left>760</left> <!-- Centering the image horizontally (1920 - 400) / 2 -->
<top>340</top> <!-- Centering the image vertically (1080 - 400) / 2 -->
<width>400</width>
<height>400</height>
<texture>$INFO[Window.Property(captcha)]</texture>
</control>
<control type="image" id="51">
<description>Border image</description>
<visible>true</visible>
<left>$INFO[Window.Property(border_left)]</left>
<top>$INFO[Window.Property(border_top)]</top>
<width>90</width>
<height>90</height>
<texture>border90.png</texture>
</control>
I have tried doing that, but it doesn't seem to be possible to set left and top values as strings. I have read about a single workaround which would be using conditional includes. But that would be a lot of combinations... Any other way? I am open to crazy ones as well such as adding some invisible list elements to a grid or so that force the item's position to move.