Skip to content

Instantly share code, notes, and snippets.

View daverave1212's full-sized avatar

David Irimia daverave1212

View GitHub Profile
//package scripts;
/*
import com.stencyl.Engine;
import com.stencyl.models.Font;
import com.stencyl.graphics.G;
import com.stencyl.behavior.SceneScript;
*/
/*
@daverave1212
daverave1212 / TextBoxPlayable.hx
Last active December 4, 2018 15:39
An extension for the TextBox class for Stencyl programming
//package scripts;
/*
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.Engine;
import com.stencyl.models.Font;
import com.stencyl.graphics.G;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;
alert("Hello world");
console.log("Hello world");
// Custom MenuItem creator/parser
function createMenuItem(arrayObject){
var nw = require("nw.gui");
var thisItem;
if(arrayObject[1] && (typeof arrayObject[1]) != "string" && !Array.isArray(arrayObject[1])){
thisItem = new nw.MenuItem({
label : arrayObject[0],
click : arrayObject[1]});}
else{
var innerSubmenu = new nw.Menu();
@daverave1212
daverave1212 / UI.hx
Last active December 16, 2018 00:54
For Stencyl, to facilitate UI making
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.graphics.BitmapWrapper;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
@daverave1212
daverave1212 / Fader.hx
Created December 6, 2018 17:04
A Fader object class for Stencyl, allows you to fade the screen
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;
@daverave1212
daverave1212 / ResourceBar.hx
Created December 9, 2018 22:32
A class to make animated health bars, mana bars, etc
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;
@daverave1212
daverave1212 / Scripts.hx
Created December 11, 2018 00:19
Simple class with a single static function, similar to GetComponent in Unity: Scripts.get(actor, behaviorName)
/*
Use Scripts.get(actor, behaviorName) to get the behavior
IMPORTANT: You must cast it!
Ex: var b : MyBehavior = cast Scripts.get(actor, behaviorName);
*/
package scripts;
import com.stencyl.Engine;
import com.stencyl.models.Actor;
@daverave1212
daverave1212 / FloatingTextManager.hx
Last active December 11, 2018 17:32
A neat class, great for combat and RPG games with floating combat text!
package scripts;
import com.stencyl.graphics.G;
import com.stencyl.behavior.Script;
import com.stencyl.behavior.Script.*;
import com.stencyl.behavior.ActorScript;
import com.stencyl.behavior.SceneScript;
import com.stencyl.behavior.TimedTask;