Documentation ¶
Index ¶
- func PalletIndexToColor(index int) rl.Color
- type Renderer
- func (r *Renderer) Close()
- func (r *Renderer) DrawCircle(x, y, radius int, color int)
- func (r *Renderer) DrawCircleLines(x, y, radius int, color int)
- func (r *Renderer) DrawLine(x1, y1, x2, y2 int, color int)
- func (r *Renderer) DrawOnScreen()
- func (r *Renderer) DrawPixel(x, y int, color int)
- func (r *Renderer) DrawRectangle(x, y, width, height int, color int)
- func (r *Renderer) DrawRectangleLines(x, y, width, height int, color int)
- func (r *Renderer) DrawSprite(x, y int, spr *sprite.Sprite)
- func (r *Renderer) DrawText(f *font.Font, x, y int, text string)
- func (r *Renderer) DrawTriangle(x1, y1, x2, y2, x3, y3 int, color int)
- func (r *Renderer) DrawTriangleLines(x1, y1, x2, y2, x3, y3 int, color int)
- func (r *Renderer) Fill(color int)
- func (r *Renderer) StartDrawing()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PalletIndexToColor ¶
PalletIndexToColor converts a pallet index to a color.
It takes the index of the color in the pallet. Returns the corresponding color.
Types ¶
type Renderer ¶
type Renderer struct {
Target *rl.RenderTexture2D
}
func NewRenderer ¶
NewRenderer creates a new renderer for the game.
It takes the game width, game height, and title as parameters. Returns a pointer to the renderer.
func (*Renderer) Close ¶
func (r *Renderer) Close()
Close releases the render texture and closes the window.
No parameters. No return types.
func (*Renderer) DrawCircle ¶
DrawCircle draws a circle in the texture.
It takes the x, y, and radius as parameters. No return types.
func (*Renderer) DrawCircleLines ¶
DrawCircleLines draws a circle in the texture.
It takes the x, y, and radius as parameters. No return types.
func (*Renderer) DrawLine ¶
DrawLine draws a line in the texture.
It takes the x1, y1, x2, y2, and color as parameters. No return types.
func (*Renderer) DrawOnScreen ¶
func (r *Renderer) DrawOnScreen()
DrawOnScreen draws the renderer on the screen.
No parameters. No return types.
func (*Renderer) DrawPixel ¶
DrawPixel draws a pixel in the texture.
It takes the x, y, and color as parameters. No return types.
func (*Renderer) DrawRectangle ¶
DrawRectangle draws a rectangle in the texture.
It takes the x, y, width, height, and color as parameters. No return types.
func (*Renderer) DrawRectangleLines ¶
DrawRectangleLines draws a rectangle in the texture.
It takes the x, y, width, height, and color as parameters. No return types.
func (*Renderer) DrawSprite ¶
DrawSprite draws a sprite in the texture.
It takes the x, y, and the sprite as parameters. No return types.
func (*Renderer) DrawTriangle ¶
DrawTriangle draws a triangle in the texture.
It takes the x1, y1, x2, y2, x3, y3, and color as parameters. No return types.
func (*Renderer) DrawTriangleLines ¶
DrawTriangle draws a triangle in the texture.
It takes the x1, y1, x2, y2, x3, y3, and color as parameters. No return types.
func (*Renderer) Fill ¶
Fill fills the screen with a color.
It takes the color as a parameter. No return types.
func (*Renderer) StartDrawing ¶
func (r *Renderer) StartDrawing()
StartDrawing is a function that starts the drawing process.
No parameters. No return types.