Doc functions
Doc functions are used to control the document manager. They allow you to fine tune the display of maps, letters and books.
Functions
Doc_Create
Doc_Create
Creates a new instance of the document manager and returns its ID.
Return value
Returns the ID of the document manager instance.
Doc_CreateMap
Doc_CreateMap
Creates a new instance of the document manager with the arrow showing players position on the map and returns its ID.
Return value
Returns the ID of the document manager instance.
Doc_SetLevel
Doc_SetLevel
Set a world level to a map. This maps the texture of the document to the bounding box of the provided level.
Parameters
- var int docID- document manager ID
- var string level- name of the ZEN file
Doc_SetLevelCoords
Doc_SetLevelCoords
Sets the map coordinates. This is used to map smaller portions of the world map to the document map to correctly show players position on the map.
Parameters
- var int docID- document manager ID
- var int left- left coordinate
- var int top- top coordinate
- var int right- right coordinate
- var int bottom- bottom coordinate
Example
Warning
This function is only available in Gothic 2
Doc_SetFont
Doc_SetFont
Sets a font to be used on a page in a document with docID. Can be called multiple times to display different lines with different fonts.
Parameters
- var int docID- document manager ID
- var int page- page index, if set to- -1, fonts will be applied to all pages
- var string font- font to be used
Example
Doc_SetPages
Doc_SetPages
Sets the number of pages numOfPages of the document.
Parameters
- var int docID- document manager ID
- var int numOfPages- number of pages
Doc_SetPage
Doc_SetPage
Set page to have texture as a background with scale.
Parameters
- var int docID- document manager ID
- var int page- page index, if set to- -1, settings are applied to all pages
- var string texture- texture of the background
- var int scale- scale of the texture,- TRUEto scale the page,- FALSEto not scale
Doc_SetMargins
Doc_SetMargins
Sets text margins of the page
Parameters
- var int docID- document manager ID
- var int page- page index, if set to- -1, settings are applied to all pages
- var int left- left margin
- var int top- top margin
- var int right- right margin
- var int bottom- bottom margin
- var int pixels-- TRUEto use pixels,- FALSEto use virtual coordinates
Warning
After a thorough examination of this external function in the decompiler, it looks like the function works in pixels only regardless of this parameter.
Example
Doc_PrintLine
Doc_PrintLine
Prints a line of text (font is set using Doc_SetFont) onto the document with docID, onto the page. Does not split the text into multiple lines if they do not fit onto the page.
Parameters
- var int docID- document manager ID
- var int page- page index
- var string text- text to be printed
Doc_PrintLines
Doc_PrintLines
Prints a line of text (font is set using Doc_SetFont) onto the document with docID, onto the page. Splits the text into multiple lines if they do not fit onto the page.
Parameters
- var int docID- document manager ID
- var int page- page index
- var string text- text to be printed
Example
Doc_Show
Doc_Show
Display the document using the document manager ID
Parameters
- var int docID- document manager ID
Deprecated
Doc_Open
Doc_Open
Doc_Font
Doc_Font
Doc_Print
Doc_Print