graphics

package
v0.0.0-...-7aa605c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpriteScale = 10
)

Variables

View Source
var (
	BrushImage = ebiten.NewImage(3, 3)
)

Functions

func AngleOriginAsFloat32

func AngleOriginAsFloat32(angle float64, rect image.Rectangle) float32

func AppendBillboardUVVerticesIndices

func AppendBillboardUVVerticesIndices(vx []ebiten.Vertex, ix []uint16, index uint16, rect image.Rectangle, pos, right, up mgl64.Vec3, tf *mgl64.Mat4, truncateY bool) ([]ebiten.Vertex, []uint16)

func AppendBillboardVerticesIndices

func AppendBillboardVerticesIndices(vx []ebiten.Vertex, ix []uint16, index uint16, pos, right, up mgl64.Vec3, tf *mgl64.Mat4) ([]ebiten.Vertex, []uint16)

func AppendQuadVerticesIndices

func AppendQuadVerticesIndices(vertices []ebiten.Vertex, indices []uint16, index int, opts *QuadOpts) ([]ebiten.Vertex, []uint16)

func AppendRectVerticesIndices

func AppendRectVerticesIndices(vertices []ebiten.Vertex, indices []uint16, index int, opts *RectOpts) ([]ebiten.Vertex, []uint16)

func ColorAsFloat32RGB

func ColorAsFloat32RGB(clr color.Color) float32

func ScreenCoordinates

func ScreenCoordinates(x, y float64, rect image.Rectangle) (float32, float32)

func ScreenVertices

func ScreenVertices(vertices []ebiten.Vertex, width, height int)

Types

type Context

type Context struct {
	ScreenBounds   image.Rectangle
	CameraPosition mgl64.Vec3
	CameraRight    mgl64.Vec3
	CameraUp       mgl64.Vec3
	ProjView       mgl64.Mat4
	ViewInv        mgl64.Mat4
}

type QuadOpts

type QuadOpts struct {
	P0, P1, P2, P3 mgl64.Vec4
	R, G, B, A     float32
}

type RectOpts

type RectOpts struct {
	DstX, DstY          float32
	SrcX, SrcY          float32
	DstWidth, DstHeight float32
	SrcWidth, SrcHeight float32
	R, G, B, A          float32
}

Jump to

Keyboard shortcuts

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