Skip to content

math2001/Rectjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rectjs

Rectjs is a simple file that helps you with rects (to use the baslise canvas for example)

If you've already used the pygame's rect, well the goal of this is to be the exact same, in javascript.

Otherwise, here's how you use it

> var myRect = new Rect(0, 0, 10, 10)
undefined
> [myRect.x, myRect.y, myRect.width, myRect.height]
[ 0, 0, 10, 10 ]
> myRect.top == myRect.x
true
> myRect.bottom
10
> myRect.center
[ 5, 5 ]
> myRect.centerx = 0
0
> myRect.left
-5
>

About

Rect heavily inspired by the pygame's Rect (python)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors