Documentation
¶
Index ¶
- Variables
- func Abs[I SInteger | Float](integer I) I
- func Clamp[N Number](min N, number N, max N) N
- func CopyTexture(ren *sdl.Renderer, texture *sdl.Texture, dst *sdl.Rect, ...)
- func CreateTextureFromSurface(ren *sdl.Renderer, surface *sdl.Surface) *sdl.Texture
- func DrawCircle(ren *sdl.Renderer, center *sdl.Point, radius int32, color sdl.Color)
- func DrawFilledCircle(ren *sdl.Renderer, center *sdl.Point, radius int32, color sdl.Color)
- func DrawFilledRectangle(ren *sdl.Renderer, rect *sdl.Rect, color sdl.Color)
- func DrawPoint(ren *sdl.Renderer, point *sdl.Point, color sdl.Color)
- func DrawRectangle(ren *sdl.Renderer, rect *sdl.Rect, color sdl.Color)
- func DrawRoundedFilledRectangle(ren *sdl.Renderer, rect *sdl.Rect, radius int32, color sdl.Color)
- func DrawThickCircle(ren *sdl.Renderer, center *sdl.Point, radius int32, width int32, ...)
- func DrawThickLine(ren *sdl.Renderer, p1 *sdl.Point, p2 *sdl.Point, width int32, color sdl.Color)
- func DrawThickRectangle(ren *sdl.Renderer, rect *sdl.Rect, width int32, color sdl.Color)
- func GetSearchURL(imageURL string) string
- func Linspace(start, stop float64, num int) []float64
- func LoadFont(fontData []byte, size int) *ttf.Font
- func LoadPNGSurface(pngData []byte) *sdl.Surface
- func Max[N Number](first N, others ...N) N
- func Min[N Number](first N, others ...N) N
- func OpenUrlInBrowser(url string)
- func ReadRGBA32(ren *sdl.Renderer, rect *sdl.Rect) []uint8
- func RectIntoSquare(rect *sdl.Rect)
- func SizeString(font *ttf.Font, text string) (int, int)
- func UploadImage(img io.Reader) (string, error)
- func WriteSurfaceToBMP(surface *sdl.Surface, writer io.Writer)
- func WriteSurfaceToGIF(surface *sdl.Surface, writer io.Writer)
- func WriteSurfaceToJPEG(surface *sdl.Surface, writer io.Writer)
- func WriteSurfaceToPNG(surface *sdl.Surface, writer io.Writer)
- func WriteSurfaceToWEBP(surface *sdl.Surface, writer io.Writer)
- type Animation
- type Float
- type Integer
- type Number
- type SInteger
- type SavingMethod
- type SavingOptions
- type StringTexture
- type TextParagraph
- func (par TextParagraph) ClosestLeftWordPos(pos int) int
- func (par TextParagraph) ClosestRightWordPos(pos int) int
- func (par TextParagraph) GetBBox() *sdl.Rect
- func (par TextParagraph) GetLineNumber(position int) int
- func (par *TextParagraph) GetLinesBoundaries() [][2]int
- func (par TextParagraph) GetOffsetByPosition(position int) (int32, int32)
- func (par TextParagraph) GetPaddedBBox(padding int32) *sdl.Rect
- func (par TextParagraph) GetPositionByOffset(xOffset int32, yOffset int32) int
- func (par *TextParagraph) InsertRunes(ren *sdl.Renderer, pos int, runes ...rune)
- func (par TextParagraph) LowerLinePos(position int) int
- func (par *TextParagraph) PopRunes(ren *sdl.Renderer, startPos, endPos int)
- func (par *TextParagraph) SetColor(color sdl.Color)
- func (par TextParagraph) UpperLinePos(position int) int
- type Uinteger
Constants ¶
This section is empty.
Variables ¶
View Source
var SavingMethods []SavingMethod = []SavingMethod{ {Name: "PNG", AllowedExtensions: []string{".png"}, WritingFunction: WriteSurfaceToPNG}, {Name: "JPEG", AllowedExtensions: []string{".jpeg", ".jpg"}, WritingFunction: WriteSurfaceToJPEG}, {Name: "GIF", AllowedExtensions: []string{".gif"}, WritingFunction: WriteSurfaceToGIF}, {Name: "WEBP", AllowedExtensions: []string{".webp"}, WritingFunction: WriteSurfaceToWEBP}, {Name: "BMP", AllowedExtensions: []string{".bmp"}, WritingFunction: WriteSurfaceToBMP}, }
Functions ¶
func CopyTexture ¶
func DrawCircle ¶
func DrawFilledCircle ¶
func DrawFilledRectangle ¶
func DrawThickCircle ¶
func DrawThickLine ¶
func DrawThickRectangle ¶
func GetSearchURL ¶
func LoadPNGSurface ¶
func OpenUrlInBrowser ¶
func OpenUrlInBrowser(url string)
func RectIntoSquare ¶
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
func NewLinearAnimation ¶
func (*Animation) CurrentValue ¶
type SavingMethod ¶
type SavingOptions ¶
type SavingOptions struct {
Filepath string
Method SavingMethod
}
func RequestSavingOptions ¶
func RequestSavingOptions( dialogTitle, dialogStartFileName string, ) ( options *SavingOptions, success bool, )
type StringTexture ¶
func NewStringTexture ¶
func (*StringTexture) Destroy ¶
func (text *StringTexture) Destroy()
type TextParagraph ¶
type TextParagraph struct {
Text []rune
StringTexture *StringTexture
TextStart sdl.Point
Color sdl.Color
Font *ttf.Font
// contains filtered or unexported fields
}
func NewTextParagraph ¶
func (TextParagraph) ClosestLeftWordPos ¶
func (par TextParagraph) ClosestLeftWordPos(pos int) int
func (TextParagraph) ClosestRightWordPos ¶
func (par TextParagraph) ClosestRightWordPos(pos int) int
func (TextParagraph) GetBBox ¶
func (par TextParagraph) GetBBox() *sdl.Rect
func (TextParagraph) GetLineNumber ¶
func (par TextParagraph) GetLineNumber(position int) int
func (*TextParagraph) GetLinesBoundaries ¶
func (par *TextParagraph) GetLinesBoundaries() [][2]int
func (TextParagraph) GetOffsetByPosition ¶
func (par TextParagraph) GetOffsetByPosition(position int) (int32, int32)
func (TextParagraph) GetPaddedBBox ¶
func (par TextParagraph) GetPaddedBBox(padding int32) *sdl.Rect
func (TextParagraph) GetPositionByOffset ¶
func (par TextParagraph) GetPositionByOffset(xOffset int32, yOffset int32) int
func (*TextParagraph) InsertRunes ¶
func (par *TextParagraph) InsertRunes(ren *sdl.Renderer, pos int, runes ...rune)
func (TextParagraph) LowerLinePos ¶
func (par TextParagraph) LowerLinePos(position int) int
func (*TextParagraph) PopRunes ¶
func (par *TextParagraph) PopRunes(ren *sdl.Renderer, startPos, endPos int)
func (*TextParagraph) SetColor ¶
func (par *TextParagraph) SetColor(color sdl.Color)
func (TextParagraph) UpperLinePos ¶
func (par TextParagraph) UpperLinePos(position int) int
Source Files
¶
Click to show internal directories.
Click to hide internal directories.