Documentation ¶
Index ¶
- func Circle(x, y int, radius float32, c color.Color) graphics.Shape
- func Clear(c color.RGBA)
- func DisableFPS()
- func EnableFPS()
- func GetCursorPosition() (int, int)
- func GetFPS() float64
- func GetScreenSize() (int, int)
- func GetWindowPosition() (int, int)
- func GetWindowSize() (int, int)
- func IsButtonPressed(buttonCode input.MouseButton) bool
- func IsKeyPressed(keyCode input.Key) bool
- func Line(x1, y1, x2, y2 int, width float32, c color.Color) graphics.Shape
- func Polygon(x, y int, width float32, sides int, c color.Color) graphics.Shape
- func PressButton(buttonCode input.MouseButton)
- func PressKey(keyCode input.Key)
- func PrintAt(s string, x int, y int, c color.Color)
- func Rectangle(x, y, width, height int, c color.Color) graphics.Shape
- func ReleaseButton(buttonCode input.MouseButton)
- func ReleaseKey(keyCode input.Key)
- func SetScreenSize(width, height int)
- func SetScrollCallback(cb func(x float64, y float64))
- func SetTitle(title string)
- func SetWindowSize(width, height int)
- func Triangle(x1, y1, x2, y2, x3, y3 int, c color.Color) graphics.Shape
- func Update(updateFn func())
- type Shape
- type Sprite
- type Texture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Circle ¶
Circle creates a circle shape with specified center, radius, and color. x, y define the center of the circle. radius defines the radius of the circle. c specifies the color of the circle.
func GetCursorPosition ¶
func GetScreenSize ¶
func GetWindowPosition ¶
func GetWindowSize ¶
GetWindowSize retrieves the current window size.
func IsButtonPressed ¶
func IsButtonPressed(buttonCode input.MouseButton) bool
func IsKeyPressed ¶
func Line ¶
Line creates a line with specified start and end points, width, and color. x1, y1 define the start point of the line. x2, y2 define the end point of the line. width defines the thickness of the line. c specifies the color of the line.
func Polygon ¶
Polygon creates a polygon shape with a specified number of sides, position, width, and color. x, y define the center of the polygon. width defines the diameter of the circumcircle of the polygon. sides specify the number of sides (vertices) of the polygon. c specifies the color of the polygon.
func PressButton ¶
func PressButton(buttonCode input.MouseButton)
func PrintAt ¶
PrintAt renders text at a specified position with a specified color. s is the string to be rendered. x, y define the position where the text will be rendered. c specifies the color of the text.
func Rectangle ¶
Rectangle creates a rectangle shape with specified position, dimensions, and color. x, y define the top-left corner of the rectangle. width, height define the dimensions of the rectangle. c specifies the color of the rectangle.
func ReleaseButton ¶
func ReleaseButton(buttonCode input.MouseButton)
func ReleaseKey ¶
func SetScreenSize ¶
func SetScreenSize(width, height int)
SetScreenSize sets the size of the screen.
func SetScrollCallback ¶
func SetWindowSize ¶
func SetWindowSize(width, height int)
SetWindowSize sets the size of the window.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
Package graphics provides functionality for 2D graphics rendering, including textures, sprites, text, and shapes.
|
Package graphics provides functionality for 2D graphics rendering, including textures, sprites, text, and shapes. |
webgpu/internal/surface
The surface package provides a virtual screen to render things to.
|
The surface package provides a virtual screen to render things to. |
pkg
|
|
component
The component package has some basic structs that are common in games (e.g.
|
The component package has some basic structs that are common in games (e.g. |
draw
draw is a package from drawing with the cpu
|
draw is a package from drawing with the cpu |
fb
The fb package provides a framebuffer abstraction.
|
The fb package provides a framebuffer abstraction. |
math/geom
The geom package provides basic geometry types and functions.
|
The geom package provides basic geometry types and functions. |