Forum

pop up text box in blend4web ?

04 June 2016 14:37
how can i create a clickable pop up text box. like its in planetarium example in blend4web ?
05 June 2016 20:25
To other forum users and Blend4Web developers: Just to give you some background on this question - I have attempted to answer it on Blender Stack Exchange (another place where Sharad Gupta asked), however I don't think I have been able to provide a complete solution.

In response to my answer he asked further: "how can i load data from an external html file?"

I pointed him to this article that explains about the three methods for placing Blend4Web content on websites.

Am I correct in my understanding that Method #1 cannot be used? That is to say that there is no way to Export > Blend4Web (.html) and also use the "Custom Element" type of Anchor - so Export > Blend4Web (.json) must be used instead and the exported .json file will attempt to reference the .html file it is embedded in to find the DIV ID and stylesheet data?

What started as a simple question with a seemingly simple answer is starting to make my head hurt. But I'm curious to find out the correct way to do this too, and would like to make the answer available for others who may be looking to do the same thing.
07 June 2016 09:19
i want to know that is there any way so that when i click on my blender character a pop up window comes in front and displays data and i want to fetch that data from database and then display it?
07 June 2016 10:22
Maybe your gonna need a JScallback node.

https://www.youtube.com/watch?v=dWEHg5Yzcys

This video is very instructive.
I used it to display divs in front of the canvas when i click on some objects.
07 June 2016 10:23
Check my topic about that.
https://www.blend4web.com/en/forums/topic/1988/
07 June 2016 11:48

i want to know that is there any way so that when i click on my blender character a pop up window comes in front and displays data and i want to fetch that data from database and then display it?
Hello!
Popups from Planetarium demo are special blend4web "Anchors" (docs).
They are empty objects with corresponding options selected. You can link anchor to custom html element by its id:


Blend4Web Team - developer
Twitter
LinkedIn
07 June 2016 12:39
Can one modify the aspect of the anchor with CSS o change the color and font?
07 June 2016 12:44

Can one modify the aspect of the anchor with CSS o change the color and font?
If the anchor's type is "Custom Element" then it is a standard HTML element from your page. So everything related to html elements is of course possible for them
Blend4Web Team - developer
Twitter
LinkedIn
07 June 2016 14:15
How to use that file option in anchor and can i use it to call my data in that file using ajax and display it using blend4web ?
07 June 2016 21:41
Well i guess you give it an ID so you can use it like any html object in the DOM. Something like document.getElementById('nameofAnchorID')

I imagine. I'm stuck with my JS callbacks right now. But that's my next move in my project so i hope i can tell you more quickly.
 
Please register or log in to leave a reply.