Last active
May 5, 2020 16:28
-
-
Save BlackGoku36/e97d500547be88b3b2de5f2ea560372c to your computer and use it in GitHub Desktop.
VSCode snippets for Rice2D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"class": { | |
"scope": "haxe", | |
"prefix": "rice-class", | |
"body": [ | |
"class $TM_FILENAME_BASE extends rice2d.Script{", | |
"", | |
"\tpublic function new() {", | |
"\t\tsuper();", | |
"", | |
"\t\t// notifyOnAdd(()->{", | |
"\t\t// });", | |
"", | |
"\t\t// notifyOnInit(()->{", | |
"\t\t// });", | |
"", | |
"\t\t// notifyOnUpdate(()->{", | |
"\t\t// });", | |
"", | |
"\t\t// notifyOnRender((canvas)->{", | |
"\t\t\t// var g = canvas.g2;", | |
"\t\t\t// var col = g.color;", | |
"\t\t\t// ~~~ Your code ~~~", | |
"\t\t\t// g.color = col;", | |
"\t\t// });", | |
"", | |
"\t\t// notifyOnRemove(()->{", | |
"\t\t// });", | |
"\t}", | |
"}" | |
], | |
"description": "Script class for Rice2D" | |
}, | |
"scene": { | |
"scope": "json", | |
"prefix": "rice-scene", | |
"body": [ | |
"{", | |
"\t\"name\":\"Scene\", ", | |
"\t\"assets\":[],", | |
"\t\"scripts\":[],", | |
"\t\"objects\":[", | |
"\t\t{", | |
"\t\t\t\"name\": \"object1\",", | |
"\t\t\t\"x\":10,", | |
"\t\t\t\"y\":10,", | |
"\t\t\t\"height\": 256,", | |
"\t\t\t\"width\": 256,", | |
"\t\t\t\"color\": [100, 200, 50, 255],", | |
"\t\t\t\"scripts\": [],", | |
"\t\t\t\"spriteRef\": \"sprite.png\",", | |
"\t\t}", | |
"\t]", | |
"}" | |
], | |
"description": "Simple scene for Rice2D" | |
}, | |
"emitter": { | |
"scope": "haxe", | |
"prefix": "scene-emitter", | |
"body": [ | |
"var emitter = new Emitter({", | |
"\tx: 300, y: 300,", | |
"\tparticle: {", | |
"\t\tspriteRef: \"sprite.png\", width: 30, height: 30,", | |
"\t\tlifeTime: 5.0, speed: 1.0,", | |
"\t\trots: 0, rote:6.28", | |
"\t},", | |
"\tamount: 5", | |
"});", | |
], | |
"description": "Simple particle emitter for Rice2D", | |
}, | |
"image-painter-frag":{ | |
"scope": "glsl", | |
"prefix": "fragpainter", | |
"body": [ | |
"#version 450", | |
"", | |
"uniform sampler2D tex;", | |
"in vec2 texCoord;", | |
"in vec4 color;", | |
"out vec4 FragColor;", | |
"", | |
"", | |
"void main() {", | |
"\tvec4 texcolor = texture(tex, texCoord) * color;", | |
"\ttexcolor.rgb *= color.a;", | |
"\tFragColor = texcolor;", | |
"}" | |
], | |
"description": "Insets the default frag painter shader" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment