It looks like you're new here. If you want to get involved, click one of these buttons!
application:setBackgroundColor(0) local font = TTFont.new("OpenSans-ExtraBold.ttf", 40, "") local tf = TextField.new(font, "Funny colored text") tf:setLayout{w = 400, h = 100, flags = 1280|FontBase.TLF_CENTER|FontBase.TLF_VCENTER} tf:setPosition(0,40) tf:setTextColor(0xFFFFFF,1) stage:addChild(tf) local shader=StandardShaders:getShaderSpecification(Shader.SHADER_PROGRAM_TEXTUREALPHA) function shader.fragmentShader() : Shader local frag=lF4(fColor)*texture2D(fTexture, fTexCoord).aaaa frag.r=(sin(fTexCoord.x*300)+1)/2 frag.g=(cos(fTexCoord.y*300)+1)/2 frag.b=(cos((fTexCoord.y+fTexCoord.x)*100)+1)/2 if (frag.a==0.0) then discard() end return frag end tf:setShader(shader:build()) |
Likes: keszegh, pie, MoKaLux, SinisterSoft
Comments
https://deluxepixel.com
- copy the stdluashaders.lua to the luashader folder
- before the example code I needed to add this code (see: https://wiki.gideros.rocks/index.php/Loading_Order_of_Lua_Files):
PS: doesn't look so nice on my mobile
Likes: SinisterSoft, pie