Page 1 of 1

anchor close button to image

Posted: Sat Jul 29, 2017 11:42 am
by Niki
Hi, i am just starting to learn skins and i have a really basic question: I loaded the "Image PupUp Simplex" Component into the default simplex skin. By default, the encircled X to close the image always stays at the top right of the screen. But i want it to always stay at the top right of the Image.

I tried nesting "image_popup_close" into the "image_popup" folder and even into the "popup_image". does not work...

what do i have to do? Thanks!

Re: anchor close button to image

Posted: Sun Jul 30, 2017 7:12 pm
by Hopki
Hi Niki,
The external loader is set to open the image to show it at its original size or scaled to fit the external loader keeping its aspect ratio.
This is why the close button is anchored top right of the skin canvas as depending on the width of the image the close button can shif position as it stays top right of the external loader.
Examples:

landscape.png
landscape.png (111.88 KiB) Viewed 2762 times
portrate.png
portrate.png (75.87 KiB) Viewed 2762 times

In the above the external loaders background is enabled so you can see it, but just think what it would look like if it was not. The close button would appear to be jumping around.

You can set the external loader not to scale automaticity and keep the image in the external loader.
Then you can move the close button to the top right of the external loader.
Of course this means the image will no longer scale automatically.
But you can set up a scaling logic block to do this with screen width.

Change the external loaders position and size to pixels.
As an example anchor the external loader centre of the skin editor and make its size 460 x 310px then using the Edit menu centre the loader in the skin canvas.
Set the external loader like so:

externalsettings.png
externalsettings.png (63.45 KiB) Viewed 2762 times

This will show all your images in the 460 x 310px loader window keeping the aspect ratio of the image.
Under the external loaders scaling logic block set up so player width <= 320, scale to 0.8/0.8.
You can add different settings or if you start with the external loader larger add more so it stays in the screen width for say tablet and phone.
Regards,
Hopki

Re: anchor close button to image

Posted: Tue Aug 22, 2017 2:17 pm
by Niki
Hey Hopki, thanks a lot for your very detailed answer, i am new to the forums and somehow i was not notified by email when you answered, so i just saw it now. Otherwise i would have thanked you earlier...

I will try your approach asap, i may be coming back to you then, but i think i won't have to because your explanation is so detailed :)

In the meantime, would you be so kind and have a look at my new topic?: viewtopic.php?f=13&t=12218

Thanks!

Re: anchor close button to image

Posted: Wed Aug 23, 2017 1:41 pm
by Hopki
Hi Niki,
It has already been answered by Jare.
Regards,
Hopki