change default code to add an outline
This commit is contained in:
parent
c575751e93
commit
4408cb3aef
14
MANUAL.md
14
MANUAL.md
|
@ -463,7 +463,7 @@ A xoshiro128** reimplementation in Lua.
|
||||||
|
|
||||||
#### `rng.init(seed: number[] | nil): rng`
|
#### `rng.init(seed: number[] | nil): rng`
|
||||||
|
|
||||||
Initializes a new RNG class. `seed` must be a table of size 4; if it is not provided, `os.time()` is used in its place.
|
Initializes a new RNG class. `seed` must be a table of size 4; if it is not provided, `os.time()` is used in its place. _(Not `os.clock()`!!! Two RNG values created at the same time with no provided seed will be the same.)_
|
||||||
|
|
||||||
#### `rng(a: number | nil, b: number | nil): number`
|
#### `rng(a: number | nil, b: number | nil): number`
|
||||||
|
|
||||||
|
@ -523,7 +523,7 @@ Here are a couple of examples. All of these are standalone `main.lua` files that
|
||||||
-- define a basic quad
|
-- define a basic quad
|
||||||
local quad = Quad()
|
local quad = Quad()
|
||||||
quad:xy(scx, scy)
|
quad:xy(scx, scy)
|
||||||
quad:zoomto(120, 120)
|
quad:zoom(120)
|
||||||
quad:diffuse(0.8, 1, 0.7, 1)
|
quad:diffuse(0.8, 1, 0.7, 1)
|
||||||
quad:skewx(0.2)
|
quad:skewx(0.2)
|
||||||
|
|
||||||
|
@ -531,6 +531,7 @@ quad:skewx(0.2)
|
||||||
local sprite = Sprite('../docs/uranium.png')
|
local sprite = Sprite('../docs/uranium.png')
|
||||||
sprite:xy(scx, scy)
|
sprite:xy(scx, scy)
|
||||||
sprite:zoom(0.4)
|
sprite:zoom(0.4)
|
||||||
|
sprite:glow(1, 1, 1, 0)
|
||||||
|
|
||||||
-- let's add some text aswell
|
-- let's add some text aswell
|
||||||
local text = BitmapText('common', 'hello, uranium template!')
|
local text = BitmapText('common', 'hello, uranium template!')
|
||||||
|
@ -552,10 +553,17 @@ function uranium.update(dt)
|
||||||
-- no need to reset properties - uranium resets all properties that you set upon definition!
|
-- no need to reset properties - uranium resets all properties that you set upon definition!
|
||||||
|
|
||||||
-- throw in the logo aswell, because why not
|
-- throw in the logo aswell, because why not
|
||||||
|
-- zoom and glow is done for a quick-and-dirty outline
|
||||||
|
sprite:zoom(sprite:GetZoom() * 1.1)
|
||||||
|
sprite:glow(1, 1, 1, 1)
|
||||||
|
sprite:Draw()
|
||||||
|
-- if you can't wait until the start of a frame to reset properties, you can manually do it
|
||||||
|
reset(sprite)
|
||||||
sprite:Draw()
|
sprite:Draw()
|
||||||
|
|
||||||
-- for the text, get a rainbow color
|
-- for the text, get a rainbow color
|
||||||
local col = rgb(1, 0.4, 0.4):huesmooth(t * 0.6)
|
local col = shsv(t * 0.6, 0.5, 1)
|
||||||
|
print(col)
|
||||||
text:diffuse(col:unpack()) -- the :unpack() is necessary when passing into :diffuse()
|
text:diffuse(col:unpack()) -- the :unpack() is necessary when passing into :diffuse()
|
||||||
-- wag the text
|
-- wag the text
|
||||||
text:rotationz(math.sin(t * 2) * 10)
|
text:rotationz(math.sin(t * 2) * 10)
|
||||||
|
|
5
Song.sm
5
Song.sm
|
@ -12,7 +12,7 @@
|
||||||
#CDTITLE:;
|
#CDTITLE:;
|
||||||
#MUSIC:silence.ogg;
|
#MUSIC:silence.ogg;
|
||||||
#OFFSET:0.000;
|
#OFFSET:0.000;
|
||||||
#SAMPLESTART:0.000;
|
#SAMPLESTART:472.930;
|
||||||
#SAMPLELENGTH:12.000;
|
#SAMPLELENGTH:12.000;
|
||||||
#SELECTABLE:YES;
|
#SELECTABLE:YES;
|
||||||
#BPMS:0.000=100.000;
|
#BPMS:0.000=100.000;
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#KEYSOUNDS:;
|
#KEYSOUNDS:;
|
||||||
|
|
||||||
//---------------dance-single - ----------------
|
//---------------dance-single - Medium----------------
|
||||||
#NOTES:
|
#NOTES:
|
||||||
dance-single:
|
dance-single:
|
||||||
Medium:
|
Medium:
|
||||||
|
@ -2008,3 +2008,4 @@ M000
|
||||||
00M0
|
00M0
|
||||||
000M
|
000M
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
11
src/main.lua
11
src/main.lua
|
@ -1,7 +1,7 @@
|
||||||
-- define a basic quad
|
-- define a basic quad
|
||||||
local quad = Quad()
|
local quad = Quad()
|
||||||
quad:xy(scx, scy)
|
quad:xy(scx, scy)
|
||||||
quad:zoomto(120, 120)
|
quad:zoom(120)
|
||||||
quad:diffuse(0.8, 1, 0.7, 1)
|
quad:diffuse(0.8, 1, 0.7, 1)
|
||||||
quad:skewx(0.2)
|
quad:skewx(0.2)
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ quad:skewx(0.2)
|
||||||
local sprite = Sprite('../docs/uranium.png')
|
local sprite = Sprite('../docs/uranium.png')
|
||||||
sprite:xy(scx, scy)
|
sprite:xy(scx, scy)
|
||||||
sprite:zoom(0.4)
|
sprite:zoom(0.4)
|
||||||
|
sprite:glow(1, 1, 1, 0)
|
||||||
|
|
||||||
-- let's add some text aswell
|
-- let's add some text aswell
|
||||||
local text = BitmapText('common', 'hello, uranium template!')
|
local text = BitmapText('common', 'hello, uranium template!')
|
||||||
|
@ -30,10 +31,16 @@ function uranium.update(dt)
|
||||||
-- no need to reset properties - uranium resets all properties that you set upon definition!
|
-- no need to reset properties - uranium resets all properties that you set upon definition!
|
||||||
|
|
||||||
-- throw in the logo aswell, because why not
|
-- throw in the logo aswell, because why not
|
||||||
|
sprite:zoom(sprite:GetZoom() * 1.1)
|
||||||
|
sprite:glow(1, 1, 1, 1)
|
||||||
|
sprite:Draw()
|
||||||
|
-- if you can't wait until the start of a frame to reset properties, you can manually do it
|
||||||
|
reset(sprite)
|
||||||
sprite:Draw()
|
sprite:Draw()
|
||||||
|
|
||||||
-- for the text, get a rainbow color
|
-- for the text, get a rainbow color
|
||||||
local col = rgb(1, 0.4, 0.4):huesmooth(t * 0.6)
|
local col = shsv(t * 0.6, 0.5, 1)
|
||||||
|
print(col)
|
||||||
text:diffuse(col:unpack()) -- the :unpack() is necessary when passing into :diffuse()
|
text:diffuse(col:unpack()) -- the :unpack() is necessary when passing into :diffuse()
|
||||||
-- wag the text
|
-- wag the text
|
||||||
text:rotationz(math.sin(t * 2) * 10)
|
text:rotationz(math.sin(t * 2) * 10)
|
||||||
|
|
Loading…
Reference in New Issue