Adding web links is very easy, because we only need to create a button with a function. This button, as I wrote before, not needed to be an image, it could be a text or a video, or a simple object or 3D object. This button's function will be to open a link when it's needed! In a button's case, when it's clicked. In Fuzize, it's very simple. I can show you, with the next example
1. \\program:=links\..
2. \\log:=1\..
3.
4. STRT
5.
6. button.img;
7. set.button.img.costume.value:={'C:\Users\John Doe\Pictures\picture.jpg'};
8. set.button.img.visible:=true;
9.
10. ALWAYS
11.
12. if.(button.img=clicked=true)thando:=
13. openlink:={'https://youtube.com/'};
14. elsedo:=
15. donothing;
16.
17. noSTP
18.
19. STP
Now, the program will show an image button.img in the start. If this image is clicked, than the program will open the YouTube, with redirecting the current site. For this, we used openlink command, what is opens web links in the program. But what if we want to open the link in a different window, and we don't want to redirect the current page? Than we can do, what I did in the next example
1. openlink:={'https://youtube.com/'}type:=(newwindow);
With the type command, we can add how to open the current link. If we set the type newwindow , than if you click to the button, the link will be open in an other window. But, what if we just want to place it to an other tab? Than do this
1. openlink:={'https://youtube.com/'}type:=(newtab);
With setting the type to newtab , we reach to not open the link in an other window, but we can open it in an other tab now. It's easy, isn't it? This solution can be good, if you make a button with a costume link and you don't want to redirect the page, nor to open a different window.
Today we learnt about adding links to our programs, with buttons, and learnt how to use type command and newtab, newwindow values, what can help a lot if we add links to our program!
The program makes a button, what if you click, than it takes you to a direction of a link!
To add buttons with images is usually useful and effective, but what if we using texts? Is it even possible? Of course it is! Let me show you in this easy example
1. \\program:=textbutton\..
2. \\log:=1\..
3.
4. STRT
5.
6. button.txt;
7. set.button.txt.visible:=true;
9.
10. ALWAYS
11.
12. if.(button.txt=clicked=true)thando:=
13. openlink:={'https://youtube.com/'};
14. elsedo:=
15. donothing;
16.
17. noSTP
18.
19. STP
In this code we used an object button.txt , what we used to the same thing like in case of an image, however, it is much easier to set a text to link, and it can be effective too, if you use rainbow to the text color. Trust me, it will be cool!