is created with:
package main
import (
"image/color"
"github.com/ajstarks/fc"
)
func main() {
width := 500
height := 500
blue := color.RGBA{0, 0, 255, 255}
white := color.RGBA{255, 255, 255, 255}
canvas := fc.NewCanvas("hello", width, height)
canvas.Circle(50, 0, 100, blue)
canvas.CText(50, 25, 10, "hello, world", white)
canvas.Image(50, 75, 200, 200, "earth.jpg")
canvas.EndRun()
}
There are methods for Text (begin, centered, and end aligned), Circles, Lines, Rectangles, and Images.
NewCanvas(name string, w, h int) Canvas
(canvas *Canvas) EndRun()
(canvas *Canvas) Text(x, y float64, size float64, s string, color color.RGBA) {
(canvas *Canvas) CText(x, y float64, size float64, s string, color color.RGBA) {
(canvas *Canvas) EText(x, y float64, size float64, s string, color color.RGBA) {
(canvas *Canvas) Circle(x, y, r float64, color color.RGBA) {
(canvas *Canvas) Line(x1, y1, x2, y2, size float64, color color.RGBA) {
(canvas *Canvas) Rect(x, y, w, h float64, color color.RGBA) {
CornerRect places a rectangle with upper left corner on (x,y) within a container, using percent coordinates
(canvas *Canvas) CornerRect(x, y, w, h float64, color color.RGBA) {
(canvas *Canvas) Image(x, y float64, w, h int, name string) {
func AbsStart(name string, w, h int) (fyne.Window, *fyne.Container)
func AbsEnd(window fyne.Window, content *fyne.Container, w, h int) {
func AbsText(c *fyne.Container, x, y int, s string, size int, color color.RGBA)
func AbsTextMid(c *fyne.Container, x, y int, s string, size int, color color.RGBA)
func AbsTextEnd(c *fyne.Container, x, y int, s string, size int, color color.RGBA)
func AbsLine(c *fyne.Container, x1, y1, x2, y2 int, size float32, color color.RGBA)
func AbsCircle(c *fyne.Container, x, y, r int, color color.RGBA)
AbsCornerRect -- Add a rectangle with (c *fyne.Container, x,y) at the upper left, with dimension (w, h)
func AbsCornerRect(c *fyne.Container, x, y, w, h int, color color.RGBA)
func AbsRect(c *fyne.Container, x, y, w, h int, color color.RGBA)
func AbsImage(c *fyne.Container, x, y, w, h int, name string)
func AbsCornerImage(c *fyne.Container, x, y, w, h int, name string)