Results 1 to 2 of 2

Thread: Placing Entities next to each other

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

    Default Placing Entities next to each other

    Trying to place one of your text buttons next to another but my current (and likely incorrect) method of getting an Entity's width/height isn't working.

    Code:
    	pEnt = CreateTextButtonEntity(pBG, "Debug", x, y, "Debug Options"); 
    	pEnt->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect);
    	pEnt->GetVar("alignment")->Set(uint32(ALIGNMENT_DOWN_LEFT));
    	
    	x += ((CL_Vec2f*)(pEnt->GetVar("size2d")))->x + space;
    
    	pEnt = CreateTextButtonEntity(pBG, "Terrain", x, y, "3D Terrain"); 
    	pEnt->GetShared()->GetFunction("OnButtonSelected")->sig_function.connect(&MainMenuOnSelect);
    	pEnt->GetVar("alignment")->Set(uint32(ALIGNMENT_DOWN_LEFT));
    Any ideas?

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,343

    Default

    You had:

    Code:
    x += ((CL_Vec2f*)(pEnt->GetVar("size2d")))->x + space;
    Don't think this is right, try this:

    Code:
    x += pEnt->GetVar("size2d")->GetVector2().x + space;
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Real bug to do with entities
    By Uhfgood in forum Novashell Game Creation System
    Replies: 9
    Last Post: 07-17-2008, 03:49 AM
  2. Help with attaching entities
    By Uhfgood in forum Novashell Game Creation System
    Replies: 1
    Last Post: 07-13-2008, 02:02 AM
  3. Interaction between two entities - Grabbing
    By Siris in forum Novashell Game Creation System
    Replies: 2
    Last Post: 03-22-2008, 05:14 AM
  4. Getting Entities to discover the Brain State of other entities
    By stellarvector in forum Novashell Game Creation System
    Replies: 1
    Last Post: 06-28-2007, 11:11 PM
  5. Rotating tiles/entities
    By sphair in forum Novashell Game Creation System
    Replies: 0
    Last Post: 03-12-2007, 09:33 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
  •