Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View olegberman's full-sized avatar
:octocat:
💻

Oleg Berman olegberman

:octocat:
💻
View GitHub Profile
/**
- There's no native support of mulitline text in Canvas,
- this function will help you to draw multiline text
- by providing max width, line breaks will happen there
**/
var wrap_text = (ctx, text, x, y, lineHeight, maxWidth, textAlign) => {
if(!textAlign) textAlign = 'center'
ctx.textAlign = textAlign
var words = text.split(' ')
@olegberman
olegberman / calc.html
Created July 12, 2016 18:03
Points based system calculator
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<select id="age">
<option value="1">20</option>
0x2545bfe5bC656486ae64E05739B49636B0eFcb1C