Results 1 to 2 of 2

Thread: Text Entity for Debug output

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

    Default Text Entity for Debug output

    Any recommendations for making a text overlay for debug output? I was trying to do something that output accelerometer values but can't seem to get the text to change every frame...

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

    Default Never mind, figured it out

    #ifdef _DEBUG
    Code:
    		m_pAccelDisplayEnt = CreateTextLabelEntity(GetParent(), "AccelDebug", GetScreenSizeXf()/2, GetScreenSizeYf()-150, "Accel:");
    		AddFocusIfNeeded(m_pAccelDisplayEnt);
    #endif
    (OnAccel)
    Code:
    CL_Vec3f v = pVList->Get(1).GetVector3();
    	
    #ifdef _DEBUG
    	char strMsg[256];
    	
    	sprintf(strMsg, "Acc: %f, %f, %f", v.x, v.y, v.z);
    
    	LogMsg("Acc: %f, %f, %f", v.x, v.y, v.z);
    	
    	EntityComponent* comp = m_pAccelDisplayEnt->GetComponentByName("TextRender");
    	comp->GetVar("text")->Set(strMsg);
    #endif

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. Annoying debug message.
    By speeder in forum Novashell Game Creation System
    Replies: 0
    Last Post: 04-10-2010, 11:31 PM
  4. Weird display output?
    By CoderMan in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 12-04-2009, 07:51 AM
  5. Builds successfully, but doesn't output correctly...
    By LeegleechN in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 11-07-2007, 03:10 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
  •