Problem in changing the ID of a dynamic actor...

(5 posts) (3 voices)

Tags:

No tags yet.

  1. bluAndy

    enthusiast
    Joined: Oct '14
    Posts: 90

    I have a problem in changing the ID of a dynamic actor I think...
    I attached a project which displays the name of a day or a month depending on the choice made.

    At the project start dynamic buttons are created to make the choices (6 for the months and 5 for the days)

    For the months buttons I used a template composed of a textured 2D node with a 2D text subactor to be able
    to display the names of the months that can be chosen. The names of the months are stored in an array which is iterated, and at every
    iteration a button is created and at the same time its position is set and the ID of the 2D node and 2dText are changed into the name of the month.
    Also the text of the 2D text is set to the name of the month.

    For the days I done the same like for the months except the fact that I didn't use a 2d text as subactor, I only used a textured 2d node. And in
    the array where I keep the name of the days I also keep a texture made in paint with the name of the day so I can display the name on the button
    so we can see what we choose. And as before, at each iteration I set a position, an ID but also a texture.

    Now, each button ends a clickableClickEvent to the behaviors, along with the ID of the clicked button. This ID is used to display the month or day
    chosen.

    The problem is that for the day everything works fine, but for the month, even though I changed the ID of the button (the 2D node and also the 2d text), and I know it's changed because it appears in the project editor in the dynamic actors tree, when its displayed it displays the original name of the template.

    So I don't understand why if the IDs are changed in the project editor, why aren't they changed in the display too. I think it should work in the case of the composed template too ( 2d node + 2d text) if it works for just the 2d node template.

    Can someone please help me see where my mistake is?

    Thank you.

    Attachments

    1. day_month_display.mpexp (44.3 KB, 3 downloads) 2 years old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 2 years ago #
  2. bluAndy

    enthusiast
    Joined: Oct '14
    Posts: 90

    I hope everything I tried to explain above is clearer in the project it self. I don't really know how I could explain better...

    Posted 2 years ago #
  3. hiddentux

    3D Experience Guru
    Joined: Feb '09
    Posts: 400

    I'm not sure why, but it seems that the ComponentIDs of the subactors are not updated in the Schematic.

    To make it work :

    1. Right-click on month_template > Add Existing Behavior > display_month
    2. Add a Clickable Item on month_template
    3. Delete the Clickable Item and the behavior display_month on the subactor month_text
    4. Last but not least, untick Pickable in the Property View of month_text, otherwise it'll catch the mouse clicks and the function clickEvent will never be triggered

    Posted 2 years ago #
  4. iainB85

    Interplanetary Delivery Boy
    Joined: Jun '08
    Posts: 515

    Another quick work around is to use the "Text" field of your 2D node to update it rather than the ComponentID by doing a Text2D component cast and exporting the "Text" member of your clicked item, I updated your project to do so.

    Attachments

    1. forumTextSample.mpexp (44.5 KB, 0 downloads) 2 years old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 2 years ago #
  5. bluAndy

    enthusiast
    Joined: Oct '14
    Posts: 90

    Thank you very much. Now it works fine

    Posted 2 years ago #

Reply

You must log in to post.