4 the standard graphics pipeline which draws a complete scenery
6 function graphics_pipeline(batch
,xCam
,yCam
)
9 local sonarbubblesStencil
= love
.graphics
.newStencil(graphics_stencilFunction
)
10 graphics_drawBackground()
11 love
.graphics
.setStencil(sonarbubblesStencil
)
12 graphics_drawEntities(x
,y
)
13 love
.graphics
.setStencil()
14 graphics_drawMap(batch
,x
,y
)
15 love
.graphics
.setInvertedStencil(sonarbubblesStencil
)
17 love
.graphics
.setInvertedStencil()
21 draws the background or 'water'
23 function graphics_drawBackground()
25 love
.graphics
.setColor(130,180,190)
26 love
.graphics
.rectangle("fill",0,0,3200,3200) --TODO
31 draws all entities. not visible entities will be painted over by background
33 function graphics_drawEntities(x
,y
)
34 for i
,e
in ipairs(entities
) do
42 function graphics_drawMap(batch
,x
,y
)
43 love
.graphics
.draw(batch
,-x
,-y
)
47 draws a transparent shadow
49 function graphics_drawShadow()
51 love
.graphics
.setColor(30,30,130,200)
52 love
.graphics
.rectangle("fill",0,0,3200,3200) --TODO
57 draws the controls on top of everything
59 function graphics_drawControls()
63 iterates over all sonarbubbles and adds a circle stencil for each
65 function graphics_stencilFunction()
66 for i
,s
in ipairs(sonarbubbles
) do
67 love
.graphics
.circle("fill",s
.x
-x
,s
.y
-y
,s
.size
/2)
74 function graphics_drawConsole()