Forum

Create Anchor like Dairy Plant

28 February 2017 12:03
Hi everybody,

I look at the code_snippets custom_anchor and I understand the three type of how to create an anchor.
Now, I will to create an anchor a little like DairyPlant, we click on an object and a description appear.

I look the js, the css and the blend of DairyPlant but there is many many informations and I don't know where are the infos who interest me.
Can you help me ? How to create a custom anchor with many and stylish texts who appear when I click on a selectable object ?

Find for your help.
I'm not crazy ! My reality is just different than yours.
28 February 2017 12:42
Ok, I'm stupid, I know how to appear an element when I click :

/**
    * Click on an object
    */
    function click_object(x, y) {

        var obj = m_scs.pick_object(x, y);

        //action
        if (obj) {
            //outlined
            m_scs.apply_outline_anim(obj, 1, 1.8, 1);

            if (obj.name == "my_object") {
                var anchor = m_scs.get_object_by_name("my_anchor");
                if (m_scs.is_hidden(anchor))
                    m_scs.show_object(anchor, false);
                else
                    m_scs.hide_object(anchor, false);
            }
        }
    }


So, my question is :
How to create an anchor with a big text inside with bold, italic, \n, … ?

I use the anchor type Annotation because It's fine. I put my text in the Title of MetaTags.
I'm not crazy ! My reality is just different than yours.
28 February 2017 15:20
This is very simple project with an anchors - project.zip.

You can import it in the Project Manager.
The whole annotation text is placed in the HTML file anchors.html. Text styles - in the anchors.css.
28 February 2017 18:03
Thanks Dmitry !
This is exactly what I needed.

One more question, now, how can I transform the function of show/hide describe to :

- If I click on 1. After I click on 2, I want to close automatically the panel 1.
- And why not show the panel with a scale fade
I'm not crazy ! My reality is just different than yours.
01 March 2017 12:10
You can see a similar functionality in the anchors module .
 
Please register or log in to leave a reply.