Skip to content

Commit f3b65ab

Browse files
Updated docs again. DEF-616
1 parent 3aa01ac commit f3b65ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+461
-151
lines changed

com.dynamo.cr/com.dynamo.cr.web2/site/site.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
render('plans.html', 'plans/index.html', active_page = 'plans')
3535
render('signup.html', 'signup/index.html')
3636

37-
docs = ['application_lifecycle.html',
37+
docs = ['2dgraphics.html',
38+
'application_lifecycle.html',
3839
'collection_proxies.html',
3940
'example.html',
4041
'game_project.html',

com.dynamo.cr/com.dynamo.cr.web2/templates/doc_index.html

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,22 @@ <h1>Documentation</h1>
1313
<h2>Guides</h2>
1414
<p>Detailed explanations of different areas of the platform</p>
1515
<ul class="unstyled">
16-
<li><b>New Guides</b></li>
17-
<li><a href="/doc/application_lifecycle">Application Lifecycle</a></li>
18-
<li><a href="/doc/collection_proxies">Collection Proxies</a></li>
19-
<li><a href="/doc/gui">GUI</a></li>
20-
<li><a href="/doc/message_passing">Message Passing</a></li>
21-
<li><a href="/doc/modules">Modules</a></li>
22-
<li><a href="/doc/physics">Physics</a></li>
23-
<li><a href="/doc/input">Input</a></li>
24-
<li><a href="/doc/overview">Overview</a></li>
25-
<li><a href="/doc/scripting">Scripting</a></li>
26-
27-
<br>
28-
29-
30-
<li><a href="/doc/introduction">Introduction</a></li>
16+
<li><a href="/doc/introduction">Introduction</a> (New)</li>
3117
<li><a href="/doc/scene_editing">Scene Editing</a></li>
32-
<li><a href="/doc/tiles">2D Graphics</a></li>
33-
<li><a href="/doc/scripting_debugging">Scripting &amp; Debugging</a></li>
34-
<li><a href="/doc/message_passing">Message Passing</a></li>
18+
<li><a href="/doc/2dgraphics">2D Graphics</a> (New)</li>
19+
<li><a href="/doc/scripting">Scripting</a> (New)</li>
20+
<li><a href="/doc/message_passing">Message Passing</a> (New)</li>
21+
<li><a href="/doc/input">Input</a> (New)</li>
22+
<li><a href="/doc/gui">GUI</a> (New)</li>
23+
<li><a href="/doc/physics">Physics</a> (New)</li>
24+
<li><a href="/doc/collection_proxies">Collection Proxies</a> (New)</li>
3525
<li><a href="/doc/properties">Properties</a></li>
3626
<li><a href="/doc/script_properties">Script Properties</a></li>
37-
<li><a href="/doc/input">Input</a></li>
38-
<li><a href="/doc/reload">Hot Reloading</a></li>
39-
<li><a href="/doc/physics">Physics</a></li>
4027
<li><a href="/doc/game_project">Project Settings</a></li>
4128
<li><a href="/doc/ios">iOS Development</a></li>
4229
<li><a href="/doc/particlefx">ParticleFX</a></li>
30+
<li><a href="/doc/modules">Modules</a> (New)</li>
31+
<li><a href="/doc/application_lifecycle">Application Lifecycle</a> (New)</li>
4332
</ul>
4433
</div>
4534
</div>

com.dynamo.cr/com.dynamo.cr.web2/war/index_map.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
/index.html
7575
/plans/index.html
7676
/signup/index.html
77+
/doc/2dgraphics.html
7778
/doc/application_lifecycle.html
7879
/doc/collection_proxies.html
7980
/doc/example.html

engine/docs/src/guides/2dgraphics.txt

Lines changed: 264 additions & 0 deletions
Large diffs are not rendered by default.

engine/docs/src/guides/application_lifecycle.txt

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ The application then enters the update loop where the application will spend a m
1313

1414
At some point the applications lifecycle will come to an end. Before the application quits the engine steps out of the update loop and enters a finalization stage. It prepares all loaded game objects for deletion. All object components’ +link:/ref/go#final[final()]+ functions are called, which allows for custom cleanup. Then the objects are deleted and the main collection is unloaded.
1515

16-
Initialization
17-
--------------
16+
== Initialization
1817

1918
image::images/application_lifecycle/application_lifecycle_init.png["Lifecycle overview", align="center"]
2019

@@ -59,22 +58,19 @@ function on_message(self, message_id, message, sender)
5958
end
6059
----
6160

62-
The update loop
63-
---------------
61+
== The update loop
6462

6563
The update loop runs through a long sequence once every frame. The update sequence in the diagram below are divided into logical sequence blocks for clarity. "Dispatch messages" is also broken out separately for the same reason:
6664

6765
image::images/application_lifecycle/application_lifecycle_update.png["Update loop", align="center"]
6866

69-
Input
70-
-----
67+
=== Input
7168

7269
Input is is read from available devices, mapped against link:/doc/input[input bindings] and then dispatched. Any game object that has acquired input focus gets input sent to all its component +on_input()+ functions. A game object with a script component and a GUI component with a GUI script will get input to both components’ +on_input()+ functions--given that they are defined and that they have acquired input focus.
7370

7471
Any game object that has acquired input focus and that contain collection proxy components dispatches input further to components in the proxy collection belonging to game objects that has acquired input focus. This process continues recursively down enabled collection proxies within enabled collection proxies.
7572

76-
Update
77-
------
73+
=== Update
7874

7975
Each game object component in the main collection is traversed. If any of these component has a script +update(),+ then it will be called. If the component is a collection proxy, each component in the proxy collection is recursively updated with all the steps in the "update" sequence in the diagram above.
8076

@@ -89,29 +85,25 @@ Child transforms are then done, applying any game object movement, rotation and
8985

9086
In the next step all posted messages are dispatched. Since any receiver component’s +on_message()+ code can post additional messages the message dispatcher will continue to dispatch posted messaged until the message queue is empty. There is, however, a limit to how many runs through the message queue the message dispatcher performs. See link:/doc/message_passing[Message passing] and the section "Advanced topics" for details.
9187

92-
Render update
93-
-------------
88+
=== Render update
9489

9590
The render update block dispatches messages to the @render socket (camera component "set_view_projection" messages, "set_clear_color" messages etc). The render script +update()+ is then called.
9691

97-
Post update
98-
-----------
92+
=== Post update
9993

10094
After the updates, a post update sequence is run. It unloads from memory collection proxies that are marked for unloading (this happens during the "dispatch messages" sequence). Any game object that is marked for deletion will call all of its components’ +final()+ functions called—if there are any. The code in +final()+ functions often posts new messages to the queue so a "dispatch messages" pass is run afterwards.
10195

10296
Any factory components that has been told to spawn a game object will do that next. Finally, game objects that are marked for deletion are actually deleted.
10397

10498
The last steps in the update loop involves dispatching @system messages ("exit", "reboot" messages, toggling the profiler, starting and stopping video capture etc). Then graphics is rendered. During the graphics rendering, video capture is done, as is any rendering of the visual profiler (see the link:/doc/scripting[Scripting documentation].)
10599

106-
Frame rate and collection time step
107-
-----------------------------------
100+
=== Frame rate and collection time step
108101

109102
The number of frame updates per seconds (which equals the number of update-loop runs per second) can be set in the project settings, or programmatically by sending an "set_update_frequency" message to the +@system+ socket. In addition, it is possible to set the _time step_ for collection proxies individually by sending a "set_time_step" message to the proxy. Changing a collection's time step does not affect the frame rate. It has an effect on the physics update time step as well as the "dt" variable passed to +update().+ Also note that altering the time step does not alter the number of times +update()+ will be called each frame--it is always exactly once.
110103

111104
(See link:/doc/collection_proxies[Collection proxies] and link:ref/collection_proxy#set_time_step[set_time_step] for details)
112105

113-
Finalization
114-
------------
106+
== Finalization
115107

116108
At the point when the application exits, it finishes the last update loop sequence, which will unload any collection proxies: finalizing and deleting all game objects in the proxy collection.
117109

engine/docs/src/guides/collection_proxies.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ Now back to our platformer example where the only thing we need to do is to send
252252
...
253253
msg.post(currentsocket .. ":" .. "/player#script", "request_player")
254254

255-
256255
-- Now it's time to ditch the world we left behind.
257256
-- Normally you wouldn't do this on-screen but we're doing just that
258257
-- to make the whole process clearer and clearly visible.

engine/docs/src/guides/gui.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ A graphical user interface in Defold is a game object component that you build a
1313
[NOTE]
1414
====
1515
The rendering behavior can be changed in the render script but it is usually desirable to have it that way since the user interface is a separate visual "layer" on top of the game view and you usually want HUD items and menus on certain spots on screen.
16-
1716
====
1817

1918
Because the GUI is not part of the collection’s coordinate system but is rendered independently of the game view it is not placed in a particular location in the collection editor and it has no visual representation in the collection editor. However, the GUI component have to reside in a game object that has a location in the collection. Changing that location has no effect on the GUI.
@@ -101,6 +100,7 @@ In this example the orange box node "box2" is part of layer "front" which is dra
101100
Both "box1" and "box3" are set to layer "back". The drawing order within a layer is determined by the node’s index, it’s place in the node list. "box1" comes before "box3" and is thus drawn first, behind "box3".
102101

103102
=== Batch rendering
103+
104104
In order to render your gui as efficiently as possible, there are steps that you can take that will permit the engine to organise drawing of your gui nodes in batches, reducing the overall number of drawcalls that the engine must create. If groups of nodes meet the following conditions, then they may be handled within a single batch:
105105

106106
. If they are all box nodes, they use the same texture.
@@ -221,7 +221,7 @@ Text nodes behave in exactly the same way. The adjust mode applies to the invisi
221221

222222
Anchors control the behavior of a node’s position when the window is resized. New nodes are created _non anchored_ meaning that they are positioned relative to the center of the screen.
223223

224-
==== Node repositioning without anchors
224+
=== Node repositioning without anchors
225225

226226
The default behavior of a created node is the following
227227

@@ -236,7 +236,7 @@ Similarly, if the window is shrunk and gets relatively narrower, the added heigh
236236

237237
image::images/gui/gui_no_anchor_sizedown.png["No anchor size down", align="center"]
238238

239-
==== Node repositioning with anchors
239+
=== Node repositioning with anchors
240240

241241
By setting the Xanchor and/or the Yanchor properties you can lock the position of nodes relative to the edges of the window.
242242

@@ -249,7 +249,7 @@ In practice this means that if you set the Xanchor property to "Right" and the Y
249249

250250
image::images/gui/gui_anchor_topright.png["Anchor top right", align="center"]
251251

252-
==== Pivot
252+
=== Pivot
253253

254254
Each node has a position, scale and rotation inside the GUI coordinate system. A node is placed on that position so that its pivot is at the set coordinate and any rotation is done around that same pivot.
255255

0 commit comments

Comments
 (0)