Skip to content

Commit 2a64ff6

Browse files
committed
redacting
1 parent 6f250c4 commit 2a64ff6

11 files changed

Lines changed: 278 additions & 276 deletions

File tree

docs/pl/manuals/compute.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Aby użyć programu compute, trzeba go najpierw powiązać z kontekstem renderow
8080

8181
```lua
8282
render.set_compute("my_compute")
83-
-- Do compute work here, call render.set_compute() to unbind
83+
-- Tutaj wykonuj obliczenia compute; wywołaj render.set_compute(), aby odwiązać program
8484
render.set_compute()
8585
```
8686

@@ -95,8 +95,8 @@ Aby uruchomić program w ustalonej przez siebie przestrzeni roboczej, musisz go
9595

9696
```lua
9797
render.dispatch_compute(128, 128, 1)
98-
-- dispatch_compute also accepts an options table as the last argument
99-
-- you can use this argument table to pass in render constants to the dispatch call
98+
-- dispatch_compute przyjmuje też tabelę opcji jako ostatni argument
99+
-- tej tabeli możesz użyć do przekazania stałych renderowania do wywołania dispatch
100100
local constants = render.constant_buffer()
101101
constants.tint = vmath.vector4(1, 1, 1, 1)
102102
render.dispatch_compute(32, 32, 32, {constants = constants})
@@ -109,10 +109,10 @@ Obecnie generowanie dowolnego rodzaju danych wyjściowych z programu compute jes
109109
Aby utworzyć teksturę storage w Defold, musisz zrobić to ze zwykłego pliku `.script`. Skrypty do renderowania nie mają tej funkcjonalności, ponieważ tekstury dynamiczne trzeba tworzyć przez API zasobów, które jest dostępne tylko w zwykłych plikach `.script`.
110110

111111
```lua
112-
-- In a .script file:
112+
-- W pliku .script:
113113
function init(self)
114-
-- Create a texture resource like usual, but add the "storage" flag
115-
-- so it can be used as the backing storage for compute programs
114+
-- Utwórz zasób tekstury jak zwykle, ale dodaj flagę "storage",
115+
-- aby można go było użyć jako tekstury bazowej dla programów compute
116116
local t_backing = resource.create_texture("/my_backing_texture.texturec", {
117117
type = resource.TEXTURE_TYPE_IMAGE_2D,
118118
width = 128,
@@ -121,10 +121,10 @@ function init(self)
121121
flags = resource.TEXTURE_USAGE_FLAG_STORAGE + resource.TEXTURE_USAGE_FLAG_SAMPLE,
122122
})
123123

124-
-- get the texture handle from the resource
124+
-- pobierz uchwyt tekstury z zasobu
125125
local t_backing_handle = resource.get_texture_info(t_backing).handle
126126

127-
-- notify the renderer of the backing texture, so it can be bound with render.enable_texture
127+
-- powiadom renderer o teksturze bazowej, aby można było ją powiązać przez render.enable_texture
128128
msg.post("@render:", "set_backing_texture", { handle = t_backing_handle })
129129
end
130130
```
@@ -134,46 +134,46 @@ end
134134
### Program shadera
135135

136136
```glsl
137-
// compute.cp
137+
// plik: compute.cp
138138
#version 450
139139
140140
layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
141141
142-
// specify the input resources
142+
// określ zasoby wejściowe
143143
uniform vec4 color;
144144
uniform sampler2D texture_in;
145145
146-
// specify the output image
146+
// określ obraz wyjściowy
147147
layout(rgba32f) uniform image2D texture_out;
148148
149149
void main()
150150
{
151-
// This isn't a particularly interesting shader, but it demonstrates
152-
// how to read from a texture and constant buffer and write to a storage texture
151+
// To nie jest szczególnie ciekawy shader, ale pokazuje,
152+
// jak czytać z tekstury i bufora stałych oraz zapisywać do tekstury storage
153153
154154
ivec2 tex_coord = ivec2(gl_GlobalInvocationID.xy);
155155
vec4 output_value = vec4(0.0, 0.0, 0.0, 1.0);
156156
vec2 tex_coord_uv = vec2(float(tex_coord.x)/(gl_NumWorkGroups.x), float(tex_coord.y)/(gl_NumWorkGroups.y));
157157
vec4 input_value = texture(texture_in, tex_coord_uv);
158158
output_value.rgb = input_value.rgb * color.rgb;
159159
160-
// Write the output value to the storage texture
160+
// Zapisz wartość wyjściową do tekstury storage
161161
imageStore(texture_out, tex_coord, output_value);
162162
}
163163
```
164164

165165
### Komponent skryptu
166166
```lua
167-
-- In a .script file
167+
-- W pliku .script:
168168

169-
-- Here we specify the input texture that we later will bind to the
170-
-- compute program. We can assign this texture to a model component,
171-
-- or enable it to the render context in the render script.
169+
-- Tutaj określamy teksturę wejściową, którą później powiążemy
170+
-- z programem compute. Możemy przypisać tę teksturę do komponentu modelu
171+
-- albo włączyć ją w kontekście renderowania w skrypcie renderowania.
172172
go.property("texture_in", resource.texture())
173173

174174
function init(self)
175-
-- Create a texture resource like usual, but add the "storage" flag
176-
-- so it can be used as the backing storage for compute programs
175+
-- Utwórz zasób tekstury jak zwykle, ale dodaj flagę "storage",
176+
-- aby można go było użyć jako tekstury bazowej dla programów compute
177177
local t_backing = resource.create_texture("/my_backing_texture.texturec", {
178178
type = resource.TEXTURE_TYPE_IMAGE_2D,
179179
width = 128,
@@ -187,15 +187,15 @@ function init(self)
187187
texture_out = resource.get_texture_info(t_backing).handle
188188
}
189189

190-
-- notify the renderer of the input and output textures
190+
-- powiadom renderer o teksturach wejściowej i wyjściowej
191191
msg.post("@render:", "set_backing_texture", textures)
192192
end
193193
```
194194

195195
### Skrypt do renderowania
196196
```lua
197-
-- respond to the message "set_backing_texture"
198-
-- to set the backing texture for the compute program
197+
-- reaguj na wiadomość "set_backing_texture",
198+
-- aby ustawić teksturę bazową dla programu compute
199199
function on_message(self, message_id, message)
200200
if message_id == hash("set_backing_texture") then
201201
self.texture_in = message.texture_in
@@ -205,15 +205,15 @@ end
205205

206206
function update(self)
207207
render.set_compute("compute")
208-
-- We can bind textures to specific named constants
208+
-- Możemy powiązać tekstury z konkretnymi nazwanymi stałymi
209209
render.enable_texture(self.texture_in, "texture_in")
210210
render.enable_texture(self.texture_out, "texture_out")
211211
render.set_constant("color", vmath.vector4(0.5, 0.5, 0.5, 1.0))
212-
-- Dispatch the compute program as many times as we have pixels.
213-
-- This constitutes our "working group". The shader will be invoked
212+
-- Uruchom program compute tyle razy, ile mamy pikseli.
213+
-- To stanowi naszą "grupę roboczą". Shader zostanie wywołany
214214
-- 128 x 128 x 1 times, or once per pixel.
215215
render.dispatch_compute(128, 128, 1)
216-
-- when we are done with the compute program, we need to unbind it
216+
-- gdy skończymy pracę z programem compute, musimy go odwiązać
217217
render.set_compute()
218218
end
219219
```

docs/pl/manuals/editor-scripts-ui.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -137,31 +137,31 @@ Jeśli tworzysz statyczne UI, wystarczy zdefiniować callbacki, które po prostu
137137

138138
Na przykład można tak utworzyć proste, statyczne okno dialogowe tworzenia nowego pliku:
139139
```lua
140-
-- initial file name, will be replaced by the dialog
140+
-- początkowa nazwa pliku, zostanie zastąpiona przez dialog
141141
local file_name = ""
142142
local create_file = editor.ui.show_dialog(editor.ui.dialog({
143-
title = "Create New File",
143+
title = "Utwórz nowy plik",
144144
content = editor.ui.horizontal({
145145
padding = editor.ui.PADDING.LARGE,
146146
spacing = editor.ui.SPACING.MEDIUM,
147147
children = {
148148
editor.ui.label({
149-
text = "New File Name",
149+
text = "Nazwa nowego pliku",
150150
alignment = editor.ui.ALIGNMENT.CENTER
151151
}),
152152
editor.ui.string_field({
153153
grow = true,
154154
text = file_name,
155-
-- Typing callback:
155+
-- Callback wywoływany podczas wpisywania:
156156
on_value_changed = function(new_text)
157157
file_name = new_text
158158
end
159159
})
160160
}
161161
}),
162162
buttons = {
163-
editor.ui.dialog_button({ text = "Cancel", cancel = true, result = false }),
164-
editor.ui.dialog_button({ text = "Create File", default = true, result = true })
163+
editor.ui.dialog_button({ text = "Anuluj", cancel = true, result = false }),
164+
editor.ui.dialog_button({ text = "Utwórz plik", default = true, result = true })
165165
}
166166
}))
167167
if create_file then
@@ -178,7 +178,7 @@ Oto lista wbudowanych komponentów wejściowych:
178178

179179
Wszystkie komponenty poza przyciskami pozwalają ustawić pole `issue`, które wyświetla problem powiązany z komponentem (albo `editor.ui.ISSUE_SEVERITY.ERROR`, albo `editor.ui.ISSUE_SEVERITY.WARNING`), na przykład:
180180
```lua
181-
issue = {severity = editor.ui.ISSUE_SEVERITY.WARNING, message = "This value is deprecated"}
181+
issue = {severity = editor.ui.ISSUE_SEVERITY.WARNING, message = "Ta wartość jest przestarzała"}
182182
```
183183
Gdy `issue` jest określone, zmienia wygląd komponentu wejściowego i dodaje podpowiedź z komunikatem problemu.
184184

@@ -213,9 +213,9 @@ Aby utworzyć komponent reaktywny, użyj funkcji `editor.ui.component()`.
213213
Spójrzmy na przykład: okno dialogowe tworzenia nowego pliku, które pozwala utworzyć plik tylko wtedy, gdy wpisana nazwa pliku nie jest pusta:
214214

215215
```lua
216-
-- 1. dialog is a reactive component
216+
-- 1. dialog jest komponentem reaktywnym
217217
local dialog = editor.ui.component(function(props)
218-
-- 2. the component defines a local state (file name) that defaults to empty string
218+
-- 2. komponent definiuje stan lokalny (nazwę pliku), który domyślnie jest pustym łańcuchem
219219
local name, set_name = editor.ui.use_state("")
220220

221221
return editor.ui.dialog({
@@ -225,30 +225,30 @@ local dialog = editor.ui.component(function(props)
225225
children = {
226226
editor.ui.string_field({
227227
value = name,
228-
-- 3. typing + Enter updates the local state
228+
-- 3. wpisywanie + Enter aktualizują stan lokalny
229229
on_value_changed = set_name
230230
})
231231
}
232232
}),
233233
buttons = {
234234
editor.ui.dialog_button({
235-
text = "Cancel",
235+
text = "Anuluj",
236236
cancel = true
237237
}),
238238
editor.ui.dialog_button({
239-
text = "Create File",
240-
-- 4. creation is enabled when the name exists
239+
text = "Utwórz plik",
240+
-- 4. tworzenie jest aktywne, gdy nazwa nie jest pusta
241241
enabled = name ~= "",
242242
default = true,
243-
-- 5. result is the name
243+
-- 5. wynikiem jest nazwa
244244
result = name
245245
})
246246
}
247247
})
248248
end)
249249

250-
-- 6. show_dialog will either return non-empty file name or nil on cancel
251-
local file_name = editor.ui.show_dialog(dialog({ title = "New File Name" }))
250+
-- 6. show_dialog zwróci albo niepustą nazwę pliku, albo nil po anulowaniu
251+
local file_name = editor.ui.show_dialog(dialog({ title = "Nazwa nowego pliku" }))
252252
if file_name then
253253
print("create " .. file_name)
254254
else
@@ -285,14 +285,14 @@ Edytor definiuje 2 haki: **`use_memo`** i **`use_state`**.
285285

286286
Stan lokalny można utworzyć na 2 sposoby: z wartością domyślną albo z funkcją inicjalizującą:
287287
```lua
288-
-- default value
288+
-- wartość domyślna
289289
local enabled, set_enabled = editor.ui.use_state(true)
290-
-- initializer function + args
290+
-- funkcja inicjalizująca + argumenty
291291
local id, set_id = editor.ui.use_state(string.lower, props.name)
292292
```
293293
Podobnie setter można wywołać z nową wartością albo funkcją aktualizującą:
294294
```lua
295-
-- updater function
295+
-- funkcja aktualizująca
296296
local function increment_by(n, by)
297297
return n + by
298298
end
@@ -323,44 +323,44 @@ end)
323323

324324
Na koniec: stan może zostać **zresetowany**. Dochodzi do tego, gdy zmieni się którykolwiek z argumentów przekazywanych do `editor.ui.use_state()`, sprawdzanych przez `==`. Z tego powodu nie wolno używać literałów tabel ani literałowych funkcji inicjalizujących jako argumentów haka `use_state`, bo spowoduje to reset stanu przy każdym ponownym renderowaniu. Dla zobrazowania:
325325
```lua
326-
--BAD: literal table initializer causes state reset on every re-render
326+
--ŹLE: literał tabeli w inicjalizatorze powoduje reset stanu przy każdym ponownym renderowaniu
327327
local user, set_user = editor.ui.use_state({ first_name = props.first_name, last_name = props.last_name})
328328

329-
--GOOD: use initializer function outside of component function to create table state
329+
--DOBRZE: użyj funkcji inicjalizującej poza funkcją komponentu, aby utworzyć stan tabeli
330330
local function create_user(first_name, last_name)
331331
return { first_name = first_name, last_name = last_name}
332332
end
333-
-- ...later, in component function:
333+
-- ...później, wewnątrz funkcji komponentu:
334334
local user, set_user = editor.ui.use_state(create_user, props.first_name, props.last_name)
335335

336336

337-
--BAD: literal initializer function causes state reset on every re-render
337+
--ŹLE: literał funkcji inicjalizującej powoduje reset stanu przy każdym ponownym renderowaniu
338338
local id, set_id = editor.ui.use_state(function() return string.lower(props.name) end)
339339

340-
--GOOD: use referenced initializer function to create the state
340+
--DOBRZE: użyj referencji do funkcji inicjalizującej, aby utworzyć stan
341341
local id, set_id = editor.ui.use_state(string.lower, props.name)
342342
```
343343

344344
### **`use_memo`**
345345

346346
Możesz użyć haka `use_memo`, aby poprawić wydajność. W funkcjach renderujących często wykonuje się pewne obliczenia, na przykład sprawdzanie poprawności danych wejściowych użytkownika. Hak `use_memo` przydaje się wtedy, gdy sprawdzenie, czy argumenty funkcji obliczeniowej się zmieniły, jest tańsze niż samo wywołanie tej funkcji. Hak wywoła funkcję obliczeniową przy pierwszym renderowaniu i ponownie wykorzysta obliczoną wartość podczas kolejnych renderowań, jeśli wszystkie argumenty `use_memo` pozostaną bez zmian:
347347
```lua
348-
-- validation function outside of component function
348+
-- funkcja walidująca poza funkcją komponentu
349349
local function validate_password(password)
350350
if #password < 8 then
351-
return false, "Password must be at least 8 characters long."
351+
return false, "Hasło musi mieć co najmniej 8 znaków."
352352
elseif not password:match("%l") then
353-
return false, "Password must include at least one lowercase letter."
353+
return false, "Hasło musi zawierać co najmniej jedną małą literę."
354354
elseif not password:match("%u") then
355-
return false, "Password must include at least one uppercase letter."
355+
return false, "Hasło musi zawierać co najmniej jedną wielką literę."
356356
elseif not password:match("%d") then
357-
return false, "Password must include at least one number."
357+
return false, "Hasło musi zawierać co najmniej jedną cyfrę."
358358
else
359-
return true, "Password is valid."
359+
return true, "Hasło jest poprawne."
360360
end
361361
end
362362

363-
-- ...later, in component function
363+
-- ...później, wewnątrz funkcji komponentu
364364
local username, set_username = editor.ui.use_state('')
365365
local password, set_password = editor.ui.use_state('')
366366
local valid, message = editor.ui.use_memo(validate_password, password)

docs/pl/manuals/extensions-manifest-merge-tool.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ Manifest bazowy
135135
<key>REAL</key>
136136
<real>8.0</real>
137137

138-
<!-- Keep this value even if an extension manifest contains the same key -->
138+
<!-- Zachowaj tę wartość, nawet jeśli manifest rozszerzenia zawiera ten sam klucz -->
139139
<key merge='keep'>BASE64</key>
140140
<data>SEVMTE8gV09STEQ=</data>
141141

142-
<!-- If an extension manifest also has an array with this key then any dictionary values will be merged with the first dictionary value of the base array -->
142+
<!-- Jeśli manifest rozszerzenia również ma tablicę z tym kluczem, wartości słowników zostaną scalone z pierwszą wartością słownika w tablicy bazowej -->
143143
<key>Array1</key>
144144
<array>
145145
<dict>
@@ -150,7 +150,7 @@ Manifest bazowy
150150
</dict>
151151
</array>
152152

153-
<!-- Do not attempt to merge the values of this array, instead values from extension manifests should be added to the end of the array -->
153+
<!-- Nie próbuj scalać wartości tej tablicy; zamiast tego dodaj wartości z manifestów rozszerzeń na końcu tablicy -->
154154
<key merge='keep'>Array2</key>
155155
<array>
156156
<dict>
@@ -187,7 +187,7 @@ Manifest rozszerzenia
187187
<key>INT</key>
188188
<integer>42</integer>
189189

190-
<!-- Replace the existing value in the base manifest -->
190+
<!-- Zastąp istniejącą wartość w manifeście bazowym -->
191191
<key merge='replace'>REAL</key>
192192
<integer>16.0</integer>
193193

@@ -223,7 +223,7 @@ Wynik:
223223
<?xml version='1.0'?>
224224
<!DOCTYPE plist SYSTEM 'file://localhost/System/Library/DTDs/PropertyList.dtd'>
225225
<plist version='1.0'>
226-
<!-- Nested merge of dictionaries from base and extension manifests -->
226+
<!-- Zagnieżdżone scalanie słowników z manifestu bazowego i manifestu rozszerzenia -->
227227
<dict>
228228
<key>NSAppTransportSecurity</key>
229229
<dict>
@@ -244,23 +244,23 @@ Wynik:
244244
</dict>
245245
</dict>
246246

247-
<!-- From the base manifest -->
247+
<!-- Z manifestu bazowego -->
248248
<key>INT</key>
249249
<integer>8</integer>
250250

251-
<!-- The value from the base manifest was replaced since the merge marker was set to "replace" in the extension manifest -->
251+
<!-- Wartość z manifestu bazowego została zastąpiona, ponieważ w manifeście rozszerzenia ustawiono znacznik scalania na "replace" -->
252252
<key>REAL</key>
253253
<real>16.0</real>
254254

255-
<!-- The value from the base manifest was used since the merge marker was set to "keep" in the base manifest -->
255+
<!-- Użyto wartości z manifestu bazowego, ponieważ w manifeście bazowym ustawiono znacznik scalania na "keep" -->
256256
<key>BASE64</key>
257257
<data>SEVMTE8gV09STEQ=</data>
258258

259-
<!-- The value from the extender manifest was added since no merge marker was specified -->
259+
<!-- Dodano wartość z manifestu rozszerzenia, ponieważ nie określono znacznika scalania -->
260260
<key>INT</key>
261261
<integer>42</integer>
262262

263-
<!-- The dictionary values of the array were merged since the base manifest defaults to "merge" -->
263+
<!-- Wartości słowników w tablicy zostały scalone, ponieważ domyślną wartością manifestu bazowego jest "merge" -->
264264
<key>Array1</key>
265265
<array>
266266
<dict>
@@ -272,7 +272,7 @@ Wynik:
272272
</dict>
273273
</array>
274274

275-
<!-- The dictionary values were added to the array since the base manifest used "keep" -->
275+
<!-- Wartości słowników zostały dodane do tablicy, ponieważ manifest bazowy używał opcji "keep" -->
276276
<key>Array2</key>
277277
<array>
278278
<dict>

0 commit comments

Comments
 (0)