panel

package
v0.0.0-...-9314ada Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Panel

Panel is a thin wrapper around an image that can be created, rendered and placed on an output buffer.

By extracting it, it is possible to test and visualise the panel by itself.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImagePanel

type ImagePanel struct {
	Bounds image.Rectangle
	W, H   int

	Location image.Rectangle // Where panel is to be rendered
	// contains filtered or unexported fields
}

func NewImagePanel

func NewImagePanel(img image.Image) *ImagePanel

This does the initial rendering of the image to create the static image. This is then copied during the rendering process Other panels might update the content on each render

func (*ImagePanel) Render

func (p *ImagePanel) Render(buffer *image.RGBA)

// Draws on an image buffer the contents of the panel // the location size should be the same as the initial image

func (*ImagePanel) Resize

func (p *ImagePanel) Resize(bounds image.Rectangle)

// the location size should be the same as the initial image

type PlainPanel

type PlainPanel struct {
	Bounds image.Rectangle
	W, H   int

	Location image.Rectangle // Where panel is to be rendered
	// contains filtered or unexported fields
}

func NewPlainPanel

func NewPlainPanel(w, h int) *PlainPanel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL