2.0.1 • Published 3 years ago

@ksplat/easyjs v2.0.1

Weekly downloads
-
License
CC BY-ND-4.0
Repository
github
Last release
3 years ago

EasyJS

// searches for "a" and removes it and returns a new array var myNewArray = myArray.delMove("a");

console.log(magicBallAnswersMath.fromTo(0, 2));

// name the variable ctx to get the context NEEDED

var ctx = canvas.getContext('2d');

// two possible shapes: circle, and rectangle

// draws a blue rectangle with dimensions of 30 x 30 and position of x0, and y0 ctx.colorShape('rectangle', 30, 30, 0, 0, 'blue'); // draws a red circle with radius of 10 (w property is radius) and position of x45, and y45 ctx.colorShape('circle', 10, 10, 45, 45, 'red');

// name the variable ctx to get the context NEEDED

var ctx = canvas.getContext('2d');

// draws my image with a position of x30, and y30 ctx.loadSprite('images/mySprite', 30, 30);

var ctx = document.getElementById('game').getContext('2d');

// myPlayer is my png file: myPlayer-1.png. Just write the base png file. // 100x and 100y // each frame is shown for 150 milliseconds // I have 5 images for each frame (myPlayer-1.png, myPlayer-2.png etc..) of my animation. // I set it to loop my animation // My file is png so I set it to png ctx.loadSequence('myPlayer', 100, 100, 150, 5, true, 'png');

// inserts jquery in the head of our page document.insertJquery();

// inserts a script in the body tag of our page at the top document.insertScript('js/myFile.js', 'body', true);

// An optional but easy way to get the parent element's id of a child. var myElem = document.getElementById('demo');

var myElementsParent = document.getParent();

// An optional but easy way to get the child element's id of a parent. var myElem = document.getElementById('demo');

var myElementsChild = document.getChild();

// Adds an animation to an element that happens when the document is loaded. Notice: This requires Jquery! // speed is in milliseconds, how long the animation lasts // animations that is currently accepted is fade-in, and fade-out document.animateElem('myElement', 2500, 'fade-in');