package
4.1.1
Repository: https://github.com/oakmound/oak.git
Documentation: pkg.go.dev

# Packages

Package mod stores modification functions for images.
Package particle provides options for generating renderable particle sources.

# Functions

BatchLoad loads subdirectories from the given base folder and imports all files, using alias rules to automatically determine the size of sprites and sheets in subfolders.
BezierLine converts a bezier into a line sprite.
BezierThickLine draws a BezierLine wrapping each colored pixel in a square of width and height = thickness.
BlankBatchLoad acts like BatchLoad, but will not load and instead return a blank image of the appropriate dimensions for anything above maxFileSize.
DefaultFont returns a font built from DefFontGenerator.
Draw adds the given renderable to the global draw stack.
DrawCircle draws a circle on the input rgba, of color c.
DrawColor is equivalent to LoadSpriteAndDraw, but with colorboxes.
DrawCurve draws a curve inward on the input rgba, of color c.
DrawGradientLine acts like DrawThickLine but also applies a gradient to the line.
DrawImage performs a draw operation at -x, -y, because shiny/screen represents quadrant 4 as negative in both axes.
DrawLine draws a line onto an image rgba from one point to another.
DrawLineColored acts like DrawThickLine, but takes in a custom colorer function for how it draws its line.
DrawPoint draws a color on the screen as a single-widthed pixel (box).
DrawThickLine acts like DrawlineOnto, but takes in thickness of the given line.
EmptyRenderable returns a minimal, 1-width and height pseudo-nil Renderable.
FontColor returns an image.Image color matching the SVG 1.1 spec.
GetFont calls GetFont on the Default Cache.
GetSheet calls GetSheet on the Default Cache.
GetSprite calls GetSprite on the Default Cache.
GradientColorAt returns a new color via a gradient between two colors and the progress between them.
IdentityColorer returns the same color it was given at initialization, regardless of progress.
LoadFont calls LoadFont on the Default Cache.
LoadSheet calls LoadSheet on the Default Cache.
LoadSprite calls LoadSprite on the Default Cache.
MakeSheet converts an image into a sheet with cellSize sized sprites.
NewCache returns an empty Cache.
NewCircle creates a sprite and draws a circle onto it.
NewCircularGradientBox returns a gradient box where the center will be startColor and the gradient will radiate as a circle out from the center.
NewColorBox returns a Sprite full of a given color with the given dimensions Deprecated: Use NewColorboxM (for a Modifiable) or NewColorBoxR.
NewColorBoxM returns a modifiable Color Box (as a Sprite).
NewColorBoxR creates a color box.
NewColoredLine returns a line with a custom function for how each pixel in that line should be colored.
NewCompositeM creates a CompositeM.
NewCompositeR creates a new CompositeR from a slice of renderables.
NewDrawFPS returns a DrawFPS, which will render a counter of how fast it is being drawn.
NewDrawStack creates a DrawStack with the given stackable items, drawn in descending index order.
NewDynamicHeap creates a renderable heap for drawing renderables by layer where the position of the viewport is taken into account to produce the drawn location of the renderable.
NewEmptySprite returns a sprite of the given dimensions with a blank RGBA.
NewGradientBox returns a gradient box defined on the two input colors and the given progress function.
NewGradientLine returns a Line that has some value of thickness along with a start and end color.
NewHorizontalGradientBox returns a gradient box with a horizontal gradient from the start to end color, left to right.
NewIntText wraps the given int pointer in a stringer interface and creates a text renderable that will diplay the underlying int value.
NewLayeredPoint creates a new LayeredPoint at a given location and layer.
NewLine returns a line from x1,y1 to x2,y2 with the given color.
NewLogicFPS returns a LogicFPS, which will render a counter of how fast it receives event.Enter events.
NewPointsPolygon is a helper function for `NewPolygon(floatgeom.NewPolygon2(p1, p2, p3, pn...))`.
NewPolygon constructs a renderable polygon.
NewReverting returns a Reverting type wrapped around the given modifiable.
NewSequence returns a new sequence from the input modifiables, playing at the given fps rate.
NewSheetSequence creates a Sequence from a sheet and a list of x,y frame coordinates.
NewSprite creates a new sprite.
NewStaticHeap creates a renderable heap for drawing renderables by layer where the position of renderable is absolute with regards to the viewport.
NewStringerText creates a text element using the default font and a stringer.
NewStrPtrText is a helper to take in a string pointer for NewText.
NewSwitch creates a new Switch from a map of names to modifiables.
NewText is a helper to create a text element with the default font and a string.
NewThickLine returns a Line that has some value of thickness.
NewVerticalGradientBox returns a gradient box with a vertical gradient from the start to end color, top to bottom.
OverlaySprites combines sprites together through masking to form a single sprite.
OverwriteImage is equivalent to ShinyDraw, but uses draw.Src draw.Src will overwrite pixels beneath the given image regardless of the new image's alpha.
RegisterCfgDecoder acts like RegisterDecoder for CfgDecoders.
RegisterDecoder adds a decoder to the set of image decoders for file loading.
SetDrawStack takes in a set of Stackables which act as the Drawstack available and resets how calls to Draw will act.
Tween takes two images and returns a set of images tweening between the two over some number of frames.
TweenSequence returns a sequence that is the tweening between the input images at the given frame rate over the given frame count.

# Constants

Undraw is a layer representing elements that should be undrawn, or removed from the draw stack.

# Variables

CircularProgress measures progress as distance from the center of a circle.
DefaultCache is the receiver for package level sprites, sheets, and font loading operations.
DefaultFontGenerator is a default font generator, using an internally compiled font colored white by default.
DefFontGenerator is a default font generator, using an internally compiled font colored white by default.
GlobalDrawStack is the stack that all draw calls are sent through.
HorizontalProgress measures progress as x / w.
VerticalProgress measures progress as y / h.

# Structs

Cache is a simple image data cache.
ColorBoxR is a renderable color box.
CompositeM Types display all of their parts at the same time, and respect the positions of their parts as relative to the position of the composite itself.
A CompositeR is equivalent to a CompositeM for Renderables instead of Modifiables.
DrawFPS is a Renderable that will display how fast it is rendered.
The DrawStack is a stack with a safe adding mechanism that creates isolation between draw steps via predraw.
A Font can create text renderables.
A FontGenerator stores information that can be used to create a font.
InterruptBool is a composable struct for NonInterruptable support.
A Layer object has a draw layer.
A LayeredPoint is an object with a position Vector and a layer.
LogicFPS is a Stackable that will draw the logical fps onto the screen when a part of the draw stack.
NoopStackable is a Stackable element where all methods are no-ops.
A Polygon is a renderable that is represented by a set of in order points on a plane.
A RenderableHeap manages a set of renderables to be drawn in explicit layered order, using an internal heap to manage that order.
The Reverting structure lets modifications be made to a Modifiable and then reverted, up to arbitrary history limits.
A Sequence is a series of modifiables drawn as an animation.
A Sprite is a basic wrapper around image data and a point.
The Switch type is intended for use to easily swap between multiple renderables that are drawn at the same position on the same layer.
A Text is a renderable that represents some text to print on screen.

# Interfaces

CanPause types have pause functions to start and stop animation.
Layered types know the order they should be drawn in relative to other layered types.
A Modifiable is a Renderable that has functions to change its underlying image.
NonInterruptable types are not always interruptable.
NonStatic types are not always static.
Positional types have 2D positions on a screen and can be manipulated to be in a certain position on that screen.
A Renderable is anything which can be drawn at a given draw layer, undrawn, and set in a particular position.
A Stackable can be put onto a draw stack.
Triggerable types can have an ID set so when their animations finish, they trigger AnimationEnd on that ID.

# Type aliases

CfgDecoder is an equivalent to Decoder that just exports the color model and dimensions of the image.
A Colorer takes some notion of linear progress and returns a color.
Decoder functions convert arbitrary readers to images.
FontOptions are optional options used in font generation.
Sheet is a 2D array of image rgbas.