Changes between Version 1 and Version 2 of documentation/C++Manual/Interfaces

Show
Ignore:
Author:
lloydw (IP: 203.97.235.76)
Timestamp:
03/15/08 13:52:51 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • documentation/C++Manual/Interfaces

    v1 v2  
    7171The GetElapsedTime() function should simply return the number of seconds that have elapsed since the start of the application. 
    7272 
    73 TranslateString() is called whenever a text element is constructed from an RML stream. ''input'' is the raw text read from the RML. ''translated'' should be set to the final text to be given to the text element to render. The total number of changes made to the raw text should be returned; this does not need to be precise, it is only used to quickly determine if any alterations were made, so a simple 0 for no alterations, 1 otherwise will suffice. This allows the application to send all text read from file through its string tables. Note that the translated text can include RML tags and they will be processed as if they were in the original stream; this can be used, for example, to substitute images for certain tokens. 
     73TranslateString() is called whenever a text element is constructed from an RML stream. This allows the application to send all text read from file through its string tables.  
     74 
     75''input'' is the raw text read from the RML. ''translated'' should be set to the final text to be given to the text element to render. The total number of changes made to the raw text should be returned; If the number is greater than 0 libRocket will recursively call your translate function to process any new text that was added to the stream. If your translation function does all the recursion itself, you can safely return 0 on every call. 
     76 
     77Note that the translated text can include RML tags and they will be processed as if they were in the original stream; this can be used, for example, to substitute images for certain tokens. 
    7478 
    7579The LogMessage() function is called whenever Rocket generates a message. ''type'' is one of the logging type, ''EMP::Core::Log::ERROR'' for error messages, ''EMP::Core::Log::ASSERT'' for failed internal assertions (debug library only), ''EMP::Core::Log::WARNING'' for non-fatal warnings, or ''EMP::Core::Log::INFO'' for generic information messages. The ''message'' parameter is the actual message itself. The function should return true if program execution should continue, or false to generate an interrupt to break execution. This can be useful if you are running inside a debugger to see exactly what an application is doing to trigger a certain message.