File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 3535 < script src ="unit/core/core.js " type ="text/javascript " > </ script >
3636 <!--<script src="unit/core/2d_primitives.js" type="text/javascript" ></script>-->
3737 < script src ="unit/core/curves.js " type ="text/javascript " > </ script >
38+ < script src ="unit/core/renderer.js " type ="text/javascript " > </ script >
3839
3940 < script src ="unit/math/calculation.js " type ="text/javascript " > </ script >
4041 < script src ="unit/math/random.js " type ="text/javascript " > </ script >
Original file line number Diff line number Diff line change 1+ suite ( 'Renderer' , function ( ) {
2+
3+ var myp5 = new p5 ( function ( p ) {
4+ p . setup = function ( ) { } ;
5+ p . draw = function ( ) { } ;
6+ } ) ;
7+
8+ teardown ( function ( ) {
9+ myp5 . clear ( ) ;
10+ } ) ;
11+
12+ suite ( 'p5.prototype.blendMode' , function ( ) {
13+ var blendMode = p5 . prototype . blendMode ;
14+ var drawX = function ( ) {
15+ myp5 . strokeWeight ( 30 ) ;
16+ myp5 . stroke ( 80 , 150 , 255 ) ;
17+ myp5 . line ( 25 , 25 , 75 , 75 ) ;
18+ myp5 . stroke ( 255 , 50 , 50 ) ;
19+ myp5 . line ( 75 , 25 , 25 , 75 ) ;
20+ } ;
21+ suite ( 'blendMode()' , function ( ) {
22+ test ( 'should be a function' , function ( ) {
23+ assert . ok ( blendMode ) ;
24+ assert . typeOf ( blendMode , 'function' ) ;
25+ } ) ;
26+ test ( 'should be able to ADD' , function ( ) {
27+ myp5 . blendMode ( myp5 . ADD ) ;
28+ drawX ( ) ;
29+ } ) ;
30+ test ( 'should be able to MULTIPLY' , function ( ) {
31+ myp5 . blendMode ( myp5 . MULTIPLY ) ;
32+ drawX ( ) ;
33+ } ) ;
34+
35+ } ) ;
36+ } ) ;
37+
38+ } ) ;
You can’t perform that action at this time.
0 commit comments