Compare commits
2 Commits
fbaece4dd4
...
b86c942732
Author | SHA1 | Date |
---|---|---|
Jill | b86c942732 | |
Jill | 1086c87426 |
33
MANUAL.md
33
MANUAL.md
|
@ -303,6 +303,23 @@ end
|
||||||
|
|
||||||
**Nested AFs are supported.** As with all complicated things in this template, check out the [`ActorFrame` example](#simple-actorframe-setup) for a simple working setup.
|
**Nested AFs are supported.** As with all complicated things in this template, check out the [`ActorFrame` example](#simple-actorframe-setup) for a simple working setup.
|
||||||
|
|
||||||
|
An additional extra feature Uranium Template adds to assist with rendering multiple instances is the ability to pass in arguments through `Draw()`:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
setDrawFunction(af, function(x, y)
|
||||||
|
quad:xy(x, y)
|
||||||
|
quad:Draw()
|
||||||
|
end)
|
||||||
|
|
||||||
|
function uranium.update()
|
||||||
|
for x = 0, 3 do
|
||||||
|
for y = 0, 3 do
|
||||||
|
af:Draw(x, y)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
#### `ActorScroller`
|
#### `ActorScroller`
|
||||||
|
|
||||||
`ActorFrame` already has an extremely, _extremely_ complicated setup powering it in the back-end; and `ActorScroller` is way too niche for me to give it the same treatment. Sorry!
|
`ActorFrame` already has an extremely, _extremely_ complicated setup powering it in the back-end; and `ActorScroller` is way too niche for me to give it the same treatment. Sorry!
|
||||||
|
@ -332,15 +349,13 @@ local sprite = Sprite('docs/uranium.png')
|
||||||
local shader = Shader('src/shader.frag') -- returns a RageShaderProgram
|
local shader = Shader('src/shader.frag') -- returns a RageShaderProgram
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards, call `setShader` on your actor. _Using `:SetShader` will not work._
|
Afterwards, call `setShader` on your actor. You can call this outside of `uranium.init`, if you like.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
function uranium.init()
|
setShader(actor, shader)
|
||||||
setShader(actor, shader)
|
-- or
|
||||||
-- or
|
setShaderfuck(shader)
|
||||||
setShaderfuck(shader)
|
-- (don't forget to clearShaderfuck())
|
||||||
-- (don't forget to clearShaderfuck())
|
|
||||||
end
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you prefer, you can also inline shader code, as long as you don't mix files with inlined code in the same shader:
|
If you prefer, you can also inline shader code, as long as you don't mix files with inlined code in the same shader:
|
||||||
|
@ -1339,9 +1354,7 @@ void main() {
|
||||||
shader:uniform1f('yo', 1)
|
shader:uniform1f('yo', 1)
|
||||||
shader:uniform1f('scale', 0.25)
|
shader:uniform1f('scale', 0.25)
|
||||||
|
|
||||||
function uranium.init()
|
setShader(sprite, shader)
|
||||||
setShader(sprite, shader)
|
|
||||||
end
|
|
||||||
|
|
||||||
function uranium.update()
|
function uranium.update()
|
||||||
shader:uniform1f('tx', t)
|
shader:uniform1f('tx', t)
|
||||||
|
|
2
template
2
template
|
@ -1 +1 @@
|
||||||
Subproject commit 70206204960a13bda1d1414fe517b09156344d36
|
Subproject commit 99f8ab7f8bae6a95419881bb5dbe105c807ad3ba
|
Loading…
Reference in New Issue