Documentation
¶
Overview ¶
Package tigo implements the interface for TIGO.
Index ¶
- func SaveImage(fileName string, bmp *Bitmap) error
- type Bitmap
- func (bmp *Bitmap) Blit(sx, sy int, dest *Bitmap, dx, dy, w, h int)
- func (bmp *Bitmap) BlitAlpha(sx, sy int, dest *Bitmap, dx, dy, w, h int, alpha float32)
- func (bmp *Bitmap) BlitTint(sx, sy int, dest *Bitmap, dx, dy, w, h int, tint Pixel)
- func (bmp *Bitmap) Clear(color Pixel)
- func (bmp *Bitmap) Closed() bool
- func (bmp *Bitmap) Fill(x, y, w, h int, color Pixel)
- func (bmp *Bitmap) Free()
- func (bmp *Bitmap) Get(x, y int) Pixel
- func (bmp *Bitmap) KeyDown(key Key) bool
- func (bmp *Bitmap) KeyHeld(key Key) bool
- func (bmp *Bitmap) Line(x0, y0, x1, y1 int, color Pixel)
- func (bmp *Bitmap) Mouse() (x, y, buttons int)
- func (bmp *Bitmap) Plot(x, y int, p Pixel)
- func (bmp *Bitmap) Print(font *Font, x, y int, color Pixel, text string)
- func (bmp *Bitmap) ReadChar() int
- func (bmp *Bitmap) Rect(x, y, w, h int, color Pixel)
- func (bmp *Bitmap) SetPostFX(hBlur, vBlur bool, scanlines, contrast float32)
- func (bmp *Bitmap) Update()
- type Codepage
- type Font
- type Glyph
- type Key
- type Pixel
- type WindowFlag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Bitmap represents a bitmap.
func NewWindow ¶
func NewWindow(width, height int, title string, flags WindowFlag) *Bitmap
NewWindow creates a new empty window. title is UTF-8.
func (*Bitmap) Blit ¶
Blit copies bitmap data from bmp to dest. sx/sy = source coordinates. dx/dy = dest coordinates. w/h: width/height.
func (*Bitmap) BlitAlpha ¶
BlitAlpha is same as Blit, but blends with the bitmap alpha channel, and uses the 'alpha' variable to fade out.
func (*Bitmap) KeyDown ¶
KeyDown returns true if a key is pressed for a window. KeyDown only tests for the initial press.
func (*Bitmap) KeyHeld ¶
KeyHeld returns true if a key is held for a window. KeyHeld repreats each frame.
func (*Bitmap) ReadChar ¶
ReadChar reads character input for a window and returns the Unicode value of the last key pressed. If no key is pressed, ReadChar returns 0.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font represents a font consisting of glyphs.
func LoadFont ¶
LoadFont loads a font. The font bitmap should contain all characters for the given codepage, excluding the first 32 control codes. Supported codepages:
0 - Regular 7-bit ASCII 1252 - Windows 1252
func (*Font) TextHeight ¶
TextHeight returns the height of a string.
type Key ¶
type Key int
Key represents a key scancode. ASCII ('A'-'Z' and '0'-'9') is used for letters/numbers.
const ( Pad0 Key = 128 + iota Pad1 Pad2 Pad3 Pad4 Pad5 Pad6 Pad7 Pad8 Pad9 PadMul PadAdd PadEnter PadSub PadDot PadDiv F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Backspace Tab Return Shift Control Alt Pause CapsLock Escape Space PageUp PageDown End Home Left Up Right Down Insert Delete LWin RWin NumLock ScrollLock LShift RShift LControl RControl LAlt RAlt SemiColon Equals Comma Minus Dot Slash BackTick LSquare BackSlash RSquare Tick )
Key scancode constants.
type WindowFlag ¶
type WindowFlag int
WindowFlag reprensets a flag for window sizing mode.
const ( // WindowFixed means a window's bitmap has a fixed size. WindowFixed WindowFlag = 1 << iota // WindowAuto means a window's bitmap will automatically resize after each Update. WindowAuto // Window2X enforces (at least) 2X pixel scale. Window2X // Window3X enforces (at least) 3X pixel scale. Window3X // Window4X enforces (at least) 4X pixel scale. Window4X // WindowRetina enables retina support on macOS. WindowRetina )