Compare commits

...

2 Commits

2 changed files with 24 additions and 11 deletions

View File

@ -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.
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`
`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
```
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
function uranium.init()
setShader(actor, shader)
-- or
setShaderfuck(shader)
-- (don't forget to clearShaderfuck())
end
setShader(actor, shader)
-- or
setShaderfuck(shader)
-- (don't forget to clearShaderfuck())
```
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('scale', 0.25)
function uranium.init()
setShader(sprite, shader)
end
setShader(sprite, shader)
function uranium.update()
shader:uniform1f('tx', t)

@ -1 +1 @@
Subproject commit 70206204960a13bda1d1414fe517b09156344d36
Subproject commit 99f8ab7f8bae6a95419881bb5dbe105c807ad3ba