Empty framework
How do I make an empty framework?
Simple framework with basic mouse, tick and rendering functionality. I use it to spawn new pens quickly.. What is a empty framework? How do you make a empty framework? This script and codes were developed by Andi Smithers on 21 November 2022, Monday.
Empty framework - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Empty framework</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <body> <canvas id='test'></canvas>
</body> <script src="js/index.js"></script>
</body>
</html>
Empty framework - Script Codes CSS Codes
body { background: #000000; margin: 0px; padding: 0px;
}
Empty framework - Script Codes JS Codes
/*****************************************************************************
The MIT License (MIT)
Copyright (c) 2014 Andi Smithers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*****************************************************************************/
// conceptualized and written by andi smithers
// constant options
const focalDepth = 80;
const focalPoint = 256;
// variables
var centreX;
var centreY;
var mouseX;
var mouseY;
var spawnX;
var spawnY;
var frameCount=0;
// test multiple groups
// initialization
function init()
{ // setup canvas and context canvas = document.getElementById('test'); context = canvas.getContext('2d'); // set canvas to be window dimensions resize(); // create event listeners canvas.addEventListener('mousemove', mouseMove); canvas.addEventListener('click', mouseClick); window.addEventListener('resize', resize); // initialze variables
}
// input functions
function mouseMove(event)
{ var rect = canvas.getBoundingClientRect(); mouseX = event.clientX - rect.left, mouseY = event.clientY - rect.top
}
function mouseClick()
{
}
function resize()
{ canvas.width = window.innerWidth; canvas.height = window.innerHeight; // compute centre of screen centreX = canvas.width/2; centreY = canvas.height/2;
}
// rendering functions
function render()
{ context.fillStyle = 'black'; context.clearRect(0, 0, canvas.width, canvas.height); context.globalAlpha = 1.0; context.font = '20pt Calibri'; context.fillStyle = 'rgb(255,255,255)'; context.textAlign = "center"; context.fillText('Empty Framework', canvas.width/2, 100);
}
// movement functions
function update()
{
}
// per frame tick functions
function animate()
{ frameCount++; // movement update update(); // render update render(); // trigger next frame requestAnimationFrame(animate);
}
// entry point
init();
animate();
Developer | Andi Smithers |
Username | Bolloxim |
Uploaded | November 21, 2022 |
Rating | 3 |
Size | 2,912 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Icosahedron - rendered in 2D | 4,246 Kb |
Asteriod Field | 5,554 Kb |
Zylon Fighter, Fake 3d | 4,981 Kb |
Old school rotation and projection | 10,874 Kb |
Ping radar - sweep and refresh | 7,702 Kb |
Empty framework | 2,912 Kb |
Starfield old school style | 5,214 Kb |
Atari Pokey Chip Emulator | 6,596 Kb |
Particle system .. step 1 | 4,697 Kb |
Random Normal | 3,668 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Fluid Layout with Float | Jxqr97 | 1,785 Kb |
Canvas Orbital Trails v2 | Jackrugile | 3,421 Kb |
Find The Penguin | Lelder | 2,212 Kb |
Faux column absolute wrapper | Yurimorini | 1,823 Kb |
Android Logo with HTML and CSS | Wifi | 2,000 Kb |
Growing Root - Scroll control - CANVAS | Cjonasw | 2,342 Kb |
React Vote Component | Souporserious | 5,465 Kb |
Border image | JohnRiordan | 2,120 Kb |
P5.js data visualization | Enginarslan | 2,233 Kb |
Horizontal scroll fixed element | HerrSerker | 0 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!