texture

package
v0.0.0-...-d0d8f3b Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package texture loads and creates abitrary sized RGB565 images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blit

func Blit(dst *Texture, dstX, dstY int, src *Texture, srcX, srcY, width, height int)

Blit copies a texture to another.

Types

type Texture

type Texture struct {
	Pixels []color.Color
	// contains filtered or unexported fields
}

Texture is an RGB565 image of abitrary size.

func Load

func Load(name string) (*Texture, error)

Load a texture from a PNG.

func New

func New(width, height int) *Texture

New texture allocates an empty texture.

func (*Texture) GetPixel

func (tx *Texture) GetPixel(x, y int) color.Color

GetPixel from the texture.

func (*Texture) Height

func (tx *Texture) Height() int

Height of the texture

func (*Texture) SetPixel

func (tx *Texture) SetPixel(x, y int, c color.Color)

SetPixel in the texture.

func (*Texture) Width

func (tx *Texture) Width() int

Width of the texture

Jump to

Keyboard shortcuts

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