Prechádzať zdrojové kódy

Update documentation.

aster2013 12 rokov pred
rodič
commit
e46a159ce0
2 zmenil súbory, kde vykonal 35 pridanie a 39 odobranie
  1. 33 33
      Docs/LuaScriptAPI.dox
  2. 2 6
      Docs/Reference.dox

+ 33 - 33
Docs/LuaScriptAPI.dox

@@ -44,7 +44,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Sound(Context* context)
+- Sound()
 - ~Sound()
 - ~Sound()
 - bool LoadRaw(Deserializer& source)
 - bool LoadRaw(Deserializer& source)
 - bool LoadWav(Deserializer& source)
 - bool LoadWav(Deserializer& source)
@@ -1055,7 +1055,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Material(Context* context)
+- Material()
 - ~Material()
 - ~Material()
 - void SetNumTechniques(unsigned num)
 - void SetNumTechniques(unsigned num)
 - void SetTechnique(unsigned index, Technique* tech, unsigned qualityLevel = 0, float lodDistance = 0.0f)
 - void SetTechnique(unsigned index, Technique* tech, unsigned qualityLevel = 0, float lodDistance = 0.0f)
@@ -1710,7 +1710,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Texture2D(Context* context)
+- Texture2D()
 - ~Texture2D()
 - ~Texture2D()
 - bool SetSize(int width, int height, unsigned format, TextureUsage usage = TEXTURE_STATIC)
 - bool SetSize(int width, int height, unsigned format, TextureUsage usage = TEXTURE_STATIC)
 - RenderSurface* GetRenderSurface() const
 - RenderSurface* GetRenderSurface() const
@@ -1729,9 +1729,9 @@ Methods:
 
 
 Methods:
 Methods:
 
 
-- Viewport(Context* context)
-- Viewport(Context* context, Scene* scene, Camera* camera, RenderPath* renderPath = 0)
-- Viewport(Context* context, Scene* scene, Camera* camera, const IntRect& rect, RenderPath* renderPath = 0)
+- Viewport()
+- Viewport(Scene* scene, Camera* camera, RenderPath* renderPath = 0)
+- Viewport(Scene* scene, Camera* camera, const IntRect& rect, RenderPath* renderPath = 0)
 - ~Viewport()
 - ~Viewport()
 - void SetScene(Scene* scene)
 - void SetScene(Scene* scene)
 - void SetCamera(Camera* camera)
 - void SetCamera(Camera* camera)
@@ -1845,9 +1845,9 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- File(Context* context)
-- File(Context* context, const String fileName, FileMode mode = FILE_READ)
-- File(Context* context, PackageFile* package, const String fileName)
+- File()
+- File(const String fileName, FileMode mode = FILE_READ)
+- File(PackageFile* package, const String fileName)
 - ~File()
 - ~File()
 - bool Open(const String fileName, FileMode mode = FILE_READ)
 - bool Open(const String fileName, FileMode mode = FILE_READ)
 - bool Open(PackageFile* package, const String fileName)
 - bool Open(PackageFile* package, const String fileName)
@@ -2013,8 +2013,8 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- PackageFile(Context* context)
-- PackageFile(Context* context, const String fileName, unsigned startOffset = 0)
+- PackageFile()
+- PackageFile(const String fileName, unsigned startOffset = 0)
 - ~PackageFile()
 - ~PackageFile()
 - bool Open(const String fileName, unsigned startOffset = 0)
 - bool Open(const String fileName, unsigned startOffset = 0)
 - bool Exists(const String fileName) const
 - bool Exists(const String fileName) const
@@ -3670,7 +3670,7 @@ Methods:
 
 
 Methods:
 Methods:
 
 
-- Node(Context* context)
+- Node()
 - virtual ~Node()
 - virtual ~Node()
 - bool SaveXML(File* dest) const
 - bool SaveXML(File* dest) const
 - void SetName(const String name)
 - void SetName(const String name)
@@ -3827,7 +3827,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Scene(Context* context)
+- Scene()
 - virtual ~Scene()
 - virtual ~Scene()
 - bool Load(File* source)
 - bool Load(File* source)
 - bool Save(File* dest) const
 - bool Save(File* dest) const
@@ -3920,7 +3920,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- UIElement(Context* context)
+- UIElement()
 - virtual ~UIElement()
 - virtual ~UIElement()
 - virtual const IntVector2& GetScreenPosition() const
 - virtual const IntVector2& GetScreenPosition() const
 - bool LoadXML(Deserializer& source)
 - bool LoadXML(Deserializer& source)
@@ -4120,7 +4120,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- BorderImage(Context* context)
+- BorderImage()
 - virtual ~BorderImage()
 - virtual ~BorderImage()
 - void SetTexture(Texture* texture)
 - void SetTexture(Texture* texture)
 - void SetImageRect(const IntRect& rect)
 - void SetImageRect(const IntRect& rect)
@@ -4153,7 +4153,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Button(Context* context)
+- Button()
 - virtual ~Button()
 - virtual ~Button()
 - void SetPressedOffset(const IntVector2& offset)
 - void SetPressedOffset(const IntVector2& offset)
 - void SetPressedOffset(int x, int y)
 - void SetPressedOffset(int x, int y)
@@ -4180,7 +4180,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- CheckBox(Context* context)
+- CheckBox()
 - virtual ~CheckBox()
 - virtual ~CheckBox()
 - void SetChecked(bool enable)
 - void SetChecked(bool enable)
 - void SetCheckedOffset(const IntVector2& rect)
 - void SetCheckedOffset(const IntVector2& rect)
@@ -4197,7 +4197,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Cursor(Context* context)
+- Cursor()
 - virtual ~Cursor()
 - virtual ~Cursor()
 - void DefineShape(CursorShape shape, Image* image, const IntRect& imageRect, const IntVector2& hotSpot)
 - void DefineShape(CursorShape shape, Image* image, const IntRect& imageRect, const IntVector2& hotSpot)
 - void SetShape(CursorShape shape)
 - void SetShape(CursorShape shape)
@@ -4224,7 +4224,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- FileSelector(Context* context)
+- FileSelector()
 - virtual ~FileSelector()
 - virtual ~FileSelector()
 - void SetDefaultStyle(XMLFile* style)
 - void SetDefaultStyle(XMLFile* style)
 - void SetTitle(const String text)
 - void SetTitle(const String text)
@@ -4279,7 +4279,7 @@ Methods:
 
 
 Methods:
 Methods:
 
 
-- LineEdit(Context* context)
+- LineEdit()
 - virtual ~LineEdit()
 - virtual ~LineEdit()
 - void SetText(const String text)
 - void SetText(const String text)
 - void SetCursorPosition(unsigned position)
 - void SetCursorPosition(unsigned position)
@@ -4317,7 +4317,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Menu(Context* context)
+- Menu()
 - virtual ~Menu()
 - virtual ~Menu()
 - void SetPopup(UIElement* element)
 - void SetPopup(UIElement* element)
 - void SetPopupOffset(const IntVector2& offset)
 - void SetPopupOffset(const IntVector2& offset)
@@ -4342,7 +4342,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- MessageBox(Context* context, const String& messageString = String::EMPTY, const String& titleString = String::EMPTY, XMLFile* layoutFile = 0, XMLFile* styleFile = 0)
+- MessageBox(const String& messageString = String::EMPTY, const String& titleString = String::EMPTY, XMLFile* layoutFile = 0, XMLFile* styleFile = 0)
 - virtual ~MessageBox()
 - virtual ~MessageBox()
 - void SetTitle(const String& text)
 - void SetTitle(const String& text)
 - void SetMessage(const String& text)
 - void SetMessage(const String& text)
@@ -4360,7 +4360,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- DropDownList(Context* context)
+- DropDownList()
 - ~DropDownList()
 - ~DropDownList()
 - void AddItem(UIElement* item)
 - void AddItem(UIElement* item)
 - void InsertItem(unsigned index, UIElement* item)
 - void InsertItem(unsigned index, UIElement* item)
@@ -4395,7 +4395,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Slider(Context* context)
+- Slider()
 - virtual ~Slider()
 - virtual ~Slider()
 - void SetOrientation(Orientation orientation)
 - void SetOrientation(Orientation orientation)
 - void SetRange(float range)
 - void SetRange(float range)
@@ -4420,7 +4420,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- ScrollBar(Context* context)
+- ScrollBar()
 - virtual ~ScrollBar()
 - virtual ~ScrollBar()
 - void SetOrientation(Orientation orientation)
 - void SetOrientation(Orientation orientation)
 - void SetRange(float range)
 - void SetRange(float range)
@@ -4456,7 +4456,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- ScrollView(Context* context)
+- ScrollView()
 - virtual ~ScrollView()
 - virtual ~ScrollView()
 - void SetContentElement(UIElement* element)
 - void SetContentElement(UIElement* element)
 - void SetViewPosition(const IntVector2& position)
 - void SetViewPosition(const IntVector2& position)
@@ -4490,7 +4490,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- ListView(Context* context)
+- ListView()
 - virtual ~ListView()
 - virtual ~ListView()
 - void AddItem(UIElement* item)
 - void AddItem(UIElement* item)
 - void InsertItem(unsigned index, UIElement* item, UIElement* parentItem = 0)
 - void InsertItem(unsigned index, UIElement* item, UIElement* parentItem = 0)
@@ -4542,7 +4542,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Sprite(Context* context)
+- Sprite()
 - virtual ~Sprite()
 - virtual ~Sprite()
 - void SetPosition(const Vector2& position)
 - void SetPosition(const Vector2& position)
 - void SetPosition(float x, float y)
 - void SetPosition(float x, float y)
@@ -4583,7 +4583,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Text(Context* context)
+- Text()
 - virtual ~Text()
 - virtual ~Text()
 - bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE)
@@ -4641,7 +4641,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Text3D(Context* context)
+- Text3D()
 - ~Text3D()
 - ~Text3D()
 - bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(const String fontName, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE)
 - bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE)
@@ -4714,7 +4714,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- ToolTip(Context* context)
+- ToolTip()
 - virtual ~ToolTip()
 - virtual ~ToolTip()
 - void SetDelay(float delay)
 - void SetDelay(float delay)
 - float GetDelay() const
 - float GetDelay() const
@@ -4795,7 +4795,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- Window(Context* context)
+- Window()
 - virtual ~Window()
 - virtual ~Window()
 - void SetMovable(bool enable)
 - void SetMovable(bool enable)
 - void SetResizable(bool enable)
 - void SetResizable(bool enable)
@@ -4832,7 +4832,7 @@ Properties:
 
 
 Methods:
 Methods:
 
 
-- View3D(Context* context)
+- View3D()
 - ~View3D()
 - ~View3D()
 - void SetView(Scene* scene, Camera* camera)
 - void SetView(Scene* scene, Camera* camera)
 - void SetFormat(unsigned format)
 - void SetFormat(unsigned format)

+ 2 - 6
Docs/Reference.dox

@@ -621,8 +621,6 @@ end
 
 
 The binding of Urho3D C++ classes is accomplished with the tolua++ library, which for the most part binds the exact same function parameters as C++. Compared to the AngelScript API, you will always have the classes' Get / Set functions available, but in addition convenience properties also exist.
 The binding of Urho3D C++ classes is accomplished with the tolua++ library, which for the most part binds the exact same function parameters as C++. Compared to the AngelScript API, you will always have the classes' Get / Set functions available, but in addition convenience properties also exist.
 
 
-When constructing Object subclasses, you need to supply the Context pointer as the first parameter. Use the global function GetContext() to get it. Similarly, use eg. GetFileSystem() or GetInput() to access the subsystems.
-
 As seen above from the event handling examples, VariantMap handling has some differences to both C++ and AngelScript. To get a value, supply its key name as a string. To get a pointer to an object, supply first the object type, then the key name.
 As seen above from the event handling examples, VariantMap handling has some differences to both C++ and AngelScript. To get a value, supply its key name as a string. To get a pointer to an object, supply first the object type, then the key name.
 
 
 For the rest of the functions and classes, see the generated \ref LuaScriptAPI "Lua script API reference". Also, look at the Lua counterparts of the sample applications in the Bin/Data/LuaScripts directory and compare them to the C++ and AngelScript versions to familiarize yourself with how things are done on the Lua side.
 For the rest of the functions and classes, see the generated \ref LuaScriptAPI "Lua script API reference". Also, look at the Lua counterparts of the sample applications in the Bin/Data/LuaScripts directory and compare them to the C++ and AngelScript versions to familiarize yourself with how things are done on the Lua side.
@@ -633,8 +631,7 @@ There are two ways to allocate a C++ object in Lua scripting, which behave diffe
 
 
 1) Call object's contructor:
 1) Call object's contructor:
 \code
 \code
-local context = GetContext()
-local scene = Scene(context)
+local scene = Scene()
 \endcode
 \endcode
 tolua++ will register this C++ object with garbage collection, and Lua will collect it eventually. Do not use this form if you will add the
 tolua++ will register this C++ object with garbage collection, and Lua will collect it eventually. Do not use this form if you will add the
 object to an object hierarchy that is kept alive on the C++ side with SharedPtr's, for example child scene nodes or %UI child elements.
 object to an object hierarchy that is kept alive on the C++ side with SharedPtr's, for example child scene nodes or %UI child elements.
@@ -643,8 +640,7 @@ Otherwise the object will be double-deleted, resulting in a crash.
 
 
 2) Call the new function:
 2) Call the new function:
 \code
 \code
-local context = GetContext()
-local text = Text:new(context)
+local text = Text:new()
 \endcode
 \endcode
 When using this form the object will not collected by Lua, so it is safe to pass into C++ object hierarchies.
 When using this form the object will not collected by Lua, so it is safe to pass into C++ object hierarchies.
 Otherwise, to prevent memory leaks it needs to be deleted manually by calling the delete function on it:
 Otherwise, to prevent memory leaks it needs to be deleted manually by calling the delete function on it: