Results 1 to 1 of 1

Thread: How to interpolate position of Entity and its children

  1. #1
    Lesser Wizard
    Join Date
    Nov 2010
    Location
    Los Angeles, California, United States, United States
    Posts
    126

    Lightbulb How to interpolate position of Entity and its children

    I'm trying to create a button bar on the bottom of the screen with the following Entity (simplified) layout:

    MainScreenEntity
    - ButtonBarEntity
    -- HeadingBarEntity (RectRenderComponent)
    -- BackgroundEntity (RectRenderComponent)
    -- Button1Entity (Button2DComponent)
    -- Button2Entity (Button2DComponent)
    -- Button3Entity (Button2DComponent)

    I'm trying to move it towards the bottom of the screen with the following code:

    AddFocusIfNeeded(pButtonBarEntity);
    ZoomToPositionEntity(pButtonBarEntity, CL_Vec2d(rectBar1.left, rectBar1.bottom - controlHeight), 3000, INTERPOLATE_SMOOTHSTEP, 5000);

    But it does nothing. Does this not move all child Entities as well? How do I make sure all children of pButtonBarEntity move as well?

    ** UPDATE **
    It does work using SlideScreenVertical so I guess I'll just use that on my Entity.

    ** UPDATE **
    Turns out I need to have the size2d and pos2d variants defined, which means I need to calculate those before calling either function. Works now!
    Last edited by BigBMan; 01-23-2011 at 05:41 AM.

Similar Threads

  1. SetFont() method for Entity text
    By garcia in forum Novashell Game Creation System
    Replies: 3
    Last Post: 12-08-2010, 05:51 AM
  2. What I would need to do to implement a new entity type or something?
    By speeder in forum Novashell Game Creation System
    Replies: 1
    Last Post: 08-18-2010, 05:10 AM
  3. visibility and children
    By xrubio in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 08-31-2009, 09:45 PM
  4. How do I make an entity face a certain direction?
    By Jeral in forum Novashell Game Creation System
    Replies: 2
    Last Post: 12-14-2008, 07:44 PM
  5. Problem with turorial 'convert to entity'
    By hellbound007 in forum Novashell Game Creation System
    Replies: 2
    Last Post: 05-30-2008, 12:58 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •