Fill

Let's see the most fundamental drawing command, Fill.

Code


The result will be like this:

How the code works


  

(*ebiten.Image).Fill is a function to fill the image with the specified color. The argument color is a value that implements color.Color interface in the standard image/color package. In this example, the color value is red (the red and alpha part is 0xff.)

Fill always returns nil. The sigunature says that Fill returns an error value, but this is due to historical reasons. You can ignore the returned error of Fill.